Skip to content

Instantly share code, notes, and snippets.

@Fabryz
Created July 25, 2014 07:49
Show Gist options
  • Save Fabryz/a0869b3c6550e0197579 to your computer and use it in GitHub Desktop.
Save Fabryz/a0869b3c6550e0197579 to your computer and use it in GitHub Desktop.
SSH_HOST1=IP1
SSH_HOST2=IP2
SSH_HOST3=IP3
SSH_HOST4=IP3
SSH_USER=mondiali.prod
WEB_DIR=/Storage/mondiali.prod/htdocs/
all:
php artisan
compass-clean:
compass clean
compass compile
grunt-build:
grunt build
artisan-down:
ssh ${SSH_USER}@${SSH_HOST1} "cd ${WEB_DIR}; php artisan down --env=prod"
ssh ${SSH_USER}@${SSH_HOST2} "cd ${WEB_DIR}; php artisan down --env=prod"
ssh ${SSH_USER}@${SSH_HOST3} "cd ${WEB_DIR}; php artisan down --env=prod"
ssh ${SSH_USER}@${SSH_HOST4} "cd ${WEB_DIR}; php artisan down --env=prod"
rsynca:
rsync -arvuz --delete . ${SSH_USER}@${SSH_HOST1}:${WEB_DIR} --exclude-from 'exclude-list.txt'
rsync -arvuz --delete . ${SSH_USER}@${SSH_HOST2}:${WEB_DIR} --exclude-from 'exclude-list.txt'
rsync -arvuz --delete . ${SSH_USER}@${SSH_HOST3}:${WEB_DIR} --exclude-from 'exclude-list.txt'
rsync -arvuz --delete . ${SSH_USER}@${SSH_HOST4}:${WEB_DIR} --exclude-from 'exclude-list.txt'
rsync-podio:
rsync -arvuz ./app/views/pages/podio/podio_list.twig ${SSH_USER}@${SSH_HOST1}:${WEB_DIR}app/views/pages/podio/
rsync -arvuz ./app/views/pages/podio/podio_list.twig ${SSH_USER}@${SSH_HOST2}:${WEB_DIR}app/views/pages/podio/
rsync -arvuz ./app/views/pages/podio/podio_list.twig ${SSH_USER}@${SSH_HOST3}:${WEB_DIR}app/views/pages/podio/
rsync -arvuz ./app/views/pages/podio/podio_list.twig ${SSH_USER}@${SSH_HOST4}:${WEB_DIR}app/views/pages/podio/
fixperm-logs:
ssh ${SSH_USER}@${SSH_HOST1} "mkdir -p ${WEB_DIR}app/storage/logs; touch ${WEB_DIR}app/storage/logs/laravel.log; chmod -R ugo+w ${WEB_DIR}app/storage/logs"
ssh ${SSH_USER}@${SSH_HOST2} "mkdir -p ${WEB_DIR}app/storage/logs; touch ${WEB_DIR}app/storage/logs/laravel.log; chmod -R ugo+w ${WEB_DIR}app/storage/logs"
ssh ${SSH_USER}@${SSH_HOST3} "mkdir -p ${WEB_DIR}app/storage/logs; touch ${WEB_DIR}app/storage/logs/laravel.log; chmod -R ugo+w ${WEB_DIR}app/storage/logs"
ssh ${SSH_USER}@${SSH_HOST4} "mkdir -p ${WEB_DIR}app/storage/logs; touch ${WEB_DIR}app/storage/logs/laravel.log; chmod -R ugo+w ${WEB_DIR}app/storage/logs"
fixperm-views:
ssh ${SSH_USER}@${SSH_HOST1} "mkdir -p ${WEB_DIR}app/storage/views/twig; chmod -R ugo+w ${WEB_DIR}app/storage/views/twig"
ssh ${SSH_USER}@${SSH_HOST2} "mkdir -p ${WEB_DIR}app/storage/views/twig; chmod -R ugo+w ${WEB_DIR}app/storage/views/twig"
ssh ${SSH_USER}@${SSH_HOST3} "mkdir -p ${WEB_DIR}app/storage/views/twig; chmod -R ugo+w ${WEB_DIR}app/storage/views/twig"
ssh ${SSH_USER}@${SSH_HOST4} "mkdir -p ${WEB_DIR}app/storage/views/twig; chmod -R ugo+w ${WEB_DIR}app/storage/views/twig"
migrate:
ssh ${SSH_USER}@${SSH_HOST1} "cd ${WEB_DIR}; php artisan migrate --env=prod"
migrate-seed:
ssh ${SSH_USER}@${SSH_HOST1} "cd ${WEB_DIR}; php artisan migrate --env=prod --seed"
migrate-refresh:
ssh ${SSH_USER}@${SSH_HOST1} "cd ${WEB_DIR}; php artisan migrate:refresh --env=prod --seed"
artisan-up:
ssh ${SSH_USER}@${SSH_HOST1} "cd ${WEB_DIR}; php artisan up --env=prod"
ssh ${SSH_USER}@${SSH_HOST2} "cd ${WEB_DIR}; php artisan up --env=prod"
ssh ${SSH_USER}@${SSH_HOST3} "cd ${WEB_DIR}; php artisan up --env=prod"
ssh ${SSH_USER}@${SSH_HOST4} "cd ${WEB_DIR}; php artisan up --env=prod"
timestamp:
date
first-deploy: clean grunt-build rsynca fixperm-logs fixperm-views migrate-seed timestamp
deploy: grunt-build artisan-down rsynca migrate artisan-up timestamp
deploy-singlepage: rsync-podio timestamp
test:
phpunit --colors --verbose
clean:
php artisan clear-compiled
php artisan optimize
php artisan cache:clear
php artisan twig:clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment