Skip to content

Commit

Permalink
(Deployer Fixes): Fix issues with deployer REPO_URL and SLACK_HOOK_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Adegoke Obasa committed Sep 16, 2016
1 parent 82efc73 commit a5b6683
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
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 a5b6683

Please sign in to comment.