0

I have a simple web application which uses AWS CodeCommit, CodePipeline and CodeDeploy. When ever a change is done and pushed to git, CodePipeline kicks in and deploys the code to the QA environment - WINDOWS. Now I want to setup a MANUALLY triggered deployment from the same repository to the production environment. However the source code locations are not the same. Also I may want to use different AfterInstall bat file. how can I have different appspec.yml or afterinstall.bat files in this situation. Or is there any other way of doing it?

1 Answers1

2

Here's an approach that should work:

  1. Have two files in your repository appspec_qa.yml and appspec_prod.yml each with the configuration you need for that stage.
  2. Have two CodeBuild steps which each produce a separate artifact with the respective appspec_*.yml renamed to just appspec.yml
  3. Have two CodeDeploy applications, one for qa and one for prod.
  4. Have a pipeline which deploys the qa artifact to the qa CodeDeploy application, and the prod artifact to the prod CodeDeploy application.
  5. Have a manual approval between the qa and prod stages
TimB
  • 1,457
  • 8
  • 10
  • thanks for that, I will have a go. so far i have not used CodeBuild, this would be an opportunity to try it out – Chalaka Salpadoru Sep 09 '17 at 04:15
  • can someonw please tell what the last step actiully mean - "Have a manual approval between the qa and prod stages" – Chalaka Salpadoru Aug 15 '18 at 04:39
  • @ChalakaSalpadoru by that I mean add a Manual Approval Action. By QA and prod I mean have 2 CodePipeline stages. One which deploys to your QA environment and one which deploys to your production environment. Approving the Manual Approval action you can manually control when the deployment happens. https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals-action-add.html – TimB Aug 15 '18 at 16:19