|
12 | 12 | set('shared', ['app/runtime']); |
13 | 13 |
|
14 | 14 | // TODO Add repository url for project |
15 | | -set('repository', env('REPO_URL')); |
| 15 | +set('repository', ''); |
16 | 16 |
|
17 | 17 | env('composer_options', 'install --prefer-dist --optimize-autoloader --no-progress --no-interaction'); |
18 | 18 |
|
19 | | -$slackHookUrl = env('SLACK_HOOK_URL'); |
20 | | - |
21 | 19 | /** |
22 | 20 | * Run migrations |
23 | 21 | */ |
|
98 | 96 |
|
99 | 97 | function postToSlack($message) |
100 | 98 | { |
101 | | - runLocally('curl -s -S -X POST --data-urlencode payload="{\"channel\": \"#' . env('SLACK_CHANNEL_NAME') . '\", \"username\": \"Release Bot\", \"text\": \"' . $message . '\"}"' . env('SLACK_HOOK_URL')); |
| 99 | + $slackHookUrl = env('SLACK_HOOK_URL'); |
| 100 | + if (!empty($slackHookUrl)) { |
| 101 | + runLocally('curl -s -S -X POST --data-urlencode payload="{\"channel\": \"#' . env('SLACK_CHANNEL_NAME') . |
| 102 | + '\", \"username\": \"Release Bot\", \"text\": \"' . $message . '\"}"' . env('SLACK_HOOK_URL')); |
| 103 | + } else { |
| 104 | + write('Configure the SLACK_HOOK_URL to post to slack'); |
| 105 | + } |
102 | 106 | } |
103 | 107 |
|
104 | 108 | /** |
105 | 109 | * Post to slack if the slack hook URL is not empty |
106 | 110 | */ |
107 | | -if (!empty($slackHookUrl)) { |
108 | | - before('deploy:run_migrations', 'slack:before_migrate'); |
109 | | - after('deploy:run_migrations', 'slack:after_migrate'); |
110 | | - before('deploy', 'slack:before_deploy'); |
111 | | - after('deploy', 'slack:after_deploy'); |
112 | | -} |
| 111 | +before('deploy:run_migrations', 'slack:before_migrate'); |
| 112 | +after('deploy:run_migrations', 'slack:after_migrate'); |
| 113 | +before('deploy', 'slack:before_deploy'); |
| 114 | +after('deploy', 'slack:after_deploy'); |
0 commit comments