Skip to content

Instantly share code, notes, and snippets.

@brunofonseca
Created January 1, 2016 15:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save brunofonseca/120355c1a3bc36cfa401 to your computer and use it in GitHub Desktop.
Save brunofonseca/120355c1a3bc36cfa401 to your computer and use it in GitHub Desktop.
Arquivo de Configuração deploy
<?php
require 'recipe/symfony.php';
server('NOME_SERVIDOR', 'IP_SERVIDOR', PORTA_SSH)
->user('USUARIO')
->forwardAgent()
->stage('PRODUCTION_DEVELOPMENT_TESTE')
->env('deploy_path', 'caminho');
env('branch','NOME_BRANCH_DEPLOY');
set('repository', 'REPOSITORIO');
set('shared_dirs',['app/storage']);
set('shared_files',[]);
/*set('writeable_dirs', ['app/storage', 'app/storage/logs']);*/
/*Tarefas que não funcionam*/
task('deploy:writable', function(){});
task('deploy:vendors', function(){});
task('deploy:assetic:dump', function(){});
task('deploy:cache:warmup', function(){});
/*Fim tarefas que não funcionam*/
task('laravel:create_storage_dirs', function() {
run("sudo chmod -R 777 {{deploy_path}}/current/storage");
run("sudo chmod -R 777 {{deploy_path}}/current/storage/logs");
run("sudo chmod -R 777 {{deploy_path}}/current/storage/framework/cache");
run("sudo chmod -R 777 {{deploy_path}}/current/storage/framework/sessions");
run("sudo chmod -R 777 {{deploy_path}}/current/storage/framework/views");
run("sudo chmod -R 777 {{deploy_path}}/current/bootstrap/*");
});
task('laravel:vendor:install', function() {
run("sudo composer install -d {{deploy_path}}/current ");
});
task('laravel:database:migrate', function() {
run("php {{deploy_path}}/current artisan migrate");
});
task('laravel:rename:env_file', function() {
run("sudo mv {{deploy_path}}/current/.env.example {{deploy_path}}/current/.env");
});
task('deploy',
[
'deploy:prepare',
'deploy:release',
'deploy:update_code',
'deploy:symlink',
'laravel:create_storage_dirs',
'laravel:vendor:install',
'laravel:database:migrate',
'laravel:rename:env_file',
'cleanup',
'success'
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment