Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

post recieve git hook

#!/bin/bash
TARGET="/home/webuser/deploy-folder"
GIT_DIR="/home/webuser/www.git"
BRANCH="master"

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
        echo "Ref $ref received. Deploying ${BRANCH} branch to production..."
        git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f
    else
        echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch may be deployed on this server."
    fi
done
Comment

PREVIOUS NEXT
Code Example
Shell :: what is appmenu-gtk-module 
Shell :: linux wii emulator 
Shell :: p4merge git config 
Shell :: docker compose busybox image 
Shell :: sort files in directory by size 
Shell :: create a new repository from command line 
Shell :: git init git remote add origin git pull 
Shell :: arcmenu fix 
Shell :: record system audio linux terminal 
Shell :: how to install flow on gatsbyjs 
Shell :: CHROME_EXECUTABLE brave 
Shell :: shell align columns 
Shell :: nmap run scripts 
Shell :: use ampersand in query string 
Shell :: task manager opera browser 
Shell :: switch user in ubuntu lxde 
Shell :: how to stop the node server from running 
Shell :: pecl install specific version 
Shell :: bash set environment variable 
Shell :: how to set your github url ater cloning a repository 
Shell :: asdf check node version 
Shell :: create-new-github-repo 
Shell :: how to remove ubuntu proxy not working 
Shell :: check program installed c# 
Shell :: linux crée utilisateur sudo 
Shell :: Create alias for git push 
Shell :: lister branches git distantes 
Shell :: go back to previous commit 
Shell :: yum repositories 
Shell :: show output after a keyword in shell script in a file 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =