These scripts allows you to use separate AWS account for your staging and production environments.
- Create two teams on Vapor (
App ProductionandApp 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.ymltovapor.production.yml - Run
vapor team:switch, switch toApp Stagingand create a new Vapor project - Rename
vapor.ymltovapor.staging.yml - In Vapor
App Productiondelete the staging environment, and inApp Stagingdelete 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