|
1 |
| -# trellis-slack-webhook-notify-during-deploy |
| 1 | +# Trellis Slack Webhook Depolyment Notifications |
2 | 2 |
|
3 | 3 | [](https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy/tags)
|
4 | 4 | [](https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy/blob/master/LICENSE)
|
5 | 5 |
|
6 | 6 |
|
7 |
| -Sends a deployment complete message to a Slack channel when [Trellis](https://github.com/roots/trellis) deploys [Bedrock](https://github.com/roots/bedrock). |
| 7 | +Sends an initial deployment started and a deployment successful message to a Slack channel when [Trellis](https://github.com/roots/trellis) deploys [Bedrock](https://github.com/roots/bedrock). |
8 | 8 |
|
9 | 9 | <!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
10 | 10 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
@@ -38,33 +38,47 @@ Sends a deployment complete message to a Slack channel when [Trellis](https://gi
|
38 | 38 |
|
39 | 39 | ## Installation
|
40 | 40 |
|
41 |
| -Add this role to `requirements.yml`: |
| 41 | +Add this role to `requirements.yml` or `galaxy.yml` in newer versions of Trellis: |
42 | 42 | ```yaml
|
43 |
| -# requirements.yml |
44 |
| -- src: https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy |
45 |
| - version: 0.1.0 # Check for latest version! |
| 43 | +# requirements.yml / galaxy.yml |
| 44 | +- name: slack-notify |
| 45 | + src: https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy |
| 46 | + version: 0.3.0 # Check for latest version! |
46 | 47 | ```
|
47 | 48 |
|
48 | 49 | Run the command:
|
49 | 50 | ```bash
|
50 | 51 | ➜ ansible-galaxy install -r requirements.yml --force
|
51 | 52 | ```
|
52 | 53 |
|
| 54 | +With newer versions of Trellis, run: |
| 55 | +```bash |
| 56 | +➜ ansible-galaxy install -r galaxy.yml --force |
| 57 | +``` |
| 58 | + |
| 59 | + |
53 | 60 | ## Role Variables
|
54 | 61 |
|
55 |
| -Add this role to the [`deploy_after` hook](https://roots.io/trellis/docs/deploys/#hooks): |
| 62 | +Add these roles`deploy_before` & `deploy_finalize_after` to the deploy [hooks](https://roots.io/trellis/docs/deploys/#hooks): |
56 | 63 | ```yaml
|
57 |
| -# group_vars/all/deploy-hooks.yml |
58 |
| -# Learn more on https://roots.io/trellis/docs/deploys/#hooks |
59 |
| -deploy_after: |
60 |
| - - "{{ playbook_dir }}/vendor/roles/trellis-slack-webhook-notify-during-deploy/tasks/main.yml" |
| 64 | +# roles/deploy/defaults/main.yml |
| 65 | +deploy_before: |
| 66 | + - "{{ playbook_dir }}/vendor/roles/slack-notify/tasks/deploy_start.yml" |
| 67 | + |
| 68 | +... |
| 69 | + |
| 70 | +deploy_finalize_after: |
| 71 | + - "{{ playbook_dir }}/roles/deploy/hooks/finalize-after.yml" |
| 72 | + - "{{ playbook_dir }}/vendor/roles/slack-notify/tasks/deploy_success.yml" |
61 | 73 | ```
|
62 | 74 |
|
63 |
| -Add your Webhook token (end of the Webhook URL) and channel into `group_vars/all/main.yml` |
| 75 | +Add your Webhook token (end of the Webhook URL), channel and projects github repo into `group_vars/all/main.yml` |
64 | 76 |
|
65 | 77 | ```yaml
|
| 78 | +# group_vars/all/main.yml |
66 | 79 | slack_webhook_token: XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXX
|
67 | 80 | slack_webhook_channel: '#development-alerts'
|
| 81 | +slack_git_repo_url: "https://github.com/username/repo-name" |
68 | 82 | ```
|
69 | 83 |
|
70 | 84 | ## Usage
|
|
0 commit comments