Skip to content

Commit

Permalink
applying cicd updates to be triggered from swodlr repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan M Smolenski committed Feb 2, 2024
1 parent 992ce45 commit f5b7749
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
options:
- SIT
- UAT
commit:
type: string
description: Custom commit hash

jobs:
build:
Expand All @@ -38,10 +41,14 @@ jobs:
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.3.7
- uses: actions/checkout@v4
- name: Initial checkout ${{ github.ref }}
if: github.event.inputs.commit == ''
uses: actions/checkout@v4
- name: Adjust to proper commit hash ${{ github.event.inputs.commit }}
if: github.event.inputs.commit != ''
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
token: ${{ steps.podaac-cicd.outputs.token }}
ref: ${{ github.event.inputs.commit }}
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand Down Expand Up @@ -134,7 +141,6 @@ jobs:
mask-aws-account-id: true
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ needs.build.outputs.github_sha }}
- uses: hashicorp/setup-terraform@v3
with:
Expand Down Expand Up @@ -163,3 +169,16 @@ jobs:
echo "${{ secrets.JPLICA_CERT }}" >> ${{ runner.temp }}/JPLICA.pem
source bin/config.sh ${{ vars.TF_VENUE }}
terraform apply -auto-approve
- name: Retrieve version number for notifications
run: |
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: Send notifications to slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.NOTIFICATION_WEBHOOK_SWODLR }}
with:
payload: |
{
"message": "${{ github.repository }} [version ${{ env.SUBMODULE_VERSION }}] has been deployed to the ${{ needs.build.outputs.deploy_env }} environment"
}

0 comments on commit f5b7749

Please sign in to comment.