Skip to content

Swodlr Deployment

Swodlr Deployment #32

Workflow file for this run

name: Swodlr Deployment
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
venue:
type: choice
description: Venue to deploy to
options:
- SIT
- UAT
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- uses: getsentry/action-github-app-token@v2
name: my-app-install token
id: podaac-cicd
with:
app_id: ${{ secrets.CICD_APP_ID }}
private_key: ${{ secrets.CICD_APP_PRIVATE_KEY }}
- name: Set venue
run: |
echo "VENUE=${{ github.event.inputs.venue }}">>$GITHUB_ENV
echo "PROJECT_NAME=podaac">>$GITHUB_ENV
- uses: actions/checkout@v4
- name: Update submodules
run: |
git submodule update --init
## swodlr-api
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-api"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'
## swodlr-async-update
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-async-update"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'
## swodlr-raster-create
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-raster-create"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'
## swodlr-ingest-to-sds
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-ingest-to-sds"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'
## swodlr-user-notify
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-user-notify"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'
## swodlr-ui
- name: Determine Submodule Hash
run: |
SUBMODULE_NAME="swodlr-ui"
echo "SUBMODULE_NAME=$SUBMODULE_NAME">>$GITHUB_ENV
GITHUB_LONG_HASH=$(git submodule status|grep $SUBMODULE_NAME|sed -E "s/ swodlr.*//" |sed -E "s/ //g"|sed -E "s/^-//")
echo "GITHUB_LONG_HASH=$GITHUB_LONG_HASH">>$GITHUB_ENV
cd $SUBMODULE_NAME
VERSION=$(cat bumpver.toml|grep current_version |grep -v {version} |sed -E "s/current_version = //"|sed -E "s/\"//g")
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Trigger deploy of ${{ env.SUBMODULE_NAME}} version ${{ env.SUBMODULE_VERSION }} [${{ env.GITHUB_LONG_HASH }}] to ${{ env.VENUE }}
run: |
# trigger the remote job
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.podaac-cicd.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.PROJECT_NAME }}/${{ env.SUBMODULE_NAME }}/actions/workflows/build.yml/dispatches \
-d '{"ref":"develop","inputs":{"venue":"${{ env.VENUE }}", "commit":"${{ env.GITHUB_LONG_HASH }}"}}'