From e3de50ff27468078211621006810e943b25f915c Mon Sep 17 00:00:00 2001 From: jjzhang Date: Wed, 28 Dec 2022 20:14:34 +0800 Subject: [PATCH] remove deploy uid --- .build/build.yaml | 295 ++++++++++++++++++++++++++++++++++++++ .build/opensource-version | 1 + config/controller.yaml | 3 - 3 files changed, 296 insertions(+), 3 deletions(-) create mode 100644 .build/build.yaml create mode 100644 .build/opensource-version diff --git a/.build/build.yaml b/.build/build.yaml new file mode 100644 index 00000000000..3c2129f768f --- /dev/null +++ b/.build/build.yaml @@ -0,0 +1,295 @@ +kind: Build +apiVersion: builds.katanomi.dev/v1alpha1 +spec: + runTemplate: + spec: + workspaces: + - name: cache + persistentVolumeClaim: + claimName: build-cache + workspaces: + - name: source + - name: cache + tasks: + ## read oss version + - name: oss-version + taskRef: + kind: ClusterTask + name: alauda-read-oss-version + params: + - name: version-file-path + value: ".build/opensource-version" + workspaces: + - name: source + workspace: source + - name: golang-test + taskRef: + kind: ClusterTask + name: go-unit-test + runAfter: + - oss-version + params: + - name: command + value: | + export GOPROXY=https://build-nexus.alauda.cn/repository/golang/,https://goproxy.cn,direct + export CGO_ENABLED=0 + export GONOSUMDB=* + export GOMAXPROCS=8 + go mod download + + go test -v -json -coverprofile cover.out ./... | tee test.json + + - name: quality-gate-rules + value: + - lines-coverage=10 + - passed-tests-rate=100 + - name: tool-image + value: registry.alauda.cn:60080/devops/builder-go:1.18-ubuntu-495a3d88 + - name: test-report-path + value: ./test.json + - name: coverage-report-path + value: ./cover.out + workspaces: + - name: source + workspace: source + - name: cache + workspace: cache + ## ko publish image + - name: build-entrypoint + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/entrypoint" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/entrypoint" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-git-init + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/git-init" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/git-init" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-controller + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/controller" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/controller" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-webhook + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/webhook" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/webhook" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-imagedigestexporter + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/imagedigestexporter" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/imagedigestexporter" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-kubeconfigwriter + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/kubeconfigwriter" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/kubeconfigwriter" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-nop + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/nop" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/nop" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-workingdirinit + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/workingdirinit" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/workingdirinit" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-resolvers + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/resolvers" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/resolvers" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + ## ko publish image + - name: build-pipeline-pullrequest-init + taskRef: + kind: ClusterTask + name: alauda-ko-build + workspaces: + - name: source + workspace: source + runAfter: + - oss-version + params: + - name: verbose + value: "false" + - name: import-path + value: "github.com/tektoncd/pipeline/cmd/pullrequest-init" + - name: container-image + value: "build-harbor.alauda.cn/devops/tektoncd/pipeline/cmd/pullrequest-init" + - name: container-image-tag + value: v$(tasks.oss-version.results.oss-version)-$(tasks.oss-version.results.commit-short-id) + + ################# + # code-scan + ################# + - name: code-scan + timeout: 30m + retries: 0 + taskRef: + kind: ClusterTask + name: sonarqube-analysis + workspaces: + - name: source + workspace: source + params: + - name: server + value: https://build-sonar.alauda.cn + + ################# + # runTemplate + ################# + runTemplate: + spec: + taskRunSpecs: + - pipelineTaskName: golang-test + stepOverrides: + - name: prepare + resources: + limits: + cpu: 100m + memory: 100Mi + requests: + cpu: 50m + memory: 50Mi + - name: test + resources: + requests: + cpu: "6" + memory: 4Gi + limits: + cpu: "8" + memory: 6Gi + - name: analysis + resources: + limits: + cpu: 100m + memory: 100Mi + requests: + cpu: 50m + memory: 50Mi \ No newline at end of file diff --git a/.build/opensource-version b/.build/opensource-version new file mode 100644 index 00000000000..8a0d6d408f7 --- /dev/null +++ b/.build/opensource-version @@ -0,0 +1 @@ +0.32.0 \ No newline at end of file diff --git a/config/controller.yaml b/config/controller.yaml index a02a8a8d626..67d3e75327a 100644 --- a/config/controller.yaml +++ b/config/controller.yaml @@ -131,9 +131,6 @@ spec: capabilities: drop: - all - # User 65532 is the distroless nonroot user ID - runAsUser: 65532 - runAsGroup: 65532 ports: - name: metrics containerPort: 9090