Skip to content

About

Concourse Resource to send notifications to pushover

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Concourse pushover resource

Concourse CI Resource to send notifications to the pushover app

The resource is based on smuggler concourse resource to quickly implement it with a small script.

Resource Type Configuration

resource_types:
- name: pushover-notification
  type: docker-image
  source:
    repository: redfactorlabs/pushover-notification
    tag: latest

Source & params Configuration

The following parameters can be passed in the source or in params of put

You can add any additional parameter and use it in the message with $SMUGGLER_<param_name>

Example:

resource_types:
- name: pushover-notification
  type: docker-image
  source:
    repository: keymon/concourse-pushover-resource
    tag: latest

resources:
- name: pushover-build-fail-notification
  type: pushover-notification
  source:
    atc_external_url: https://concourse.mycompany.com
    app_token: {{pushover_build_notifications_app_token}}
    user_key: {{pushover_group_key}}

jobs:
- name: some_important_job
  plan:
  - task: fail
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: alpine
      run:
        path: sh
        args:
        - -ec
        - |
          echo 'Something bad happened :('
          false
    on_failure:
      put: pushover-build-fail-notification
      params:
        message: |
          OMG!!! the important job failed!!! ARGHHH!

          Check it out ASAP here:

          ${SMUGGLER_atc_external_url}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/builds/${BUILD_NAME}

Important security limitation!

IMPORTANT: the current implementation does an shell eval to expand variables. That is prone to Command injection.

This is not too much risk when running concourse, as the concourse users are trust, but be aware of this. It is easy to fork this repo and change the file smuggler.yml to remove that eval.

Pre-requisites

You need a pushover app account and credentials

Configure pipeline:

Now you can create and run the pipeline:

fly -t demo set-pipeline \
  -p pushover -c example-pipeline.yml \
  -v pushover_build_notifications_app_token=${PUSHOVER_CONCOURSE_DEMO_APP_TOKEN}
  -v pushover_group_key=${PUSHOVER_USER_KEY}

Contributing

It is easy to extend this resource, by editing the file smuggler.yml.

The API references for the messages is here: https://pushover.net/api

About

Concourse Resource to send notifications to pushover

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors