From 116adf7cc2971b78aef6eff4349547be58121dd7 Mon Sep 17 00:00:00 2001 From: RHTAP bot Date: Fri, 27 Sep 2024 00:08:52 +0000 Subject: [PATCH] Sync build-definitions --- pac/pipelines/docker-build-rhtap.yaml | 6 +++--- pac/tasks/git-clone.yaml | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pac/pipelines/docker-build-rhtap.yaml b/pac/pipelines/docker-build-rhtap.yaml index 567064e..de3bf2e 100644 --- a/pac/pipelines/docker-build-rhtap.yaml +++ b/pac/pipelines/docker-build-rhtap.yaml @@ -187,10 +187,10 @@ spec: name: acs-deploy-check when: - input: $(params.event-type) - operator: notin + operator: in values: - - pull_request - - Merge Request + - push + - Push - name: update-deployment params: - name: gitops-repo-url diff --git a/pac/tasks/git-clone.yaml b/pac/tasks/git-clone.yaml index 5ecb436..85e874f 100644 --- a/pac/tasks/git-clone.yaml +++ b/pac/tasks/git-clone.yaml @@ -33,6 +33,10 @@ spec: description: Perform a shallow clone, fetching only the most recent N commits. name: depth type: string + - name: shortCommitLength + description: Length of short commit SHA + type: string + default: "7" - default: "true" description: Set the `http.sslVerify` global git config. Setting this to `false` is not advised unless you are sure that you trust your git remote. name: sslVerify @@ -94,6 +98,8 @@ spec: results: - description: The precise commit SHA that was fetched by this Task. name: commit + - description: The commit SHA that was fetched by this Task limited to params.shortCommitLength number of characters + name: short-commit - description: The precise URL that was fetched by this Task. name: url - description: The commit timestamp of the checkout @@ -113,6 +119,8 @@ spec: value: $(params.submodules) - name: PARAM_DEPTH value: $(params.depth) + - name: PARAM_SHORT_COMMIT_LENGTH + value: $(params.shortCommitLength) - name: PARAM_SSL_VERIFY value: $(params.sslVerify) - name: PARAM_SUBDIRECTORY @@ -231,11 +239,13 @@ spec: -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}" cd "${CHECKOUT_DIR}" RESULT_SHA="$(git rev-parse HEAD)" + RESULT_SHA_SHORT="$(git rev-parse --short="${PARAM_SHORT_COMMIT_LENGTH}" HEAD)" EXIT_CODE="$?" if [ "${EXIT_CODE}" != 0 ] ; then exit "${EXIT_CODE}" fi printf "%s" "${RESULT_SHA}" > "$(results.commit.path)" + printf "%s" "${RESULT_SHA_SHORT}" > "$(results.short-commit.path)" printf "%s" "${PARAM_URL}" > "$(results.url.path)" printf "%s" "$(git log -1 --pretty=%ct)" > "$(results.commit-timestamp.path)"