Skip to content

Instantly share code, notes, and snippets.

@ysfks
Created July 23, 2018 15:55
Show Gist options
  • Save ysfks/83a08e9450de6f5ffdc632c04065b16e to your computer and use it in GitHub Desktop.
Save ysfks/83a08e9450de6f5ffdc632c04065b16e to your computer and use it in GitHub Desktop.
Sample config file for your Laravel project deployer (https://deployer.org/)
<?php
namespace Deployer;
// Project name
set('application', 'public_html');
set('default_stage', 'staging');
// Hosts
host('your_shortcut_for_your_ssh_in_sshconfig')
->configFile('~/.ssh/config')
->identityFile('~/.ssh/id_rsa')
->set('deploy_path', '~/{{application}}')
->set('branch', 'develop')
->stage('staging');
task('deploy', function() {
cd('{{deploy_path}}');
run("/usr/local/bin/php artisan down");
$response = run('git checkout -- .');
writeln($response);
writeln('Checking out develop branch...');
$response = run("git checkout develop");
writeln($response);
writeln('Fetching tags...');
$response = run('git fetch --tags');
writeln($response);
writeln('Pulling changes from remote branch...');
$response = run("git pull origin develop");
writeln($response);
writeln('Removing log files...');
run('echo "" > storage/logs/laravel.log');
writeln('Disabling maintanence mode...');
run("/usr/local/bin/php artisan up");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment