Created
December 30, 2024 17:12
-
-
Save tooshel/d5ca02076101d15ee1aa166728e23111 to your computer and use it in GitHub Desktop.
my favorite deploy script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This stops the script on any error! | |
set -e | |
cd | |
mv Uplink*.zip old | |
rm -r build | |
myurl=`curl -s https://api.github.com/repos/<repo_name>/<repository>/releases/latest | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d \" ` | |
echo $myurl | |
myfilename=`echo ${myurl##*/}` | |
echo $myfilename | |
wget -q $myurl | |
unzip $myfilename | |
echo "=========" | |
echo "=========" | |
echo "=========" | |
if [ -d "/root/build" ]; then | |
echo "build folder exists, going to delete the old folder and deploy" | |
rm -r /var/www/html/* | |
# mkdir /var/www/html | |
cp -r ~/build/* /var/www/html | |
else | |
echo "build folder does not exist, deploy canceled" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment