This project uses ✨ magic of git-branch and npm scripts 🪄
- After git clone, run npm install to install dependencies
- The project uses git branches to manage environments
- It needs a unique .env file per git branch - (ex: .env.)
- Currently there are two branches - main and develop
- Duplicate the .env.example file as .env.main and .env.develop
- Modify the
DEFAULT_ACCOUNT
andDEFAULT_REGION
values
So every time you have different branches, you can add a corresponding aws sandbox or prod account
- If you want to deploy to your
dev
aws account, you only have to - Populate the relevant values in
.env.develop
git checkout develop && npm run deploy
- If you want to deploy to your
prod
aws account, you only have to - Populate the relevant values in
.env.main
git checkout main && npm run deploy
BRANCH=develop
ENVIRONMENT=dev
AWS_PROFILE = "burner"
DEFAULT_REGION = "ap-southeast-2"
DEFAULT_ACCOUNT = 123456789101
npm run build
compile typescript to jsnpm run setup-hooks
to update changes done to the git-hook/postinstall filenpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template
npm run bootstrap
Automatically picks the branch name and approprirate .env file and bootstrapsnpm run deploy
Automatically picks the branch name and approprirate .env file and deploysnpm run destroy
Automatically picks the branch name and approprirate .env file and destroys