DEV Community

Lakh Bawa
Lakh Bawa

Posted on

A little tip on making your deployment less tedious

Deployment can be a pretty time consuming and tedious task when your website is under development. To properly deploy, you have to run a number of commands to deploy your code and test it.
To overcome this, I recently created a bash script mentioning all the required commands.

deploy.sh

# mention full paths for all the commands to be on the safe side
#!/bin/bash
cd /root/staging;git pull;cd /root/staging/frontend;npm run build;
Enter fullscreen mode Exit fullscreen mode

These commands will run one after another and will give full feedback just like when you run individual command.you can cancel anytime by pressing CTRL/CMD+c

Running the deployment script.

sh deploy.sh
Enter fullscreen mode Exit fullscreen mode

Latest comments (1)

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

Sorry, I may be out of context but where it's intended for?

I simply perform an easy ci.yml to automate deploys and that's all (and works for development, test and production).

I'm assuming your script are executed on the server "as is", isn't it?