Skip to content

Instantly share code, notes, and snippets.

@joeymetal
Forked from brunofonseca/deploy.php
Created July 25, 2016 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeymetal/6778db7f4cf00a9823e84bd619d9be1b to your computer and use it in GitHub Desktop.
Save joeymetal/6778db7f4cf00a9823e84bd619d9be1b 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