Skip to content

Commit

Permalink
auto-sync repository files - add: add storage-minio
Browse files Browse the repository at this point in the history
  • Loading branch information
katanomibot committed Dec 30, 2022
1 parent 9a2f023 commit 0628cb0
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 95 deletions.
195 changes: 101 additions & 94 deletions .build/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,150 +6,157 @@ spec:
This workspace is shared among all the pipeline tasks to read/write
common resources
name: source
- description: |
- description: >
Cache for go modules
name: cache
optional: true
tasks:
- name: boilerplate
retries: 0
params:
- name: revision
value: $(params.git-revision)
taskRef:
name: katanomi-boilerplate
kind: ClusterTask
runAfter:
- gotest
workspaces:
- name: source
workspace: source

- name: donotsubmit
params:
- name: revision
value: $(params.git-revision)
- name: donotsubmit
runAfter:
- boilerplate
retries: 0
taskRef:
name: katanomi-donotsubmit
kind: ClusterTask
runAfter:
- gotest
workspaces:
- name: source
workspace: source

- name: gotest
taskRef:
name: katanomi-gotest
kind: ClusterTask
runAfter:
- generate-version
workspaces:
- name: source
workspace: source
- name: cache
workspace: cache

- name: go-style
params:
- name: revision
value: $(params.git-revision)
- name: knative-style
runAfter:
- donotsubmit
retries: 0
taskRef:
name: katanomi-knative-style
name: katanomi-go-style
kind: ClusterTask
runAfter:
- gotest
workspaces:
- name: source
workspace: source
- name: cache
workspace: cache

- name: knative-style
params:
- name: ignore-filetypes
value: (\.png|\.drawio|\.DS_Store)$
value: '(\.png|\.drawio|\.DS_Store)$'
- name: ignore-dirs
value: (^vendor/|^third_party/|^.git|kodata)
value: '(^vendor/|^third_party/|^.git|kodata)'
- name: revision
value: $(params.git-revision)
- name: test
timeout: 30m
retries: 0
taskRef:
name: katanomi-knative-style
kind: ClusterTask
name: go-unit-test
runAfter:
- gotest
workspaces:
- name: source
workspace: source
- name: cache
workspace: cache

- name: generate-version
params:
- name: command
value: |
export GOPROXY=https://build-nexus.alauda.cn/repository/golang/,direct
export GOMAXPROCS=4
if [ "$GOCACHE" != "" ]; then
export TOOLBIN=$GOCACHE/../toolbin
mkdir -p $TOOLBIN
ls -la $TOOLBIN
fi
make test
- name: test-report-path
value: ./test.json
- name: coverage-report-path
value: ./cover.out
- name: quality-gate-rules
value:
- passed-tests-rate=100
- name: tool-image
value: registry.alauda.cn:60080/devops/builder-go:1.18-ubuntu-495a3d88
- name: golangci-lint
timeout: 30m
retries: 0
- name: repo-url
value: $(params.git-url)
- name: repo-ref
value: $(params.git-revision)
runAfter:
- git-clone
taskRef:
kind: ClusterTask
name: golangci-lint
name: katanomi-generate-version
workspaces:
- name: source
workspace: source
- name: cache
workspace: cache



#################
# code-scan
#################
- name: code-scan
params:
- name: tool-image
value: registry.alauda.cn:60080/devops/builder-go:1.18-ubuntu-495a3d88
- name: command
value: >
export GOPROXY=https://build-nexus.alauda.cn/repository/golang/,direct
golangci-lint run
- name: report-path
value: ./golangci-lint-report.txt
- name: quality-gate
value: "false"
- name: sonar-scan
runAfter:
- test
- golangci-lint
timeout: 30m
retries: 0
- name: address
value: https://build-sonar.alauda.cn
- name: version
value: $(tasks.generate-version.results.semver-version)
- name: pr-id
value: "$(tasks.generate-version.results.pr-id)"
- name: target
value: "$(tasks.generate-version.results.target-branch)"
- name: branch
value: $(tasks.generate-version.results.branch)

taskRef:
kind: ClusterTask
name: sonarqube-analysis
name: katanomi-codescan-sonarqube
workspaces:
- name: source
workspace: source
runAfter:
- generate-version
- gotest
- go-style

#################
# code-scan quality gate
#################
- name: code-scan-quality-gate
params:
- name: server
- name: address
value: https://build-sonar.alauda.cn
runTemplate:
spec:
taskRunSpecs:
- pipelineTaskName: test
stepOverrides:
- name: prepare
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 50m
memory: 50Mi
- name: test
resources:
requests:
cpu: "4"
memory: 3Gi
limits:
cpu: "4"
memory: 3Gi
- name: analysis
resources:
limits:
cpu: 100m
memory: 100Mi
requests:
cpu: 50m
memory: 50Mi

- name: pr-id
value: "$(tasks.generate-version.results.pr-id)"

- name: branch
value: $(tasks.generate-version.results.branch)

- name: target-branch
value: $(tasks.generate-version.results.target-branch)

- name: task-id
value: $(tasks.code-scan.results.task-id)

- name: project-key
value: $(tasks.code-scan.results.project-key)

- name: sonar-result-url
value: $(tasks.code-scan.results.report-html-url)

- name: repo-url
value: $(params.git-url)

taskRef:
kind: ClusterTask
name: katanomi-codescan-sonarqube-qualitygate
workspaces:
- name: source
workspace: source
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sonar.coverage.dtdVerification=false
sonar.sourceEncoding=UTF-8

sonar.sources=.
sonar.exclusions=vendor/**,test/**,**/*_generated*go,**/generated.pb.go,**/*.md,bin/*,testbin/*,**/mock/**,go.mod,go.sum
sonar.exclusions=vendor/**,test/**,**/*_generated*go,**/generated.pb.go,**/*.md,bin/*,testbin/*

sonar.tests=.
sonar.test.inclusions=**/*_test.go
Expand Down

0 comments on commit 0628cb0

Please sign in to comment.