Skip to content

Commit

Permalink
feat(apps/prod/tekton/configs/triggers): enable trigger for fips feat…
Browse files Browse the repository at this point in the history
…ure branches (#869)

Signed-off-by: wuhuizuo <[email protected]>

---------

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Dec 16, 2023
1 parent 97b558e commit 36d300c
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ spec:
default: amd64
- name: profile
default: release
- name: binary-builder-iamge
description: The image used to build binaries.
default: ghcr.io/pingcap-qe/cd/utils/release:5d33328
- name: push
default: 'true'
workspaces:
Expand Down Expand Up @@ -66,7 +63,7 @@ spec:
workspace: git-basic-auth
- name: get-release-ver
runAfter:
- checkout
- checkout
taskSpec:
results:
- name: version
Expand All @@ -83,6 +80,20 @@ spec:
workspaces:
- name: source
workspace: source
- name: get-binaries-builder
taskRef:
name: pingcap-get-builder-image
params:
- name: component
value: "$(params.component)"
- name: os
value: darwin
- name: arch
value: "$(params.arch)"
- name: profile
value: "$(params.profile)"
- name: version
value: "$(tasks.get-release-ver.results.version)"
- name: acquire-mac-machine
runAfter:
- checkout
Expand Down Expand Up @@ -118,8 +129,7 @@ spec:
- name: git-sha
value: $(params.git-revision)
- name: builder-image
# value: ghcr.io/pingcap-qe/ci/release-build-base:v20231029-b8b8d34-go1.21
value: $(params.binary-builder-iamge)
value: "$(tasks.get-binaries-builder.results.image-url)"
- name: release-dir
value: build
- name: push
Expand Down
24 changes: 17 additions & 7 deletions apps/prod/tekton/configs/pipelines/pingcap-build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ spec:
default: amd64
- name: profile
default: release
- name: binary-builder-iamge
description: The image used to build binaries.
default: ghcr.io/pingcap-qe/cd/utils/release:5d33328
- name: push
default: 'true'
results:
Expand Down Expand Up @@ -74,6 +71,8 @@ spec:
- name: basic-auth
workspace: git-basic-auth
- name: get-release-ver
runAfter:
- checkout
taskSpec:
results:
- name: version
Expand All @@ -87,11 +86,23 @@ spec:
script: |
RESULT_VERSION="$(git describe --tags --always --dirty)"
printf "%s" "${RESULT_VERSION}" > $(results.version.path)
runAfter:
- checkout
workspaces:
- name: source
workspace: source
- name: get-binaries-builder
taskRef:
name: pingcap-get-builder-image
params:
- name: component
value: "$(params.component)"
- name: os
value: "$(params.os)"
- name: arch
value: "$(params.arch)"
- name: profile
value: "$(params.profile)"
- name: version
value: "$(tasks.get-release-ver.results.version)"
- name: build-binaries
taskRef:
name: pingcap-build-binaries
Expand All @@ -112,8 +123,7 @@ spec:
- name: git-sha
value: $(params.git-revision)
- name: builder-image
# value: ghcr.io/pingcap-qe/ci/release-build-base:v20231029-b8b8d34-go1.21
value: $(params.binary-builder-iamge)
value: "$(tasks.get-binaries-builder.results.image-url)"
- name: release-dir
value: build
- name: push
Expand Down
7 changes: 4 additions & 3 deletions apps/prod/tekton/configs/tasks/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: ee-cd
resources:
- boskos-acquire.yaml # from: https://hub.tekton.dev/tekton/task/boskos-acquire
- boskos-release.yaml # from: https://hub.tekton.dev/tekton/task/boskos-release
- create-pr-to-sync-owners.yaml
- echo.yaml
- gen-build-binaries-scripts.yaml
Expand All @@ -17,10 +19,9 @@ resources:
- kubernetes-actions.yaml
- multi-arch-image-collect.yaml
- multi-arch-image-push.yaml
- pingcap-build-binaries.yaml
- pingcap-build-binaries-darwin.yaml
- pingcap-build-binaries.yaml
- pingcap-build-images.yaml
- pingcap-get-builder-image.yaml
- run-build-binaries-scripts.yaml
- run-build-images-scripts.yaml
- boskos-acquire.yaml # from: https://hub.tekton.dev/tekton/task/boskos-acquire
- boskos-release.yaml # from: https://hub.tekton.dev/tekton/task/boskos-release
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
if [ -f "$out_script" ]; then
cat "$out_script"
else
echo "🤷 no output script generated!"
fi
- name: prepare-remote-builder
image: ghcr.io/pingcap-qe/cd/utils/release:5d33328
Expand Down Expand Up @@ -183,7 +185,8 @@ spec:
script: |
script="/workspace/build-package-artifacts.sh"
if [ ! -f "$script" ]; then
echo "No build script, skip build."
echo "No build script, skip it."
echo '{}' > $(results.pushed.path)
exit 0
fi
Expand Down
15 changes: 12 additions & 3 deletions apps/prod/tekton/configs/tasks/pingcap-build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/platforms: "linux/amd64"
tekton.dev/platforms: "linux/amd64,linux/arm64"
spec:
description: >-
Build binaries for the component.
Expand Down Expand Up @@ -74,20 +74,29 @@ spec:
if [ -f "$out_script" ]; then
cat "$out_script"
else
echo "🤷 no output script generated!"
fi
- name: build
image: "$(params.builder-image)"
workingDir: $(workspaces.source.path)
# TODO: get the user and host by better way.
script: |
/workspace/build-package-artifacts.sh -b -a -w "$(params.release-dir)"
script="/workspace/build-package-artifacts.sh"
if [ ! -f "$script" ]; then
echo "No build script, skip it."
exit 0
fi
"$script" -b -a -w "$(params.release-dir)"
- name: publish
image: ghcr.io/pingcap-qe/cd/utils/release:5d33328
workingDir: $(workspaces.source.path)
script: |
script="/workspace/build-package-artifacts.sh"
if [ ! -f "$script" ]; then
echo "No build script, skip build."
echo "No build script, skip it."
echo '{}' > $(results.pushed.path)
exit 0
fi
Expand Down
7 changes: 5 additions & 2 deletions apps/prod/tekton/configs/tasks/pingcap-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/platforms: "linux/amd64"
tekton.dev/platforms: "linux/amd64,linux/arm64"
spec:
description: >-
This task builds images for pingcap components.
Expand Down Expand Up @@ -66,6 +66,8 @@ spec:
if [ -f "$out_script" ]; then
cat "$out_script"
else
echo "🤷 no output script generated!"
fi
- name: build-and-publish
image: gcr.io/kaniko-project/executor:debug
Expand All @@ -76,7 +78,8 @@ spec:
script: |
script="/workspace/build-package-images.sh"
if [ ! -f "$script" ]; then
echo "No build script, skip build."
echo "No build script, skip it."
echo '{}' > $(results.pushed.path)
exit 0
fi
Expand Down
47 changes: 47 additions & 0 deletions apps/prod/tekton/configs/tasks/pingcap-get-builder-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: pingcap-get-builder-image
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/platforms: "linux/amd64,linux/arm64"
spec:
description: >-
Build binaries for the component.
results:
- description: The builder image url
name: image-url
type: string
params:
- name: component
type: string
- name: os
default: linux
- name: arch
default: amd64
- name: version
type: string
description: the version to releasing.
- name: profile
type: string
default: release
description: >
supports: 'release' or 'debug' or others.
steps:
- name: get
image: ghcr.io/pingcap-qe/cd/utils/release:5d33328
script: |
git clone --depth=1 --branch=main https://github.com/PingCAP-QE/artifacts.git /workspace/artifacts
out="/workspace/builder-package-artifacts.txt"
/workspace/artifacts/packages/scripts/get-package-builder-with-config.sh \
$(params.component) \
$(params.os) \
$(params.arch) \
$(params.version) \
$(params.profile) \
/workspace/artifacts/packages/packages.yaml.tmpl \
$out
printf "%s" "$(cat $out)" > $(results.image-url.path)
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
value: linux
- name: arch
value: amd64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tidb:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -95,8 +93,6 @@ spec:
value: linux
- name: arch
value: arm64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tidb:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -127,7 +123,7 @@ spec:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: build-package-pingcap-tiflow-darwin-
generateName: build-package-pingcap-tidb-darwin-
annotations:
"tekton.dev/ce-context": $(tt.params.ce-context)
"tekton.dev/git-status": "true"
Expand All @@ -148,8 +144,6 @@ spec:
value: tidb
- name: arch
value: amd64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tidb:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: acquire-mac-machine
taskPodTemplate:
Expand Down Expand Up @@ -204,8 +198,6 @@ spec:
value: tidb
- name: arch
value: arm64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tidb:v20231115-e1c4b43-go1.21
workspaces:
- name: dockerconfig
secret:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
value: linux
- name: arch
value: amd64
- name: binary-builder-iamge
value: hub.pingcap.net/ee/ci/release-build-base-tiflash:v20231106
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -101,8 +99,6 @@ spec:
value: linux
- name: arch
value: arm64
- name: binary-builder-iamge
value: hub.pingcap.net/ee/ci/release-build-base-tiflash:v20231106
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -160,8 +156,6 @@ spec:
value: tiflash
- name: arch
value: amd64
- name: binary-builder-iamge
value: hub.pingcap.net/ee/ci/release-build-base-tiflash:v20231106
taskRunSpecs:
- pipelineTaskName: acquire-mac-machine
taskPodTemplate:
Expand Down Expand Up @@ -216,8 +210,6 @@ spec:
value: tiflash
- name: arch
value: arm64
- name: binary-builder-iamge
value: hub.pingcap.net/ee/ci/release-build-base-tiflash:v20231106
timeouts:
pipeline: 3h
workspaces:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
value: linux
- name: arch
value: amd64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tiflow:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -95,8 +93,6 @@ spec:
value: linux
- name: arch
value: arm64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tiflow:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: build-binaries
taskPodTemplate:
Expand Down Expand Up @@ -148,8 +144,6 @@ spec:
value: tiflow
- name: arch
value: amd64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tiflow:v20231115-e1c4b43-go1.21
taskRunSpecs:
- pipelineTaskName: acquire-mac-machine
taskPodTemplate:
Expand Down Expand Up @@ -204,8 +198,6 @@ spec:
value: tiflow
- name: arch
value: arm64
- name: binary-builder-iamge
value: ghcr.io/pingcap-qe/cd/builders/tiflow:v20231115-e1c4b43-go1.21
workspaces:
- name: dockerconfig
secret:
Expand Down
Loading

0 comments on commit 36d300c

Please sign in to comment.