DEV Community

Discussion on: how to resume multiple commands on one command

Collapse
 
fausrguez profile image
Faus Rodriguez • Edited

I would recommend you to use a Makefile
The syntax's quite simple.

command_name:
    command_1
    command_2
    ...
Enter fullscreen mode Exit fullscreen mode

here is an example:

update_and_compile_prod:
    sudo git pull origin
    php artisan migrate
    sudo npm update
    sudo npm run prod
Enter fullscreen mode Exit fullscreen mode

After you only need to call make update_and_compile_prod (make command_name), and it will run smoothly :)

Also, you can add this command to the script list on your package.json and run it with npm.

You can also try to investigate if you can use a githook to trigger that action every time you pull

Collapse
 
mostafalaravel profile image
mostafalaravel

Thanks