Skip to content

Instantly share code, notes, and snippets.

@marktopper
Last active August 29, 2015 14:25
Show Gist options
  • Save marktopper/8aeabd45449a219664ae to your computer and use it in GitHub Desktop.
Save marktopper/8aeabd45449a219664ae to your computer and use it in GitHub Desktop.
Smarter deployment script for Forge
#!/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