Skip to content

Commit c6ffc1d

Browse files
authored
Merge pull request #4 from CottaCush/fixes/deployer-update
Fix issues with deployer REPO_URL and SLACK_HOOK_URL
2 parents cf4e2d6 + cf1ad20 commit c6ffc1d

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
#### 1.3.1
4+
5+
* Fix issues with deployer REPO_URL and SLACK_HOOK_URL *2016-09-16*
6+
7+
38
#### 1.3.0
49

510
* Fix issues with deployer script *2016-09-16*

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cottacush/yii2-base-project",
33
"description": "A Yii 2 Base Project Template",
44
"keywords": ["yii2", "framework", "basic", "project template", "improved"],
5-
"version": "1.3.0",
5+
"version": "1.3.1",
66
"type": "project",
77
"license": "MIT",
88
"minimum-stability": "stable",

deploy.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
set('shared', ['app/runtime']);
1313

1414
// TODO Add repository url for project
15-
set('repository', env('REPO_URL'));
15+
set('repository', '');
1616

1717
env('composer_options', 'install --prefer-dist --optimize-autoloader --no-progress --no-interaction');
1818

19-
$slackHookUrl = env('SLACK_HOOK_URL');
20-
2119
/**
2220
* Run migrations
2321
*/
@@ -98,15 +96,19 @@
9896

9997
function postToSlack($message)
10098
{
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+
}
102106
}
103107

104108
/**
105109
* Post to slack if the slack hook URL is not empty
106110
*/
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');

deploy/servers.sample.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ staging:
1717
DB_USERNAME: "root"
1818
DB_PASSWORD: ""
1919
APPLICATION_ENV: "staging"
20-
REPO_URL: ""
2120
SLACK_HOOK_URL: ""
2221
SLACK_CHANNEL_NAME: ""

0 commit comments

Comments
 (0)