Last active
August 29, 2015 14:25
-
-
Save marktopper/8aeabd45449a219664ae to your computer and use it in GitHub Desktop.
Smarter deployment script for Forge
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 | |
set -x | |
domain=$(readlink -f .) | |
domain=${domain##*/} | |
timestamp=$(date +%s) | |
if ! [ -s "current" ]; then | |
mkdir ../$domain-temp | |
mv * ../$domain-temp | |
mv ../$domain-temp/scripts scripts | |
mkdir -p releases | |
mv ../$domain-temp releases/init | |
mv .git/ releases/init/.git/ | |
ln -s releases/init/ current | |
fi | |
mkdir -p releases | |
mkdir -p releases/$timestamp | |
rsync -rL current/ releases/$timestamp | |
cd releases/$timestamp | |
git pull origin master | |
# composer install --no-interaction --no-dev --prefer-dist | |
# php artisan migrate --force | |
cd ../../ | |
rm -f current | |
ln -s releases/$timestamp/ current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment