diff --git a/tekton/get-version.yaml b/tekton/get-version.yaml index e37406222..57d24f0d3 100644 --- a/tekton/get-version.yaml +++ b/tekton/get-version.yaml @@ -10,19 +10,15 @@ spec: - name: package description: base package where the source code lies steps: - - name: pull - image: goreleaser/goreleaser + - name: pull-get-versions + image: alpine/git:v2.40.1 workingDir: $(workspaces.source.path) script: | + git config --global --add safe.directory $(workspaces.source.path) git status && git fetch -p --all - - name: get-versions - # because it has git - image: goreleaser/goreleaser - workingDir: $(workspaces.source.path) - script: | - echo -n $(git tag --points-at HEAD) > /tekton/results/version - echo -n $(git tag --points-at HEAD | sed 's/^v\([^\.]*\)\.\([^\.]*\).*/\1/') > /tekton/results/major - echo -n $(git tag --points-at HEAD | sed 's/^v\([^\.]*\)\.\([^\.]*\).*/\2/') > /tekton/results/minor + echo -n $(git tag --points-at HEAD) > $(results.version.path) + echo -n $(git tag --points-at HEAD | sed 's/^v\([^\.]*\)\.\([^\.]*\).*/\1/') > $(results.major.path) + echo -n $(git tag --points-at HEAD | sed 's/^v\([^\.]*\)\.\([^\.]*\).*/\2/') > $(results.minor.path) results: - name: version - name: major diff --git a/tekton/release-pipeline.yml b/tekton/release-pipeline.yml index de347a4b3..daa53af57 100644 --- a/tekton/release-pipeline.yml +++ b/tekton/release-pipeline.yml @@ -100,7 +100,7 @@ spec: - name: github-token-secret-key value: $(params.github-token-secret-key) - name: image - value: goreleaser/goreleaser:v1.11.5 + value: goreleaser/goreleaser:v1.20.0 workspaces: - name: source workspace: shared-workspace diff --git a/tekton/release.sh b/tekton/release.sh index 56d1fc0c6..2356c1c17 100755 --- a/tekton/release.sh +++ b/tekton/release.sh @@ -115,14 +115,15 @@ kubectl create namespace ${TARGET_NAMESPACE} 2>/dev/null || true for task in ${CATALOG_TASKS};do if [ ${task} == "lint" ]; then - kubectl -n ${TARGET_NAMESPACE} apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/golangci-${task}/0.2/golangci-${task}.yaml + tkn -n ${TARGET_NAMESPACE} hub install task golangci-lint else - kubectl -n ${TARGET_NAMESPACE} apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/golang-${task}/0.2/golang-${task}.yaml + tkn -n ${TARGET_NAMESPACE} hub install task golang-${task} fi done -kubectl -n ${TARGET_NAMESPACE} apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.6/git-clone.yaml -kubectl -n ${TARGET_NAMESPACE} apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/goreleaser/0.2/goreleaser.yaml +tkn -n ${TARGET_NAMESPACE} install task git-clone +tkn -n ${TARGET_NAMESPACE} install task goreleaser + kubectl -n ${TARGET_NAMESPACE} apply -f ./tekton/get-version.yaml kubectl -n ${TARGET_NAMESPACE} apply -f ./tekton/publish.yaml