5

I have a PHPproject hosted in Github and Im trying to setup a Continuous Integration using AWS Codepipeline and ElasticBeanstalk.

So far, Im able to get the repository contents from github and deploy it to ElasticBeanstalk. But I need to run a shell script before the deployment that will update a config.json file and also update a environment variable.

This is what Im trying to accomplish in the Pipeline:

  1. Get the project files from Github (done)
  2. Run a shell script that will update a config.json file in the project
  3. Run a shell script that will set a environment variable in ElasticBeanstalk
  4. Deploy to ElasticBeanstalk (done)

Any ideas of how I can get this working?

thanks

1 Answer 1

1

CodePipeline doesn't support running shell in an action, but you may want to use CodeBuild, which can execute shell command to build or just update a file.

http://docs.aws.amazon.com/codebuild/latest/userguide/sample-elastic-beanstalk.html#sample-elastic-beanstalk-codepipeline

To set environment variables in ElasticBeanstalk, you can put a configuration file (.ebextensions/environmentvariables.config) in your source folder.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environment-configuration-methods-after.html#configuration-options-after-console-ebextensions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.