From 57d47f315b787270dc012e33fc5de339cd1e73e7 Mon Sep 17 00:00:00 2001 From: Vladimir Lewandowski Date: Thu, 1 Feb 2024 13:01:59 +0100 Subject: [PATCH 1/2] ci: fix Embedded UI asset placement --- .github/workflows/embedded_ui_refresh.yaml | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/embedded_ui_refresh.yaml b/.github/workflows/embedded_ui_refresh.yaml index d7cf2f073e42..065679ad349c 100644 --- a/.github/workflows/embedded_ui_refresh.yaml +++ b/.github/workflows/embedded_ui_refresh.yaml @@ -36,29 +36,33 @@ jobs: run: gh release download $TAG_NAME --repo $REPOSITORY --pattern $ASSET_NAME.zip --dir $TEMP_ASSET_DIR - name: Asset Placement env: + ASSET_DIR: monitoring START_POINTER: "# GENERATED MONITORING RESOURCES START" END_POINTER: "# GENERATED MONITORING RESOURCES END" - TARGET_DIR: ydb/core/viewer/monitoring - YA_MAKE_FILE: ydb/core/viewer/ya.make + WORKING_DIR: ydb/core/viewer run: | - unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR - rm -rf $TARGET_DIR - mkdir $TARGET_DIR - mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $TARGET_DIR + set -e + unzip $TEMP_ASSET_DIR/$ASSET_NAME.zip -d $TEMP_ASSET_DIR + + cd $WORKING_DIR + rm -rf $ASSET_DIR + mkdir $ASSET_DIR + mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $ASSET_DIR + # List of files in the target directory. - NEW_RESOURCES=$(find $TARGET_DIR -type f | sort) - + NEW_RESOURCES=$(find $ASSET_DIR -type f | sort) + # Current indentation of the start pointer line. - INDENTATION=$(grep -e "$START_POINTER" $YA_MAKE_FILE | perl -lane 's/^(\s+)(.*)+$/$1/e; print') - + INDENTATION=$(grep -e "$START_POINTER" ya.make | perl -lane 's/^(\s+)(.*)+$/$1/e; print') + # Replacing resources list between start and end pointers with saving the current indentation. perl -0777 -pi -e "s/\s+$START_POINTER.*$END_POINTER/ $INDENTATION$START_POINTER ${INDENTATION}RESOURCE( $(echo "$NEW_RESOURCES" | perl -e "while (<>) {chomp; print \"$INDENTATION \$_ \$_\\n\";}" | sed -E 's/\//\\\//g') $INDENTATION) - $INDENTATION$END_POINTER/s" $YA_MAKE_FILE + $INDENTATION$END_POINTER/s" ya.make - name: Pull Request uses: peter-evans/create-pull-request@v5 with: From e9c280db415a3ac8439a7871f4cbaa843f098226 Mon Sep 17 00:00:00 2001 From: Vladimir Lewandowski Date: Thu, 1 Feb 2024 13:03:09 +0100 Subject: [PATCH 2/2] ci: fix body formatting of Embedded UI Refresh PR --- .github/workflows/embedded_ui_refresh.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/embedded_ui_refresh.yaml b/.github/workflows/embedded_ui_refresh.yaml index 065679ad349c..1c5cfa0dc144 100644 --- a/.github/workflows/embedded_ui_refresh.yaml +++ b/.github/workflows/embedded_ui_refresh.yaml @@ -74,6 +74,4 @@ jobs: body: | ### Embedded UI Refresh - Embedded UI - [${{ env.TAG_NAME }}](https://github.com/${{ env.REPOSITORY }}/releases/tag/${{ env.TAG_NAME }}) - ([CHANGELOG.md](https://github.com/${{ env.REPOSITORY }}/blob/${{ env.TAG_NAME }}/CHANGELOG.md)). + Embedded UI [${{ env.TAG_NAME }}](https://github.com/${{ env.REPOSITORY }}/releases/tag/${{ env.TAG_NAME }}) ([CHANGELOG.md](https://github.com/${{ env.REPOSITORY }}/blob/${{ env.TAG_NAME }}/CHANGELOG.md)).