Skip to content

Instantly share code, notes, and snippets.

@RafikFarhad
Created June 27, 2019 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RafikFarhad/a020ce44074cdedb8d5b5d256b0a4df2 to your computer and use it in GitHub Desktop.
Save RafikFarhad/a020ce44074cdedb8d5b5d256b0a4df2 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Author: Rafik Farhad
# 26-06-2019
# cat file.sh | SSHPASS=****** sshpass -e ssh root@host
echo -e "\e[32mLogged in to server\e[39m"
echo -e ""
echo -e "\e[32m--------------------------------------\e[39m"
echo -e "\e[32mBackend\e[39m"
echo -e "\e[32m--------------------------------------\e[39m"
cd /var/www/html/{path_to_root/}
echo -e "\e[32mCurrent Working Directory\e[39m"
echo -e $(pwd)
echo -e "\e[32mPulling API\e[39m"
git pull https://rafikfarhad:*********@gitlab.com/{repo_path} develop
echo -e ""
echo -e "\e[32m--------------------------------------\e[39m"
echo -e "\e[32mFront End\e[39m"
echo -e "\e[32m--------------------------------------\e[39m"
cd /var/www/html/{path_to_root/}
echo -e "\e[32mCurrent Working Directory\e[39m"
echo -e $(pwd)
echo -e "\e[32mPulling Vue Production\e[39m"
git pull https://rafikfarhad:*********@gitlab.com/{repo_path} master
# echo -e "Clearing password from bash history"
# for h in $(seq $(history | tail -1 | awk '{print $1-12}') $(history | tail -1 | awk '{print $1}') | tac); do
# history -d $h
# done
echo -e ""
echo -e "\e[32m!~_ DONE _~!\e[39m"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment