Run only one script
See original GitHub issueHi!
I’m deploying my app in a elastic bean instance so basically I have the option to run just one script. If I try to run something like:
"start": "npm run build & node script.js"
it’s not guaranteed that the first one has finished before the second one starts. Is there an way to pass through that?
Ps: I’m using eb deploy from ElasticBean
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
How to make sure only one instance of a bash script runs?
One other way to make sure a single instance of bash script runs: #! /bin/bash - # Check if another instance of script...
Read more >How to Ensure Only One Instance of a Bash Script Is Running
Just add the pidof line at the top of your Bash script, and you'll be sure that only one instance of your script...
Read more >Ensure Only One Instance of a Bash Script Is Running
In this tutorial, we'll discuss different ways of ensuring only one instance of a bash script is running. This will be useful when...
Read more >[Solved] How to run this script only once - CodeProject
Solution 1 Use local storage to store a flag indicating that the code has run. Then test that flag when your page loads...
Read more >Quick-and-dirty way to ensure only one instance of a shell ...
Running from a Cron job I use flock -x -n %lock file% -c "%command%" to make sure only one instance is ever executing....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ThiagoMiranda, I dont use
eb deploy
, I have a slightly different workflow setup on CircleCI that uses theaws elasticbeanstalk
cli.With my workflow, I generate the code that will be deployed by running
npm run build
. That creates mydist
folder (which is in.gitignored
). I then upload thedist
andpackage.json
to S3 (zipped up) and I then runaws elasticbeanstalk..... [options..]
to tell Beanstalk that theres a new application that needs to be deployed.By default, when a new application is deployed to Beanstalk,
npm i --production
will run as part of the application setup so you definitely don’t have to includenode_modules
in your application zip.I’ve just been reading and looks like
eb deploy
uses the last commit as the source. This is ok but it depends on what your project/workflow is. For instance, if you’re using babel, then you would have to also commit your dist folder, otherwise your code wont be compiled.My workflow is more fine tuned so i wouldnt be able to use
eb deploy
. Have a look at the links below and see if they help.References:
not sure if you solved it or not, but the single
&
tells bash to run commands in parallel. if you specify&&
it forces it to run in sequence.