Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github action to have 'sam deploy' read parameter overrides from .parameter files #118

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -33,14 +33,15 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AwsAccount }}:role/github-actions-role
aws-region: us-east-1
- run: ln -s .tfvars/dc-api/samconfig.toml .
- run: ln -s .tfvars/dc-api/$CONFIG_ENV.parameters .
- run: sam build
- run: |
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--config-env $CONFIG_ENV \
--config-file ./samconfig.toml \
--parameter-overrides HoneybadgerRevision=$HONEYBADGER_REVISION
--parameter-overrides $(while IFS='=' read -r key value; do params+=" $key=$value"; done < ./$CONFIG_ENV.parameters && echo "$params HoneybadgerRevision=$HONEYBADGER_REVISION")
env:
HONEYBADGER_REVISION: ${{ github.sha }}
docs-changed:
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -215,3 +215,4 @@ $RECYCLE.BIN/
/samconfig.toml
/env.json
/env.*.json
/*.parameters
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -69,6 +69,25 @@ Use the [https-proxy](https://github.com/nulib/aws-developer-environment#conveni
https-proxy start 3002 3000
```

## Deploying the API manually
- Symlink the `*.parameters` file you need from `tfvars/dc-api/` to the application root
- Set your `CONFIG_ENV` and `HONEYBADGER_REVISION` environment variables
- Run `sam deploy`

```sh
# staging environment example:

ln -s ~/environment/tfvars/dc-api/staging.parameters .
CONFIG_ENV=staging
HONEYBADGER_REVISION=$(git rev-parse HEAD)
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--config-env $CONFIG_ENV \
--config-file ./samconfig.toml \
--parameter-overrides $(while IFS='=' read -r key value; do params+=" $key=$value"; done < ./$CONFIG_ENV.parameters && echo "$params HoneybadgerRevision=$HONEYBADGER_REVISION")
```

## Writing Documentation

API documentation is automatically regenerated and deployed on pushes to the staging and production branches. The documentation is in two parts: