Can not set multiple environments dev stage production with elastic beanstalk

+5 votes

I need to do the following: Change the environment variables according to the published env. Configure the Kron jobs according to the dev. I would like to run a command line of just 1 line "eb deploy dev" or something like that

Mar 27, 2018 in DevOps on Cloud by shubham
• 7,340 points

2 answers to this question.

+2 votes
Best answer

This is how you do this in one command line.

Create your own folder with all the files for all environments. In .ebextensions folder, set empty configuration files for eb. npm runs a script called "deploy.js" with the specified env prompt. The script will do the following

  • copy the requested env data to the empty files according to the env
  • git stash the changes of .ebextensions folder (eb deploys using git)
  • eb use env
  • eb deploy

So now you can tun npm run deploy:dev and everything runs

hope this helps

answered Mar 27, 2018 by ajs3033
• 7,300 points

selected Oct 12, 2018 by Omkar
0 votes

To use the Compose Environments API, first run eb init from the project folder, specifying each component by the name of the folder that contains it with the --modules option, configure each component, and then create the .elasticbeanstalkdirectory in each component folder. 

For detailed explanantion have a look at the this blog.

answered Oct 12, 2018 by Hannah
• 18,570 points

Related Questions In DevOps on Cloud

0 votes
1 answer
0 votes
0 answers

Does the failed() condition take arguments? i.e. can I set the condition to trigger only if failing 3 times

I want to run my PublishBuildArtifacts@1 task with the condition set to failed ().  However, I'd like to configure it so that it only publishes the artefact after three failed tests. - task: PublishBuildArtifacts@1 ...READ MORE

Dec 19, 2022 in DevOps on Cloud by Damonlang
• 1,230 points
+2 votes
3 answers

can't make nginx try_files to work with default_index.html

Here's another convenient use of try_files, as ...READ MORE

answered Oct 18, 2018 in DevOps on Cloud by Hannah
• 18,570 points
0 votes
1 answer

Deploy multiple platforms to Elastic Beanstalk

Solve by using .ebextentions to run pre-install commands in ...READ MORE

answered Nov 28, 2018 in AWS by Archana
• 5,640 points
0 votes
1 answer
0 votes
1 answer

How can I remove a port from url for node app using nginx

If you run your node server on ...READ MORE

answered Apr 10, 2018 in DevOps on Cloud by ajs3033
• 7,300 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP