diff --git a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_generate-build-id.yaml b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_generate-build-id.yaml index b252500..4581a41 100644 --- a/share/gitea-tekton-org/tekton.dev_v1beta1_Task_generate-build-id.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1beta1_Task_generate-build-id.yaml @@ -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: