Skip to content

Instantly share code, notes, and snippets.

@connordavison
Created January 30, 2016 23:23
Show Gist options
  • Select an option

  • Save connordavison/b174ce3a458991a71590 to your computer and use it in GitHub Desktop.

Select an option

Save connordavison/b174ce3a458991a71590 to your computer and use it in GitHub Desktop.
#!/bin/sh
WEBROOT=~/www/
if [ ! -d $WEBROOT ]; then
mkdir $WEBROOT -p
fi
cd $WEBROOT
# Attempt to update the repo
git fetch
# Clear caches
rm -rf storage/cache/*
echo 'Cache cleared'
rm -rf storage/views/*
echo 'Views cleared'
if [ -f composer.json ]; then
# Detect composer
if which composer > /dev/null; then
composer='composer'
elif which composer.phar > /dev/null; then
composer='composer.phar'
else
# Install composer
curl -s http://getcomposer.org/installer | php > /dev/null
composer='php composer.phar'
fi
# Install or update packages specified in the lock file
$composer install --no-dev \
--classmap-authoritative \
--no-interaction
fi
# Migrate if necessary
php artisan migrate --force \
--no-interaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment