Skip to content

Commit

Permalink
Merge pull request #4 from CottaCush/fixes/deployer-update
Browse files Browse the repository at this point in the history
Fix issues with deployer REPO_URL and SLACK_HOOK_URL
  • Loading branch information
yemexx1 authored Sep 16, 2016
2 parents cf4e2d6 + cf1ad20 commit c6ffc1d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

#### 1.3.1

* Fix issues with deployer REPO_URL and SLACK_HOOK_URL *2016-09-16*


#### 1.3.0

* Fix issues with deployer script *2016-09-16*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cottacush/yii2-base-project",
"description": "A Yii 2 Base Project Template",
"keywords": ["yii2", "framework", "basic", "project template", "improved"],
"version": "1.3.0",
"version": "1.3.1",
"type": "project",
"license": "MIT",
"minimum-stability": "stable",
Expand Down
22 changes: 12 additions & 10 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
set('shared', ['app/runtime']);

// TODO Add repository url for project
set('repository', env('REPO_URL'));
set('repository', '');

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

$slackHookUrl = env('SLACK_HOOK_URL');

/**
* Run migrations
*/
Expand Down Expand Up @@ -98,15 +96,19 @@

function postToSlack($message)
{
runLocally('curl -s -S -X POST --data-urlencode payload="{\"channel\": \"#' . env('SLACK_CHANNEL_NAME') . '\", \"username\": \"Release Bot\", \"text\": \"' . $message . '\"}"' . env('SLACK_HOOK_URL'));
$slackHookUrl = env('SLACK_HOOK_URL');
if (!empty($slackHookUrl)) {
runLocally('curl -s -S -X POST --data-urlencode payload="{\"channel\": \"#' . env('SLACK_CHANNEL_NAME') .
'\", \"username\": \"Release Bot\", \"text\": \"' . $message . '\"}"' . env('SLACK_HOOK_URL'));
} else {
write('Configure the SLACK_HOOK_URL to post to slack');
}
}

/**
* Post to slack if the slack hook URL is not empty
*/
if (!empty($slackHookUrl)) {
before('deploy:run_migrations', 'slack:before_migrate');
after('deploy:run_migrations', 'slack:after_migrate');
before('deploy', 'slack:before_deploy');
after('deploy', 'slack:after_deploy');
}
before('deploy:run_migrations', 'slack:before_migrate');
after('deploy:run_migrations', 'slack:after_migrate');
before('deploy', 'slack:before_deploy');
after('deploy', 'slack:after_deploy');
1 change: 0 additions & 1 deletion deploy/servers.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ staging:
DB_USERNAME: "root"
DB_PASSWORD: ""
APPLICATION_ENV: "staging"
REPO_URL: ""
SLACK_HOOK_URL: ""
SLACK_CHANNEL_NAME: ""

0 comments on commit c6ffc1d

Please sign in to comment.