Skip to content

barrelmaker97/concourse-hangouts-resource

 
 

Repository files navigation

codecov CodeFactor

Concourse Google Hangouts Resource

A Concourse resource to post a message to Google Hangouts room using webhooks. The message includes the pipeline name, job name and build number which the resource is running under, and an optional message/message file.

Resource Type Configuration

resource_types:
  - name: hangouts-resource
    type: docker-image
    source:
      repository: ghcr.io/barrelmaker97/concourse-hangouts-resource
      tag: latest

Resource Configuration

Example

resources:
- name: hangouts
  type: hangouts-resource
  source:
    webhook_url: ((webhook_url))

Behavior

check: Non-functional

in: Non-functional

out: Post message to Hangouts chat room

Posts the given message to a Google Hangouts Room that corresponds to the provided webhook. It includes information from the current running build such as the pipeline name, job name, and build number as defined in the pipeline.

Parameters

  • message: Optional - (String). The message to post along the other information to Hangouts room.
  • message_file Optional - (String). Path to file containing text to append to message)
  • post_url Optional - (Boolean). Include link to the current job. (Default: true)
  • post_info Optional - (Boolean). Include info about the current job. (Default: true)
  • create_thread Optional - (Boolean). Create a new thread in the chat room for each message. (Default: false)

Example

It's recommended to use this resource in the try: step so that your build doesn't fail if the resource fails to send the message.

jobs:
  - name: some-job
    plan:
      - try:
          put: hangouts
          params:
            message: "Building version: "
            message_file: project/version.txt
            post_url: true
            create_thread: false

      # .
      # .
      # .
      # Some steps to execute
      # .
      # .
      # .

    on_failure:
      try:
        put: hangouts
        params:
          message: Job Failed!
          post_url: false
          create_thread: false

    on_success:
      try:
        put: hangouts
        params:
          message: Job Succeeded!
          post_url: false
          create_thread: false

Complete Example:

This is a working example of a pipeline file that does absolutely nothing other than posting to Hangouts.

You can test it as is after passing webhook_url while setting up the pipeline or replacing ((webhook_url)) in place with the webhook URL.

---
resource_types:
  - name: hangouts-resource
    type: docker-image
    source:
      repository: ghcr.io/barrelmaker97/concourse-hangouts-resource
      tag: latest
resources:
  - name: hangouts
    type: hangouts-resource
    icon: google-hangouts
    source:
      webhook_url: ((webhook_url))
jobs:
  - name: test-job
    plan:
      - put: hangouts
        params:
          message: Greetings from Concourse!
          post_url: true
          create_thread: false

License

BSD 2-Clause

About

Concourse CI resource to send notifications with optional messages to GoogleChat

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 96.7%
  • Dockerfile 3.3%