Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created April 26, 2019 13:05
Show Gist options
  • Save phcostabh/937dd3771163543d80f26ef627b99e6f to your computer and use it in GitHub Desktop.
Save phcostabh/937dd3771163543d80f26ef627b99e6f to your computer and use it in GitHub Desktop.

Revisions

  1. Philippe Santana Costa created this gist Apr 26, 2019.
    39 changes: 39 additions & 0 deletions deploy.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    <?php

    require_once 'recipe/common.php';

    set('keep_releases', 5);

    server('staging', 'staging.chatfood.io', 22)
    ->user('forge')
    ->identityFile()
    ->stage('staging')
    ->env('branch', 'staging')
    ->env('deploy_path', '/home/forge/staging.chatfood.io');

    set('repository', '[email protected]:chatfood/chatfood-api.git');

    /**
    * Setup the environment file in the new release
    */
    task('environment', function () {
    run('cp /home/forge/staging.chatfood.io/shared/.env {{release_path}}/.env');
    })->desc('Environment setup');

    // Laravel writable dirs
    set('writable_dirs', ['storage', 'vendor']);

    /**
    * Main task
    */
    task('deploy', [
    'deploy:prepare',
    'deploy:release',
    'deploy:update_code',
    'deploy:vendors',
    'deploy:symlink',
    'cleanup',
    'environment',
    ])->desc('Deploy your project');

    after('deploy', 'success');