-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apps/prod/tekton/configs/tasks): add oras push task (#777)
Signed-off-by: wuhuizuo <wuhuizuo@126.com> --------- Signed-off-by: wuhuizuo <wuhuizuo@126.com>
- Loading branch information
Showing
8 changed files
with
200 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
apps/prod/tekton/configs/tasks/pingcap-build-binaries.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: pingcap-build-binaries | ||
labels: | ||
app.kubernetes.io/version: "0.1" | ||
annotations: | ||
tekton.dev/platforms: "linux/amd64" | ||
spec: | ||
description: >- | ||
Build binaries for the component. | ||
workspaces: | ||
- name: source | ||
- name: dockerconfig | ||
description: Includes a docker `config.json` | ||
mountPath: /root/.docker | ||
optional: true | ||
results: | ||
- description: The package artifacts | ||
name: package-artifacts | ||
type: string | ||
params: | ||
- name: component | ||
- 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'. | ||
- name: git-ref | ||
- name: git-sha | ||
- name: builder-image | ||
default: ghcr.io/pingcap-qe/ci/release-utils:v20231107-4086b32 | ||
- name: release-dir | ||
default: build | ||
- name: push | ||
type: string | ||
default: 'false' | ||
steps: | ||
- name: generate-build-script | ||
image: ghcr.io/pingcap-qe/ci/release-utils:v20231107-4086b32 | ||
script: | | ||
git clone --depth=1 --branch=main https://github.com/PingCAP-QE/artifacts.git /workspace/artifacts | ||
/workspace/artifacts/packages/scripts/gen-package-artifacts-with-config.sh \ | ||
$(params.component) \ | ||
$(params.os) \ | ||
$(params.arch) \ | ||
$(params.version) \ | ||
$(params.profile) \ | ||
$(params.git-ref) \ | ||
$(params.git-sha) \ | ||
/workspace/artifacts/packages/packages.yaml.tmpl \ | ||
/workspace/build-package-artifacts.sh | ||
cat /workspace/build-package-artifacts.sh | ||
- name: build | ||
image: "$(params.builder-image)" | ||
workingDir: $(workspaces.source.path) | ||
script: | | ||
/workspace/build-package-artifacts.sh -b -a -w "$(params.release-dir)" | ||
- name: publish | ||
image: ghcr.io/pingcap-qe/ci/release-utils:v20231107-4086b32 | ||
workingDir: $(workspaces.source.path) | ||
script: | | ||
oras version | ||
/workspace/build-package-artifacts.sh -p -w "$(params.release-dir)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: pingcap-build-images | ||
labels: | ||
app.kubernetes.io/version: "0.1" | ||
annotations: | ||
tekton.dev/platforms: "linux/amd64" | ||
spec: | ||
description: >- | ||
This task builds images for pingcap components. | ||
workspaces: | ||
- name: source | ||
- name: dockerconfig | ||
description: Includes a docker `config.json` | ||
mountPath: /kaniko/.docker | ||
optional: true | ||
results: | ||
- description: Digest of the image just built. | ||
name: IMAGE_DIGEST | ||
- description: URL of the image just built. | ||
name: IMAGE_URL | ||
params: | ||
- name: component | ||
- 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'. | ||
- name: git-ref | ||
- name: git-sha | ||
- name: release-dir | ||
default: build | ||
- name: build | ||
default: 'false' | ||
description: Does it need to build the binaries before packing the images? | ||
steps: | ||
- name: generate | ||
image: ghcr.io/pingcap-qe/ci/release-utils:v20231107-4086b32 | ||
script: | | ||
git clone --depth=1 --branch=main https://github.com/PingCAP-QE/artifacts.git /workspace/artifacts | ||
/workspace/artifacts/packages/scripts/gen-package-images-with-config.sh \ | ||
$(params.component) \ | ||
$(params.os) \ | ||
$(params.arch) \ | ||
$(params.version) \ | ||
$(params.profile) \ | ||
$(params.git-ref) \ | ||
$(params.git-sha) \ | ||
/workspace/artifacts/packages/packages.yaml.tmpl \ | ||
/workspace/build-package-images.sh | ||
cat /workspace/build-package-images.sh | ||
- name: build-and-publish | ||
image: gcr.io/kaniko-project/executor:debug | ||
workingDir: $(workspaces.source.path) | ||
env: | ||
- name: KANIKO_EXECUTOR | ||
value: /kaniko/executor | ||
script: | | ||
/workspace/build-package-images.sh "$(params.release-dir)" "$(params.tag)" ${KANIKO_EXECUTOR} "$(params.build)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
apps/prod/tekton/configs/triggers/triggers/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- pingcap-qe/artifacts/create-tag-pingcap-qe-artifacts.yaml | ||
- pingcap-qe/artifacts/pull-pingcap-qe-artifacts.yaml | ||
- pingcap-qe/artifacts/push-pingcap-qe-artifacts.yaml | ||
# - pingcap-qe/artifacts/create-tag-pingcap-qe-artifacts.yaml | ||
# - pingcap-qe/artifacts/pull-pingcap-qe-artifacts.yaml | ||
# - pingcap-qe/artifacts/push-pingcap-qe-artifacts.yaml | ||
- pingcap/create-branch-product-components-hotfix.yaml | ||
# - pingcap/tidb/push.yaml # passed | ||
- pingcap/tiflash/push.yaml | ||
# - pingcap/tiflash/push.yaml | ||
# - pingcap/tiflow/push.yaml # passed | ||
- tikv/pd/create-tag.yaml | ||
# - tikv/pd/push.yaml # passed | ||
# - tikv/pd/create-tag.yaml | ||
- tikv/pd/push.yaml # passed | ||
- tikv/tikv/push.yaml |