Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Last active April 13, 2021 21:43
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 IgorDePaula/26ba04fb588ee9d9b208d1cc229bcbdf to your computer and use it in GitHub Desktop.
Save IgorDePaula/26ba04fb588ee9d9b208d1cc229bcbdf to your computer and use it in GitHub Desktop.
#!/bin/bash
TARGET="/var/www/"
GIT_DIR="/home/{{mysqlUser}}/laravel.git"
BRANCH="master"
GREEN='\033[0;32m' # green, in true
NC='\033[0m' # No Color
BLUE='\033[0;34m'
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ]
then
printf "${GREEN}############################################################${NC}\n"
printf "${GREEN}## ##${NC}\n"
printf "${GREEN}## Iniciando deploy - BlankBlackCloud ##${NC}\n"
printf "${GREEN}## ##${NC}\n"
printf "${GREEN}############################################################${NC}\n"
sudo git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
sudo chmod -R 777 /var/www/storage
printf "${GREEN}############################################################${NC}\n"
printf "${GREEN}## ##${NC}\n"
printf "${GREEN}## Deploy realizado - BlankBlackCloud ##${NC}\n"
printf "${GREEN}## ##${NC}\n"
printf "${GREEN}############################################################${NC}\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment