Skip to content

Instantly share code, notes, and snippets.

@phpfour
Created August 15, 2017 06:12
Show Gist options
  • Save phpfour/10422ec080317e90ae9f609c82396b13 to your computer and use it in GitHub Desktop.
Save phpfour/10422ec080317e90ae9f609c82396b13 to your computer and use it in GitHub Desktop.
Simple Laravel Deployment with Release Notes as Slack notification
<?php
// See: https://github.com/foodkit/jira-release-notes
// See: https://github.com/foodkit/laravel-deployer
namespace Deployer;
require __DIR__.'/vendor/foodkit/laravel-deployer/src/laravel-norevision.php';
use Symfony\Component\Console\Input\InputOption;
// Command-line options
option('start', null, InputOption::VALUE_OPTIONAL, 'The start tag/branch');
option('end', null, InputOption::VALUE_OPTIONAL, 'The end tag/branch');
// Configuration
set('ssh_type', 'native');
set('standalone', true);
set('migration', false);
set('ssh_multiplexing', true);
set('repository', 'git@github.com:phpfour/calories.git');
// Slack
set('slack_title', 'Release notes');
set('slack_color', '#4d91f7');
set('slack_emoji', ':ghost:');
set('slack_name', 'Laravel Deployer');
set('slack_webhook', 'https://hooks.slack.com/services/T6MFNU108/ABCDEFGH/OJI7OA9IU1BAJgGj4ge3YD9A');
// Servers
server('production', '123.45.67.890')
->user('root')
->identityFile()
->set('deploy_path', '/var/www/calories')
->pty(true);
after('deploy', 'slack:send-release-notes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment