Skip to content

Commit

Permalink
refactor: restructed project, added redis standalone supported, opens…
Browse files Browse the repository at this point in the history
…ource Redis cr
  • Loading branch information
chideat committed Aug 23, 2024
1 parent 0227cab commit 8e18e39
Show file tree
Hide file tree
Showing 393 changed files with 52,492 additions and 25,852 deletions.
397 changes: 397 additions & 0 deletions .build/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,397 @@
apiVersion: builds.katanomi.dev/v1alpha1
kind: Build
spec:
workspaces:
- description: |
This workspace is shared among all the pipeline tasks to read/write common resources
name: source
- name: config
runTemplate:
spec:
workspaces:
- name: config
configmap:
name: buildkitd-config
taskRunSpecs:
- pipelineTaskName: operator-arm64
taskPodTemplate:
nodeSelector:
kubernetes.io/arch: arm64
Tolerations:
- key: build-arm
operator: Exists
effect: NoSchedule
- pipelineTaskName: expose-arm64
taskPodTemplate:
nodeSelector:
kubernetes.io/arch: arm64
Tolerations:
- key: build-arm
operator: Exists
effect: NoSchedule
- pipelineTaskName: operator-arm64
stepOverrides:
- name: build
resources:
requests:
cpu: 1000m
memory: 2000Mi
limits:
cpu: 2000m
memory: 4000Mi
- name: push
resources:
requests:
cpu: 1000m
memory: 2000Mi
limits:
cpu: 2000m
memory: 4000Mi
- pipelineTaskName: bundle-arm64
taskPodTemplate:
nodeSelector:
kubernetes.io/arch: arm64
Tolerations:
- key: build-arm
operator: Exists
effect: NoSchedule
- pipelineTaskName: bundle-operator
stepOverrides:
- name: update-version-data
resources:
requests:
cpu: 666m
memory: 1333Mi
limits:
cpu: 2000m
memory: 4000Mi
- name: generate-related-images
resources:
requests:
cpu: 666m
memory: 1333Mi
limits:
cpu: 2000m
memory: 4000Mi
- name: operator-bundle
resources:
requests:
cpu: 668m
memory: 1334Mi
limits:
cpu: 2000m
memory: 4000Mi
- pipelineTaskName: operator-amd64
stepOverrides:
- name: build
resources:
requests:
cpu: 1000m
memory: 2000Mi
limits:
cpu: 2000m
memory: 4000Mi
- name: push
resources:
requests:
cpu: 1000m
memory: 2000Mi
limits:
cpu: 2000m
memory: 4000Mi
- pipelineTaskName: go-test
stepOverrides:
- name: prepare
resources:
requests:
cpu: 500m
memory: 1000Mi
limits:
cpu: 1500m
memory: 3000Mi
- name: test
resources:
requests:
cpu: 500m
memory: 1000Mi
limits:
cpu: 1500m
memory: 3000Mi
- name: analysis
resources:
requests:
cpu: 500m
memory: 1000Mi
limits:
cpu: 1500m
memory: 3000Mi
- pipelineTaskName: operator-merge
stepOverrides:
- name: merge
resources:
requests:
cpu: 1000m
memory: 2000Mi
limits:
cpu: 1000m
memory: 2000Mi
tasks:
- name: go-lint
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: golangci-lint
workspaces:
- name: source
workspace: source
- name: cache
workspace: source
params:
- name: tool-image
value: registry.alauda.cn:60080/devops/builder-go-121:latest
- name: command
value: >
export GOPROXY=https://build-nexus.alauda.cn/repository/golang/,https://goproxy.cn,direct
export GOMAXPROCS=4
golangci-lint --concurrency=4 run --verbose
- name: quality-gate
value: "true"
- name: quality-gate-rules
value:
- issues-count=0
- name: go-test
runAfter:
- go-lint
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: go-unit-test
workspaces:
- name: source
workspace: source
params:
- name: command
value: |-
export GOPROXY="https://build-nexus.alauda.cn/repository/golang/,https://goproxy.cn,direct"
export GONOSUMDB="gitlab-ce.alauda.cn/*,gomod.alauda.cn/*,bitbucket.org/mathildetech/*"
make test
- name: coverage-report-path
value: ./coverage.txt
- name: quality-gate
value: "false"
- name: tool-image
value: docker-mirrors.alauda.cn/library/golang:1.21.8
- name: code-scan
runAfter:
- go-test
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: sonarqube-analysis
workspaces:
- name: source
workspace: source
params:
- name: server
value: https://build-sonar.alauda.cn
- name: quality-gate
value: "false"
- name: operator-amd64
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: build-image-buildkit
workspaces:
- name: source
workspace: source
- name: config
workspace: config
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator
- name: labels
value:
- branch=$(build.git.branch.name)
- commit=$(build.git.lastCommit.id)
- name: operator-arm64
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: build-image-buildkit
workspaces:
- name: source
workspace: source
- name: config
workspace: config
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator
- name: labels
value:
- branch=$(build.git.branch.name)
- commit=$(build.git.lastCommit.id)
- name: operator-merge
runAfter:
- operator-amd64
- operator-arm64
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: merge-image-buildkit
workspaces:
- name: source
workspace: source
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator:$(build.git.version.docker)
- name: source-image-digests
value:
- $(tasks.operator-amd64.results.ociContainerImageBuild-url)
- $(tasks.operator-arm64.results.ociContainerImageBuild-url)
- name: update-values-yaml
runAfter:
- operator-merge
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: alauda-update-chart-dependencies
workspaces:
- name: source
workspace: source
when: []
params:
- name: chart-file-path
value: ./
- name: branch
value: $(build.git.branch)
- name: verbose
value: "true"
- name: bundle-operator
runAfter:
- update-values-yaml
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: alauda-operator-bundle
workspaces:
- name: source
workspace: source
params:
- name: set-skip-range
value: ">=0.0.0 <$(build.git.version.clean)"
- name: build-command
value: curl https://build-nexus.alauda.cn/repository/alauda/middleware/operator-sdk_linux/operator-sdk_1_33_linux_$(arch) -o $(go env GOPATH)/bin/operator-sdk && chmod +x $(go env GOPATH)/bin/operator-sdk && make bundle
- name: controller-version
value: $(build.git.version.docker)
- name: bundle-version
value: $(build.git.version.clean)
- name: csv-file-path
value: config/manifests/bases/redis-operator.clusterserviceversion.yaml
- name: bundle-csv-file-path
value: bundle/manifests/redis-operator.clusterserviceversion.yaml
- name: controller-values-filepath
value: values.yaml
- name: controller-values-jsonpath
value: global.images.redis-operator.tag
- name: bundle-amd64
runAfter:
- bundle-operator
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: build-image-buildkit
workspaces:
- name: source
workspace: source
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator-bundle
- name: dockerfile
value: bundle.Dockerfile
- name: labels
value:
- branch=$(build.git.branch.name)
- app_version=$(build.git.branch.name)
- commit=$(build.git.lastCommit.id)
- name: bundle-arm64
runAfter:
- bundle-operator
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: build-image-buildkit
workspaces:
- name: source
workspace: source
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator-bundle
- name: dockerfile
value: bundle.Dockerfile
- name: labels
value:
- branch=$(build.git.branch.name)
- app_version=$(build.git.branch.name)
- commit=$(build.git.lastCommit.id)
- name: bundle-merge
runAfter:
- bundle-amd64
- bundle-arm64
- code-scan
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: merge-image-buildkit
workspaces:
- name: source
workspace: source
params:
- name: container-images
value:
- build-harbor.alauda.cn/middleware/redis-operator-bundle:$(build.git.version.docker)
- name: source-image-digests
value:
- $(tasks.bundle-amd64.results.ociContainerImageBuild-url)
- $(tasks.bundle-arm64.results.ociContainerImageBuild-url)
finally:
- name: release-tag
when:
- input: "$(build.git.versionPhase)"
operator: in
values:
- custom
- ga
- input: $(tasks.status)
operator: in
values:
- Succeeded
- Completed
timeout: 30m
retries: 0
taskRef:
kind: ClusterTask
name: alauda-release-tag
workspaces:
- name: source
workspace: source
params:
- name: version
value: $(build.git.version.docker)
Loading

0 comments on commit 8e18e39

Please sign in to comment.