Skip to content

Commit

Permalink
refactor(apps/prod/tekton/configs/tasks): extract the task and make e…
Browse files Browse the repository at this point in the history
…xeclude the date tags (#880)

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

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Dec 18, 2023
1 parent 4170a0e commit 2fc94c1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,8 @@ spec:
- name: get-release-ver
runAfter:
- checkout
taskSpec:
results:
- name: version
description: The release version of the git repo
workspaces:
- name: source
steps:
- name: git-describe
image: alpine/git:2.40.1
workingDir: $(workspaces.source.path)
script: |
RESULT_VERSION="$(git describe --tags --always --dirty)"
printf "%s" "${RESULT_VERSION}" > $(results.version.path)
taskRef:
name: pingcap-get-release-version
workspaces:
- name: source
workspace: source
Expand Down
15 changes: 2 additions & 13 deletions apps/prod/tekton/configs/pipelines/pingcap-build-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,8 @@ spec:
- name: get-release-ver
runAfter:
- checkout
taskSpec:
results:
- name: version
description: The release version of the git repo
workspaces:
- name: source
steps:
- name: git-describe
image: alpine/git:2.40.1
workingDir: $(workspaces.source.path)
script: |
RESULT_VERSION="$(git describe --tags --always --dirty)"
printf "%s" "${RESULT_VERSION}" > $(results.version.path)
taskRef:
name: pingcap-get-release-version
workspaces:
- name: source
workspace: source
Expand Down
1 change: 1 addition & 0 deletions apps/prod/tekton/configs/tasks/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ resources:
- pingcap-build-binaries.yaml
- pingcap-build-images.yaml
- pingcap-get-builder-image.yaml
- pingcap-get-release-version.yaml
- run-build-binaries-scripts.yaml
- run-build-images-scripts.yaml
22 changes: 22 additions & 0 deletions apps/prod/tekton/configs/tasks/pingcap-get-release-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: pingcap-get-release-version
spec:
results:
- description: The release version of the git repo
name: version
type: string
steps:
- image: alpine/git:2.40.1
name: git-describe
workingDir: $(workspaces.source.path)
resources:
requests:
memory: 512Mi
cpu: '100m'
script: |
RESULT_VERSION="$(git describe --tags --always --dirty --exclude 'v20[0-9][0-9].[0-1][0-9].[0-3][0-9]*')"
printf "%s" "${RESULT_VERSION}" > $(results.version.path)
workspaces:
- name: source

0 comments on commit 2fc94c1

Please sign in to comment.