Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/novaway/deployer-release-check-list

A simple recipe for Deployer to manage a release check-list using Gitlab issues
https://github.com/novaway/deployer-release-check-list

Last synced: about 5 hours ago
JSON representation

A simple recipe for Deployer to manage a release check-list using Gitlab issues

Awesome Lists containing this project

README

        

# Release check-list for Deployer

A simple recipe for [Deployer](https://github.com/deployphp/deployer) to manage a release check-list using Gitlab issues.

The idea is to handle a list of mandatory (and non-blocking) tasks for a release.
This is made possible using a Gitlab issue (with its tasks system), with specific title and label (customisable).

## Installation

```bash
composer require novaway/deployer-release-check-list
```

## Configuration

```php
// deploy.php
getOption('tag')`.
```php
set('rcl_release_version', get('my_release_version'));
```

### Examples

In case of an uncompleted mandatory task:
![Uncompleted task](docs/mandatory_task.png "Mandatory task")

Reminder for `post-release` tasks:
![Post-release task](docs/reminder.png "Reminder")

### Bonus

Get a slack notification for uncompleted post-release tasks (considering you already configured the slack recipe):
```php
// 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');
```