Code Monkey home page Code Monkey logo

trellis-slack-webhook-notify-during-deploy's Introduction

Trellis Slack Webhook Depolyment Notifications

GitHub tag license

Sends an initial deployment started and a deployment successful message to a Slack channel when Trellis deploys Bedrock.

Requirements

  • Trellis v1.0.0 or later
  • Ansible v2.6 or later
  • Valid Slack Webhook URL

Screenshots

Deployment Screenshot

Installation

Add this role to requirements.yml or galaxy.yml in newer versions of Trellis:

# requirements.yml / galaxy.yml
- name: slack-notify
  src: https://github.com/ItinerisLtd/trellis-slack-webhook-notify-during-deploy
  version: 0.3.0 # Check for latest version!

Run the command:

➜ ansible-galaxy install -r requirements.yml --force

With newer versions of Trellis, run:

➜ ansible-galaxy install -r galaxy.yml --force

Role Variables

Add these rolesdeploy_before & deploy_finalize_after to the deploy hooks:

# roles/deploy/defaults/main.yml
deploy_before:
  - "{{ playbook_dir }}/vendor/roles/slack-notify/tasks/deploy_start.yml"

...

deploy_finalize_after:
  - "{{ playbook_dir }}/roles/deploy/hooks/finalize-after.yml"
  - "{{ playbook_dir }}/vendor/roles/slack-notify/tasks/deploy_success.yml"

Add your Webhook token (end of the Webhook URL), channel and projects github repo into group_vars/all/main.yml

# group_vars/all/main.yml
slack_webhook_token: XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXX
slack_webhook_channel: '#development-alerts'
slack_git_repo_url: "https://github.com/username/repo-name"

Usage

Deploy as usual. No special action needed.

FAQs

How do I get a Slack Webhook URL?

  1. Visit the "Your Apps" page on Slack
  2. Create an App (e.g. "Deployment alerts") and enable "Incoming Webhooks"
  3. Setup a Webhook for your desired Workspace
  4. Copy the Webhook URL for use in Installation

See Also

Testing

Syntax Check

➜ ansible-playbook -i 'localhost,' --syntax-check tests/test.yml

Author Information

trellis-slack-webhook-notify-during-deploy is a Itineris Limited project created by Lee Hanbury-Pickett.

Special thanks to the Roots team whose Trellis make this project possible.

Full list of contributors can be found here.

Feedback

Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.

Change log

Please see CHANGELOG for more information on what has changed recently.

License

trellis-slack-webhook-notify-during-deploy is released under the MIT License.

trellis-slack-webhook-notify-during-deploy's People

Contributors

codepuncher avatar faahim avatar mike-sheppard avatar tangrufus avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.