Skip to content

Commit

Permalink
fix(apps/prod/tekton/configs): fix building pipeline for artifacts
Browse files Browse the repository at this point in the history
…repo (#678)
  • Loading branch information
wuhuizuo authored Sep 5, 2023
1 parent 488cb42 commit 18bc23b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ kind: Pipeline
metadata:
name: pull-pingcap-qe-artifacts-build-image
spec:
workspaces:
- name: git-source
params:
- name: git-url
type: string
- name: git-revision
default: main
# - name: IMAGE
# description: Name (reference) of the image to build.
- name: TAGS
description: image tags to push additionally.
default: "dev"
# - name: DOCKERFILE
# description: Path to the Dockerfile to build.
# default: ./Dockerfile
# - name: CONTEXT
# description: The build context used by Kaniko.
# default: ./
- name: BUILDER_IMAGE
description: The image on which builds will run.
default: gcr.io/kaniko-project/executor:v1.9.1
- name: EXTRA_ARGS
type: array
default: []
tasks:
- name: fetch-from-git
taskRef:
Expand All @@ -21,14 +37,67 @@ spec:
workspaces:
- name: output
workspace: git-source
- name: hello
taskSpec:
steps:
- name: echo
image: debian:latest
script: |
pwd
df -h
echo hello
- name: build-ci-base-amd64
runAfter:
- fetch-from-git
taskRef:
name: kaniko
params:
- name: IMAGE
value: hub.pingcap.net/ee/ci/base
- name: CONTEXT
value: dockerfiles/ci-runtimes/base/
- name: DOCKERFILE
value: Dockerfile
- name: BUILDER_IMAGE
value: "$(params.BUILDER_IMAGE)"
- name: EXTRA_ARGS
value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=amd64]
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: dockerconfig
- name: build-ci-base-arm64
runAfter:
- fetch-from-git
taskRef:
name: kaniko
params:
- name: IMAGE
value: hub.pingcap.net/ee/ci/base
- name: CONTEXT
value: dockerfiles/ci-runtimes/base/
- name: DOCKERFILE
value: Dockerfile
- name: BUILDER_IMAGE
value: "$(params.BUILDER_IMAGE)"
- name: EXTRA_ARGS
value: ["$(params.EXTRA_ARGS[*])", --build-arg, ARCH=arm64]
workspaces:
- name: source
workspace: git-source
- name: dockerconfig
workspace: dockerconfig
- name: mult-arch-push
runAfter:
- build-ci-base-amd64
- build-ci-base-arm64
taskRef:
name: multi-arch-image-push
params:
- name: IMAGE
value: hub.pingcap.net/ee/ci/base
- name: tags
value: "$(params.TAGS)"
- name: platform-and-digest-list
value:
- linux/amd64 => $(tasks.build-ci-base-amd64.results.IMAGE_DIGEST)
- linux/arm64 => $(tasks.build-ci-base-arm64.results.IMAGE_DIGEST)
workspaces:
- name: dockerconfig
workspace: dockerconfig
workspaces:
- name: git-source
- name: dockerconfig # contains file: config.json
optional: true
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,26 @@ spec:
value: $(tt.params.git-url)
- name: git-revision
value: $(tt.params.git-revision)
- name: EXTRA_ARGS
value: [--cache=true]
taskRunSpecs:
- pipelineTaskName: build-ci-base-arm64
taskPodTemplate:
nodeSelector:
kubernetes.io/arch: arm64
- pipelineTaskName: build-ci-base-amd64
taskPodTemplate:
nodeSelector:
kubernetes.io/arch: amd64
workspaces:
- name: dockerconfig
secret:
secretName: hub-pingcap-net-ee
- name: git-source
volumeClaimTemplate:
spec:
accessModes: [ReadWriteOnce]
storageClassName: ceph-filesystem
accessModes: [ReadWriteMany]
resources:
requests:
storage: 1Gi

0 comments on commit 18bc23b

Please sign in to comment.