This commit is contained in:
2024-04-25 15:48:37 +02:00
parent 1c9a9ee26b
commit e7abe46547

View File

@@ -30,28 +30,19 @@ spec:
- name: build-id
description: Current commitcount
steps:
- name: get-timestamp
image: $(params.toolbox-image)
script: |
#!/usr/bin/env bash
ts=`date "+%Y%m%d-%H%M%S"`
echo -n "Current Timestamp: "
echo -n ${ts} | tee $(results.timestamp.path)
- name: get-commitcount
- name: get-build-id
image: $(params.toolbox-image)
workingDir: $(workspaces.source.path)
script: |
#!/usr/bin/env bash
ts=`date "+%Y%m%d-%H%M%S"`
t2=`date "+%Y%m%d.%H%M%S"`
cc=`git rev-list --count HEAD`
buildId="$(params.branch)-${cc}.${t2}"
echo -n "Current Timestamp: "
echo -n ${ts} | tee $(results.timestamp.path)
echo -n "Commit Count: "
echo -n ${cc} | tee $(results.commitcount.path)
- name: get-build-id
image: $(params.toolbox-image)
script: |
#!/usr/bin/env bash
ts=`cat $(results.timestamp.path)|sed 's/-/./`
cc=`cat $(results.commitcount.path)`
buildId="$(params.branch)-${cc}.${ts}"
echo -n "Build ID: "
echo -n ${buildId} | tee $(results.build-id.path)
workspaces: