-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
applying cicd updates to be triggered from swodlr repo
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,9 @@ on: | |
options: | ||
- SIT | ||
- UAT | ||
commit: | ||
type: string | ||
description: Custom commit hash | ||
|
||
jobs: | ||
build: | ||
|
@@ -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' | ||
|
@@ -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: | ||
|
@@ -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" | ||
} |