Created
December 21, 2017 09:34
-
-
Save igancev/2a70cce653eacd575940c9a4bd08db6b to your computer and use it in GitHub Desktop.
deployer-yii2-advanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Deployer; | |
require 'recipe/yii2-app-advanced.php'; | |
/* | |
* Configuration | |
*/ | |
set('bin/php', '/opt/php70/bin/php'); | |
set('repository', 'https://***@bitbucket.org/***/***.git'); | |
set('git_tty', true); // [Optional] Allocate tty for git on first deployment | |
set('shared_dirs', [ | |
'frontend/runtime', | |
'backend/runtime', | |
'console/runtime', | |
'common/runtime', | |
'frontend/web/upload', // это опционально | |
]); | |
set('copy_dirs', ['frontend/web/upload']); // это опционально | |
/* | |
* Hosts | |
*/ | |
// production | |
host('92.53.**.**') | |
->stage('production') | |
->user('***') | |
->set('deploy_path', '/home/c/***/app') | |
->forwardAgent(); | |
/* | |
* Tasks | |
*/ | |
// [Optional] if deploy fails automatically unlock. | |
after('deploy:failed', 'deploy:unlock'); | |
// ниже опционально, если надо бэкенд с фронтом на одном домене держать | |
/* | |
* ставим симлинк на таймвебе | |
*/ | |
task('deploy:simlinkFrontToBack', function () { | |
run('ln -s /home/c/***/app/current/backend/web /home/c/**/app/current/frontend/web/backend'); | |
})->desc('Simlink frontend/backend to backend'); | |
// перед успешным деплоем ставим симлинк | |
after('cleanup', 'deploy:simlinkFrontToBack'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment