Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Last active June 13, 2023 21:26
Show Gist options
  • Save IgorDePaula/7ac6c481bfdfc83d22d0940faa94ff27 to your computer and use it in GitHub Desktop.
Save IgorDePaula/7ac6c481bfdfc83d22d0940faa94ff27 to your computer and use it in GitHub Desktop.
#!/bin/bash
TARGET="/var/www/"
GIT_DIR="/home/git/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"
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f $BRANCH
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