From 55e53d7bbbc702463cb4087f40d4b4d28158f179 Mon Sep 17 00:00:00 2001 From: Tosone Date: Tue, 17 Sep 2024 20:29:14 +0800 Subject: [PATCH] :sparkles: Add local build (#397) * :sparkles: Add local build * :bug: Fix local dockerfile --- build/local.Dockerfile | 2 +- deploy/sigma/templates/NOTES.txt | 22 -------------- main.go | 2 +- pkg/handlers/apidocs/docs.go | 2 +- pkg/handlers/apidocs/swagger.json | 2 +- pkg/handlers/apidocs/swagger.yaml | 2 +- web/package.json | 6 ++-- web/yarn.lock | 48 +++++++++++++------------------ 8 files changed, 28 insertions(+), 58 deletions(-) delete mode 100644 deploy/sigma/templates/NOTES.txt diff --git a/build/local.Dockerfile b/build/local.Dockerfile index c04f5b37..e6960872 100644 --- a/build/local.Dockerfile +++ b/build/local.Dockerfile @@ -39,7 +39,7 @@ RUN set -eux && \ mv syft /usr/local/bin/syft && \ rm syft_"${SYFT_VERSION}"_"${TARGETOS}"_"${TARGETARCH}".tar.gz -RUN useradd -rm -d /home/sigma -s /bin/sh -u 1001 sigma +RUN adduser --disabled-password -h /home/sigma -s /bin/sh -u 1001 sigma USER sigma diff --git a/deploy/sigma/templates/NOTES.txt b/deploy/sigma/templates/NOTES.txt deleted file mode 100644 index 7e5115dc..00000000 --- a/deploy/sigma/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sigma.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "sigma.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sigma.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "sigma.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/main.go b/main.go index 542185a7..95e6c53f 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ package main import "github.com/go-sigma/sigma/cmd" // @title sigma -// @version 1.0 +// @version 1.3.0 // @contact.name sigma // @contact.url https://github.com/go-sigma/sigma diff --git a/pkg/handlers/apidocs/docs.go b/pkg/handlers/apidocs/docs.go index b2dfeb70..80ed1012 100644 --- a/pkg/handlers/apidocs/docs.go +++ b/pkg/handlers/apidocs/docs.go @@ -8061,7 +8061,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ - Version: "1.0", + Version: "1.3.0", Host: "", BasePath: "/api/v1", Schemes: []string{}, diff --git a/pkg/handlers/apidocs/swagger.json b/pkg/handlers/apidocs/swagger.json index f0d5c741..71b47244 100644 --- a/pkg/handlers/apidocs/swagger.json +++ b/pkg/handlers/apidocs/swagger.json @@ -10,7 +10,7 @@ "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" }, - "version": "1.0" + "version": "1.3.0" }, "basePath": "/api/v1", "paths": { diff --git a/pkg/handlers/apidocs/swagger.yaml b/pkg/handlers/apidocs/swagger.yaml index 0a81029b..c38660d7 100644 --- a/pkg/handlers/apidocs/swagger.yaml +++ b/pkg/handlers/apidocs/swagger.yaml @@ -1743,7 +1743,7 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0 title: sigma - version: "1.0" + version: 1.3.0 paths: /{provider}/repos/coderepos/{id}/branches: get: diff --git a/web/package.json b/web/package.json index dab92037..f168d1ac 100644 --- a/web/package.json +++ b/web/package.json @@ -40,11 +40,11 @@ "xterm": "^5.3.0", "xterm-addon-attach": "^0.9.0", "xterm-addon-fit": "^0.8.0", - "zustand": "^4.5.5" + "zustand": "^5.0.0-rc.2" }, "devDependencies": { "@types/node": "^22.5.5", - "@types/react": "^18.3.5", + "@types/react": "^18.3.6", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react-swc": "^3.7.0", "autoprefixer": "^10.4.20", @@ -54,7 +54,7 @@ "tailwindcss": "^3.4.11", "terser": "^5.32.0", "typescript": "^5.6.2", - "vite": "^5.4.5" + "vite": "^5.4.6" }, "packageManager": "yarn@4.3.1" } diff --git a/web/yarn.lock b/web/yarn.lock index ef10376d..6762bdee 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -1066,13 +1066,13 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.3.5": - version: 18.3.5 - resolution: "@types/react@npm:18.3.5" +"@types/react@npm:^18.3.6": + version: 18.3.6 + resolution: "@types/react@npm:18.3.6" dependencies: "@types/prop-types": "npm:*" csstype: "npm:^3.0.2" - checksum: 10c0/548b1d3d7c2f0242fbfdbbd658731b4ce69a134be072fa83e6ab516f2840402a3f20e3e7f72e95133b23d4880ef24a6d864050dc8e1f7c68f39fa87ca8445917 + checksum: 10c0/e347787a496f2006fe61358316e040c22548a1669559277b72dad39e2f1f713080115be9fe6c30f9d1d28a54054b96cf6c06471be6967a3605e31f5b84a6cec7 languageName: node linkType: hard @@ -4051,7 +4051,7 @@ __metadata: "@tailwindcss/line-clamp": "npm:^0.4.4" "@tailwindcss/typography": "npm:^0.5.15" "@types/node": "npm:^22.5.5" - "@types/react": "npm:^18.3.5" + "@types/react": "npm:^18.3.6" "@types/react-dom": "npm:^18.3.0" "@vitejs/plugin-react-swc": "npm:^3.7.0" autoprefixer: "npm:^10.4.20" @@ -4080,11 +4080,11 @@ __metadata: tailwindcss: "npm:^3.4.11" terser: "npm:^5.32.0" typescript: "npm:^5.6.2" - vite: "npm:^5.4.5" + vite: "npm:^5.4.6" xterm: "npm:^5.3.0" xterm-addon-attach: "npm:^0.9.0" xterm-addon-fit: "npm:^0.8.0" - zustand: "npm:^4.5.5" + zustand: "npm:^5.0.0-rc.2" languageName: unknown linkType: soft @@ -4601,15 +4601,6 @@ __metadata: languageName: node linkType: hard -"use-sync-external-store@npm:1.2.2": - version: 1.2.2 - resolution: "use-sync-external-store@npm:1.2.2" - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 10c0/23b1597c10adf15b26ade9e8c318d8cc0abc9ec0ab5fc7ca7338da92e89c2536abd150a5891bf076836c352fdfa104fc7231fb48f806fd9960e0cbe03601abaf - languageName: node - linkType: hard - "util-deprecate@npm:^1.0.2": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -4663,9 +4654,9 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.4.5": - version: 5.4.5 - resolution: "vite@npm:5.4.5" +"vite@npm:^5.4.6": + version: 5.4.6 + resolution: "vite@npm:5.4.6" dependencies: esbuild: "npm:^0.21.3" fsevents: "npm:~2.3.3" @@ -4702,7 +4693,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 10c0/89c6459452fc238cdf8e99681b30996af171c9c557af476f96408a18a639fb5a0a6ee2d2257e005b21dc284edceb604595c34920cd4a007ad18f7ebafb654c76 + checksum: 10c0/5f87be3a10e970eaf9ac52dfab39cf9fff583036685252fb64570b6d7bfa749f6d221fb78058f5ef4b5664c180d45a8e7a7ff68d7f3770e69e24c7c68b958bde languageName: node linkType: hard @@ -4803,15 +4794,14 @@ __metadata: languageName: node linkType: hard -"zustand@npm:^4.5.5": - version: 4.5.5 - resolution: "zustand@npm:4.5.5" - dependencies: - use-sync-external-store: "npm:1.2.2" +"zustand@npm:^5.0.0-rc.2": + version: 5.0.0-rc.2 + resolution: "zustand@npm:5.0.0-rc.2" peerDependencies: - "@types/react": ">=16.8" + "@types/react": ">=18.0.0" immer: ">=9.0.6" - react: ">=16.8" + react: ">=18.0.0" + use-sync-external-store: ">=1.2.0" peerDependenciesMeta: "@types/react": optional: true @@ -4819,7 +4809,9 @@ __metadata: optional: true react: optional: true - checksum: 10c0/d04469d76b29c7e4070da269886de4efdadedd3d3824dc2a06ac4ff62e3b5877f925e927afe7382de651829872b99adec48082f1bd69fe486149be666345e626 + use-sync-external-store: + optional: true + checksum: 10c0/47f1f35fd3a5f75bda72d00bee1f3475c18aba2eaec17d839f09c63de3ef94c5a4988af5b00ceb92a9ded00cc033887b468cb278a9a8ed9f76a7109be01f2417 languageName: node linkType: hard