Add automatic deployment scripts
This commit is contained in:
parent
d4bb4a354b
commit
51ba5cb625
18
deploy-stage2.sh
Executable file
18
deploy-stage2.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
########################################################################
|
||||
#
|
||||
# Website deployment script (stage 2)
|
||||
#
|
||||
########################################################################
|
||||
|
||||
newgrp www-data <<EOF
|
||||
# copy the files over
|
||||
rsync -rv --chmod=ug=rwX --delete-excluded \
|
||||
/home/deploy/www/user/pages/ \
|
||||
/home/www/user/pages/
|
||||
# ensure the www-data group gets inherited
|
||||
find /home/www/user/pages -type d -exec chmod g+s {} \; -print
|
||||
EOF
|
||||
|
||||
########################################################################
|
||||
# end of file
|
24
deploy.sh
Executable file
24
deploy.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash -x
|
||||
########################################################################
|
||||
#
|
||||
# Website deployment script
|
||||
#
|
||||
########################################################################
|
||||
|
||||
REPO='git@git.fr-rbx1.burble.dn42:burble.dn42/www.git'
|
||||
cd /home/deploy/www
|
||||
|
||||
# pull updates to the repo
|
||||
git pull
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Something went wrong when pulling the repo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# and execute the (potentially new) second stage deployment script
|
||||
./deploy-stage2.sh
|
||||
|
||||
########################################################################
|
||||
# end of file
|
Loading…
x
Reference in New Issue
Block a user