-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
15 additions
and
52 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 |
---|---|---|
|
@@ -163,7 +163,7 @@ jobs: | |
# Setup docker to build and push images | ||
- name: Log in to the Container registry | ||
# if: ${{ startsWith(github.ref, 'test') }} | ||
#if: ${{ startsWith(github.ref, 'test') }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
|
@@ -213,31 +213,14 @@ jobs: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_SERVICES_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
- run: aws sts get-caller-identity | ||
|
||
- uses: hashicorp/[email protected] | ||
with: | ||
terraform_version: 1.0.3 | ||
|
||
- name: Deploy Terraform | ||
#if: | | ||
# github.ref == 'refs/heads/develop' || | ||
# github.ref == 'refs/heads/main' || | ||
# startsWith(github.ref, 'refs/heads/release') || | ||
# github.event.head_commit.message == '/deploy sit' || | ||
# github.event.head_commit.message == '/deploy uat' | ||
working-directory: terraform/ | ||
- name: Validate Terraform | ||
run: terraform validate -no-color | ||
|
||
- name: Deploy to venue | ||
id: terraform-deploy | ||
working-directory: examples/cumulus-tf | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets[format('AWS_ACCESS_KEY_ID_SERVICES_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_SERVICES_{0}', env.TARGET_ENV_UPPERCASE)] }} | ||
AWS_DEFAULT_REGION: us-west-2 | ||
|
||
TF_VAR_hydrocron_api_api_docker_image: "ghcr.io/podaac/hydrocron:${{ env.THE_VERSION }}" | ||
|
||
run: | | ||
echo "--------" | ||
echo ${{ env.THE_ENV }} | ||
echo ${{ env.THE_VERSION }} | ||
echo ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
terraform init -reconfigure -backend-config="bucket=podaac-services-sit-terraform" -backend-config="region=us-west-2" | ||
terraform plan -var-file=tfvars/${{ env.THE_ENV }}.tfvars -var="app_version=${{ env.THE_VERSION }}" -out="tfplan" | ||
terraform apply -auto-approve tfplan | ||
./bin/deploy.sh --app-version ${{ env.THE_VERSION }} --tf-venue ${{ vars.TF_VENUE }} --lambda_container_image_uri ${{ env.CONTAINER_IMAGE_URI }} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
rm -rf dist/lambda-package || true | ||
mkdir -p dist/lambda-package | ||
cp -r ./hydrocron-api dist/lambda-package/ | ||
touch dist/lambda-package/hydrocron-api/__init__.py |
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