Junk

Junk Commit Details

Date:2015-11-25 14:45:40 (3 years 7 months ago)
Author:Nicola Fontana
Branch:master
Commit:754ca6be3de4993d4c4d663666143d3ab285df68
Parents: 6f01b5436575287b48163749cf71fab90f85a7b2
Message:post-receive.deploy: first implementation

Changes:
Agit/post-receive.deploy (full)

File differences

git/post-receive.deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/bash
#
# This is a simplified version of gitdeploy (no database backup and no
# assets backup).
#
# The script is expected to be run inside a *bare* repository so you can
# freely push from outside.
# Path to the root repository
gitdir=.
# Path to the root directory of the website
# My convention is to use the git repository name without .git, e.g.
# the "test.git" repository will be deployed in /var/www/test
webdir=/var/www/$(basename `realpath "$gitdir"` .git)
echo -n "Syncing public with remote... "
if ! GIT_DIR="$gitdir" GIT_WORK_TREE="$webdir" git checkout -qf; then
# If the deployment fails, spit out some info for easier debugging
echo "pwd = $(pwd)"
echo "gitdir = $gitdir"
echo "webdir = $webdir"
else
# Allow to inject some custom command, just in case
if [ -x "$webdir/post-deploy" ]; then
"$webdir/post-deploy"
rm -f "$webdir/post-deploy"
fi
echo done
fi

Archive Download the corresponding diff file

Branches