This commit is contained in:
2024-04-21 18:09:59 +02:00
parent f56b500d61
commit 7f416274d5
3 changed files with 10 additions and 2 deletions

View File

@@ -129,6 +129,8 @@ spec:
value: $(params.project-name) value: $(params.project-name)
- name: project-path - name: project-path
value: $(params.project-path) value: $(params.project-path)
- name: image-version
value: $(tasks.git-version.results.packageVersion)
taskRef: taskRef:
name: auto-ci-detector name: auto-ci-detector
workspaces: workspaces:

View File

@@ -25,6 +25,9 @@ spec:
- name: file-docker - name: file-docker
description: list of Dockerfiles if any description: list of Dockerfiles if any
type: array type: array
- name: images-name
description: list of Dockerfiles image-name
type: array
params: params:
- name: toolbox-image - name: toolbox-image
default: sebt3/basic-toolbox-image:1.30.0 default: sebt3/basic-toolbox-image:1.30.0
@@ -40,6 +43,8 @@ spec:
- name: project-path - name: project-path
description: The path of the current project description: The path of the current project
type: string type: string
- name: image-version
type: string
steps: steps:
- name: detect-stages - name: detect-stages
image: $(params.toolbox-image) image: $(params.toolbox-image)
@@ -137,6 +142,7 @@ spec:
ret = [] ret = []
for f in dockerfiles: for f in dockerfiles:
dir = os.path.dirname(f) dir = os.path.dirname(f)
ret.append("$(params.artifactory-url)/$(params.project-path):$(params.image-version)")
print('get_image_name', dir, root_dir) print('get_image_name', dir, root_dir)
return ret return ret
def get_stages(files,root_dir): def get_stages(files,root_dir):

View File

@@ -40,8 +40,8 @@ spec:
echo -n "${FullSemVer}" | tee $(results.gitVersion.path) echo -n "${FullSemVer}" | tee $(results.gitVersion.path)
# normalize a bit because # normalize a bit because
# image tags can only contain `abcdefghijklmnopqrstuvwxyz0123456789_-.ABCDEFGHIJKLMNOPQRSTUVWXYZ` # image tags can only contain `abcdefghijklmnopqrstuvwxyz0123456789_-.ABCDEFGHIJKLMNOPQRSTUVWXYZ`
PACKAGEVERSION=$(echo -n $FullSemVer | sed 's/[^-._0-9A-Za-z]/-/g') packageVersion=$(echo -n $FullSemVer | sed 's/[^-._0-9A-Za-z]/-/g')
echo -n "${PACKAGEVERSION}" | tee $(results.packageVersion.path) echo -n "${packageVersion}" | tee $(results.packageVersion.path)
workspaces: workspaces:
- name: source - name: source
description: A workspace that contains the fetched git repository to create a version for. description: A workspace that contains the fetched git repository to create a version for.