Created
September 27, 2014 02:16
-
-
Save cornernote/91876f50e4cb59d499d8 to your computer and use it in GitHub Desktop.
Auto Git Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$runtimePath = '/home/user/app/runtime'; | |
if (!empty($_GET['project'])) { | |
if (in_array($_GET['project'], array('app'))) { | |
file_put_contents($runtimePath . '/update-' . $_GET['project'], ''); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# Git Update | |
################################################################################ | |
# | |
# Add to cron: | |
# * * * * * /usr/local/bin/lockrun --lockfile=/var/lockrun/update -- /home/user/scripts/update.sh > /dev/null 2>&1 | |
# | |
################################################################################ | |
DIR=/home/user | |
RUNTIME=/home/user/app/runtime | |
if [[ -f ${RUNTIME}/update-app ]]; then | |
cd ${DIR} | |
git pull | |
rm -f ${RUNTIME}/update-app | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment