From ef76fecf23cdf9905021382e3d6cf04c29d8fc80 Mon Sep 17 00:00:00 2001 From: Alexandre Alves Date: Thu, 5 Dec 2024 15:14:28 +0000 Subject: [PATCH] Fix slack outputs (#12820) * update * delete file that shouldnt be there * fix slack outputs on other extensions wf tests + change update script from sh to bash + bump creators version --- .../test-extension-workflows-release-2.8.yml | 27 +++++++++---------- .../test-extension-workflows-release-2.9.yml | 27 +++++++++---------- creators/extension/package.json | 2 +- creators/extension/update/upgrade | 2 +- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-extension-workflows-release-2.8.yml b/.github/workflows/test-extension-workflows-release-2.8.yml index 2e875c8b835..f5e7917b08f 100644 --- a/.github/workflows/test-extension-workflows-release-2.8.yml +++ b/.github/workflows/test-extension-workflows-release-2.8.yml @@ -86,28 +86,27 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | OUTPUT_ARRAY=("${{ needs.retrieve-tags-release-2-dot-8.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-release-2-dot-8.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-release-2-dot-8.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-release-2-dot-8.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-release-2-dot-8.outputs.build-release-shell-creators-status }}") + JOB_NAME_ARRAY=("retrieve-tags-release-2-dot-8" "test-build-extension-charts-release-2-dot-8" "test-build-extension-catalog-release-2-dot-8" "test-release-shell-pkg-release-2-dot-8" "test-release-creators-pkg-release-2-dot-8") if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then - MSG_PREFIX="Workflows testing for extensions failed! 🆘" + MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" else - MSG_PREFIX="Workflows testing for extensions succedded! ✅" + MSG_PREFIX="\nWorkflows testing for extensions succedded! ✅" fi echo "message prefix ::: $MSG_PREFIX" - TAGS_OUTPUT_STRING="status for retrieve-tags-release-2-dot-8 - build => ${{ needs.retrieve-tags-release-2-dot-8.outputs.tags-job-status }}" - EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-release-2-dot-8 - build => ${{ needs.test-build-extension-charts-release-2-dot-8.outputs.build-job-status }}" - EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-release-2-dot-8 - build => ${{ needs.test-build-extension-catalog-release-2-dot-8.outputs.build-extension-catalog-job-status }}" - RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-release-2-dot-8 - release => ${{ needs.test-release-shell-pkg-release-2-dot-8.outputs.build-release-shell-creators-status }}" - RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-release-2-dot-8 - release => ${{ needs.test-release-creators-pkg-release-2-dot-8.outputs.build-release-shell-creators-status }}" + MSG="$MSG_PREFIX" - echo $TAGS_OUTPUT_STRING - echo $EXT_CHART_BUILD_OUTPUT_STRING - echo $EXT_CATALOG_BUILD_OUTPUT_STRING - echo $RELEASE_SHELL_PKG_OUTPUT_STRING - echo $RELEASE_CREATORS_PKG_OUTPUT_STRING - - MSG="$MSG_PREFIX ::: $TAGS_OUTPUT_STRING ::: $EXT_CHART_BUILD_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" + for index in "${!OUTPUT_ARRAY[@]}" + do + if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then + EMOJI="🆘" + else + EMOJI="✅" + fi + MSG="$MSG \n::: Status for ${JOB_NAME_ARRAY[$index]} job => ${OUTPUT_ARRAY[$index]} $EMOJI" + done echo "message sent: $MSG" diff --git a/.github/workflows/test-extension-workflows-release-2.9.yml b/.github/workflows/test-extension-workflows-release-2.9.yml index dadc9563c65..19f0f1925c8 100644 --- a/.github/workflows/test-extension-workflows-release-2.9.yml +++ b/.github/workflows/test-extension-workflows-release-2.9.yml @@ -86,28 +86,27 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_EXT_WFS }} run: | OUTPUT_ARRAY=("${{ needs.retrieve-tags-release-2-dot-9.outputs.tags-job-status }}" "${{ needs.test-build-extension-charts-release-2-dot-9.outputs.build-job-status }}" "${{ needs.test-build-extension-catalog-release-2-dot-9.outputs.build-extension-catalog-job-status }}" "${{ needs.test-release-shell-pkg-release-2-dot-9.outputs.build-release-shell-creators-status }}" "${{ needs.test-release-creators-pkg-release-2-dot-9.outputs.build-release-shell-creators-status }}") + JOB_NAME_ARRAY=("retrieve-tags-release-2-dot-9" "test-build-extension-charts-release-2-dot-9" "test-build-extension-catalog-release-2-dot-9" "test-release-shell-pkg-release-2-dot-9" "test-release-creators-pkg-release-2-dot-9") if [[ ${OUTPUT_ARRAY[@]} =~ "failure" ]]; then - MSG_PREFIX="Workflows testing for extensions failed! 🆘" + MSG_PREFIX="\nWorkflows testing for extensions failed! 🆘" else - MSG_PREFIX="Workflows testing for extensions succedded! ✅" + MSG_PREFIX="\nWorkflows testing for extensions succedded! ✅" fi echo "message prefix ::: $MSG_PREFIX" - TAGS_OUTPUT_STRING="status for retrieve-tags-release-2-dot-9 - build => ${{ needs.retrieve-tags-release-2-dot-9.outputs.tags-job-status }}" - EXT_CHART_BUILD_OUTPUT_STRING="status for test-build-extension-charts-release-2-dot-9 - build => ${{ needs.test-build-extension-charts-release-2-dot-9.outputs.build-job-status }}" - EXT_CATALOG_BUILD_OUTPUT_STRING="status for test-build-extension-catalog-release-2-dot-9 - build => ${{ needs.test-build-extension-catalog-release-2-dot-9.outputs.build-extension-catalog-job-status }}" - RELEASE_SHELL_PKG_OUTPUT_STRING="status for test-release-shell-pkg-release-2-dot-9 - release => ${{ needs.test-release-shell-pkg-release-2-dot-9.outputs.build-release-shell-creators-status }}" - RELEASE_CREATORS_PKG_OUTPUT_STRING="status for test-release-creators-pkg-release-2-dot-9 - release => ${{ needs.test-release-creators-pkg-release-2-dot-9.outputs.build-release-shell-creators-status }}" + MSG="$MSG_PREFIX" - echo $TAGS_OUTPUT_STRING - echo $EXT_CHART_BUILD_OUTPUT_STRING - echo $EXT_CATALOG_BUILD_OUTPUT_STRING - echo $RELEASE_SHELL_PKG_OUTPUT_STRING - echo $RELEASE_CREATORS_PKG_OUTPUT_STRING - - MSG="$MSG_PREFIX ::: $TAGS_OUTPUT_STRING ::: $EXT_CHART_BUILD_OUTPUT_STRING ::: $EXT_CATALOG_BUILD_OUTPUT_STRING ::: $RELEASE_SHELL_PKG_OUTPUT_STRING ::: $RELEASE_CREATORS_PKG_OUTPUT_STRING" + for index in "${!OUTPUT_ARRAY[@]}" + do + if [[ ${OUTPUT_ARRAY[$index]} == "failure" ]]; then + EMOJI="🆘" + else + EMOJI="✅" + fi + MSG="$MSG \n::: Status for ${JOB_NAME_ARRAY[$index]} job => ${OUTPUT_ARRAY[$index]} $EMOJI" + done echo "message sent: $MSG" diff --git a/creators/extension/package.json b/creators/extension/package.json index 25a854edb41..663e0af4139 100644 --- a/creators/extension/package.json +++ b/creators/extension/package.json @@ -1,7 +1,7 @@ { "name": "@rancher/create-extension", "description": "Rancher UI Extension generator", - "version": "3.0.4", + "version": "3.0.5", "license": "Apache-2.0", "author": "SUSE", "packageManager": "yarn@4.5.0", diff --git a/creators/extension/update/upgrade b/creators/extension/update/upgrade index 500f97f534c..965454c0a1f 100755 --- a/creators/extension/update/upgrade +++ b/creators/extension/update/upgrade @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) BASE_DIR="$(cd $SCRIPT_DIR && cd .. && pwd)"