Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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