0
votes

I have a working following workflow in AWS:

  1. I Commit to master on GitHub
  2. This triggers AWS CodePipeline (CodeBuild) to test the code
  3. Deploys master to Elastic Beanstalk

Is it possible to modify the workflow with AWS tools so that I:

  1. Commit to feature branch on GitHub
  2. Triggers CodePipline to test the code
  3. If tests pass, merge to master branch on GitHub
  4. Deploy master branch to Elastic Beanstalk

If this is not possible, what workflow would you recommend? The point is to avoid merging my code to master before automatic tests are triggered.

1
you could add stages to the pipeline, maybe a test and a productive environment.lucas

1 Answers

0
votes

I would say it's definitely possible. You will have to add a step either in code build itself as part of the build steps or trigger a lambda function as a subsequent step to CodeBuild. In either method, you can trigger a PR or a merge using GitHub APIs. If using a lambda as a subsequent step to do this, make sure code build fails if the test fails. If doing as part of the build steps, a IF Then Else block could do the trick.