These scripts allows you to use separate AWS account for your staging and production environments.
- Create two teams on Vapor (
App Production
andApp Staging
). Each team has their own AWS credentials. - Create a project inside
App production
(https://docs.vapor.build/1.0/projects/the-basics.html#creating-projects) - Rename
vapor.yml
tovapor.production.yml
- Run
vapor team:switch
, switch toApp Staging
and create a new Vapor project - Rename
vapor.yml
tovapor.staging.yml
- In Vapor
App Production
delete the staging environment, and inApp Staging
delete the production environment
Now you have two projects on Vapor in different teams connected to different AWS accounts.
Copy vapor.sh
and deploy.sh
from this project and throw them in the root of your projects.
Change the .env file:
./vapor.sh staging env:pull staging
./vapor.sh staging env:push staging
Deploy:
./deploy.sh staging