Skip to content

Commit

Permalink
Correct download URL in bootstrap script (#22)
Browse files Browse the repository at this point in the history
* fix: Correct download URL in bootstrap script

* Add a job in CI to test bootstrap script

---------

Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri authored Apr 4, 2024
1 parent 0a5c4f3 commit 4e12ac6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ jobs:
plugincheck2 -sourceCodeUri plugin-app.zip -config ./plugin-validator/config/pipeline.yaml mahendrapaipuri-dashboardreporter-app-nightly.zip
shell: bash

# Check if bootstrap script is working for latest release and nightly release
- name: Check bootstrap script
run: |
mkdir -p latest
cd latest
../scripts/bootstrap-dashboard-reporter-app.sh
cd ..
mkdir -p nightly
cd nightly
NIGHTLY=1 ../scripts/bootstrap-dashboard-reporter-app.sh
cd ..
shell: bash

- name: Upload plugin artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
6 changes: 4 additions & 2 deletions scripts/bootstrap-dashboard-reporter-app.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ fi

# Extract the latest pre-release tag from the release information
if [[ -z "$NIGHTLY" ]]; then
LATEST_RELEASE_TAG=$(echo "$ALL_RELEASES" | grep -Eo '"tag_name": "v[^"]*' | sed -E 's/"tag_name": "//' | head -n 1)
LATEST_RELEASE_TAG=$(echo "$ALL_RELEASES" | grep -Eo '"tag_name": "v[^"]*' | sed -E 's/"tag_name": "//' | sed -E 's/^.//' | head -n 1)
echo "The latest release tag of $REPO_NAME is: $LATEST_RELEASE_TAG"
DOWNLOAD_URL="https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/releases/download/v$LATEST_RELEASE_TAG/mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip"
else
echo "Using latest nightly release"
LATEST_RELEASE_TAG="nightly"
DOWNLOAD_URL="https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/releases/download/$LATEST_RELEASE_TAG/mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip"
fi

curl -L https://github.com/mahendrapaipuri/grafana-dashboard-reporter-app/releases/download/$LATEST_RELEASE_TAG/mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip --output mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip
curl -L "$DOWNLOAD_URL" --output mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip
unzip mahendrapaipuri-dashboardreporter-app-$LATEST_RELEASE_TAG.zip -d .

0 comments on commit 4e12ac6

Please sign in to comment.