|
8 | 8 |
|
9 | 9 | serverList('deploy/servers.yml'); |
10 | 10 |
|
11 | | -set('writable_dirs', ['runtime', 'web/assets']); |
| 11 | +set('writable_dirs', ['app/runtime', 'app/web/assets']); |
| 12 | +set('shared', ['app/runtime']); |
12 | 13 |
|
13 | | -env('composer_options', 'install --verbose --prefer-dist --optimize-autoloader --no-progress --no-interaction'); |
| 14 | +// TODO Add repository url for project |
| 15 | +set('repository', env('REPO_URL')); |
| 16 | + |
| 17 | +env('composer_options', 'install --prefer-dist --optimize-autoloader --no-progress --no-interaction'); |
| 18 | + |
| 19 | +$slackHookUrl = env('SLACK_HOOK_URL'); |
14 | 20 |
|
15 | 21 | /** |
16 | 22 | * Run migrations |
|
45 | 51 | * Upload env file |
46 | 52 | */ |
47 | 53 | task('deploy:upload_environments_file', function () { |
48 | | - upload(env('local_path') . '/env/.env.{{APPLICATION_ENV}}', '{{release_path}}/env/.env'); |
| 54 | + upload(__DIR__ . '/app/env/.env.{{APPLICATION_ENV}}', '{{release_path}}/app/env/.env'); |
| 55 | +}); |
| 56 | + |
| 57 | +/** Yii2 composer setup */ |
| 58 | +task('deploy:yii2_composer_config', function () { |
| 59 | + // TODO Replace <GITHUB_TOKEN> with valid github token |
| 60 | + run('composer config -g github-oauth.github.com <GITHUB_TOKEN>'); |
| 61 | + run('composer global require "fxp/composer-asset-plugin:~1.1.1"'); |
49 | 62 | }); |
50 | 63 |
|
51 | 64 | /** Slack Tasks Begin */ |
|
74 | 87 | 'deploy:release', |
75 | 88 | 'deploy:update_code', |
76 | 89 | 'deploy:shared', |
| 90 | + 'deploy:yii2_composer_config', |
77 | 91 | 'deploy:vendors', |
78 | 92 | 'deploy:upload_environments_file', |
79 | 93 | 'deploy:run_migrations', |
|
82 | 96 | 'deploy:cleanup', |
83 | 97 | ])->desc('Deploy Project'); |
84 | 98 |
|
85 | | -$repositoryUrl = env('REPO_URL'); |
86 | | -set('repository', $repositoryUrl); |
87 | | - |
88 | 99 | function postToSlack($message) |
89 | 100 | { |
90 | 101 | runLocally('curl -s -S -X POST --data-urlencode payload="{\"channel\": \"#' . env('SLACK_CHANNEL_NAME') . '\", \"username\": \"Release Bot\", \"text\": \"' . $message . '\"}"' . env('SLACK_HOOK_URL')); |
|
0 commit comments