From 7f416274d56ac12db7550e1c8488c14be922b81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Sun, 21 Apr 2024 18:09:59 +0200 Subject: [PATCH] fix --- .../tekton.dev_v1_Pipeline_auto-ci-push.yaml | 2 ++ .../tekton.dev_v1_Task_auto-ci-detector.yaml | 6 ++++++ .../tekton.dev_v1beta1_Task_git-version.yaml | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml index 22be96a..8a68b0d 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml @@ -129,6 +129,8 @@ spec: value: $(params.project-name) - name: project-path value: $(params.project-path) + - name: image-version + value: $(tasks.git-version.results.packageVersion) taskRef: name: auto-ci-detector workspaces: diff --git a/share/gitea-tekton-org/tekton.dev_v1_Task_auto-ci-detector.yaml b/share/gitea-tekton-org/tekton.dev_v1_Task_auto-ci-detector.yaml index aec7c2b..c6661a8 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Task_auto-ci-detector.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Task_auto-ci-detector.yaml @@ -25,6 +25,9 @@ spec: - name: file-docker description: list of Dockerfiles if any type: array + - name: images-name + description: list of Dockerfiles image-name + type: array params: - name: toolbox-image default: sebt3/basic-toolbox-image:1.30.0 @@ -40,6 +43,8 @@ spec: - name: project-path description: The path of the current project type: string + - name: image-version + type: string steps: - name: detect-stages image: $(params.toolbox-image) @@ -137,6 +142,7 @@ spec: ret = [] for f in dockerfiles: dir = os.path.dirname(f) + ret.append("$(params.artifactory-url)/$(params.project-path):$(params.image-version)") print('get_image_name', dir, root_dir) return ret def get_stages(files,root_dir): diff --git a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml index 3bb8cdd..4dbc1c2 100644 --- a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_git-version.yaml @@ -40,8 +40,8 @@ spec: echo -n "${FullSemVer}" | tee $(results.gitVersion.path) # normalize a bit because # image tags can only contain `abcdefghijklmnopqrstuvwxyz0123456789_-.ABCDEFGHIJKLMNOPQRSTUVWXYZ` - PACKAGEVERSION=$(echo -n $FullSemVer | sed 's/[^-._0-9A-Za-z]/-/g') - echo -n "${PACKAGEVERSION}" | tee $(results.packageVersion.path) + packageVersion=$(echo -n $FullSemVer | sed 's/[^-._0-9A-Za-z]/-/g') + echo -n "${packageVersion}" | tee $(results.packageVersion.path) workspaces: - name: source description: A workspace that contains the fetched git repository to create a version for. \ No newline at end of file