PHP code example of novaway / deployer-release-check-list

1. Go to this page and download the library: Download novaway/deployer-release-check-list library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

novaway / deployer-release-check-list example snippets


// deploy.php


//...

tps://gitlab.example.com');
set('rcl_gitlab_api_key', 'MY_API_TOKEN');
set('rcl_gitlab_project_id', 'MY_PROJECT_ID');

set('rcl_gitlab_label', 'Foo list');

set('rcl_release_version', get('my_release_version'));

// deploy.php
use Deployer\Task\Context;
use Deployer\Utility\Httpie;

task('rcl:post-release-slack-reminder', function() {
    if (!get('slack_webhook', false)) {
        return;
    }

    $pendingPostReleaseTasks = get('rcl_pending_post_release_tasks', []);
    if (count($pendingPostReleaseTasks) === 0) {
        return;
    }

    $text = implode(PHP_EOL, array_map(function($item) {
       return '- '.$item[1];
    }, $pendingPostReleaseTasks));

    $host = Context::get()->getHost()->getHostname();

    $attachment = [
        'title' => sprintf('[%s][%s] Pending post-release tasks:', $host, get('release_version')),
        'text' => $text,
        'color' => get('slack_color'),
        'mrkdwn_in' => ['text'],
    ];

    Httpie::post(get('slack_webhook'))->body(['attachments' => [$attachment]])->send();
});

after('success', 'rcl:post-release-slack-reminder');