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_types:
- name: hangouts-resource
type: docker-image
source:
repository: ghcr.io/barrelmaker97/concourse-hangouts-resource
tag: latest
webhook_url
: Required - (String). The webhook generated for Hangouts channel. (i.e. https://chat.googleapis.com/v1/spaces/ABC/messages?key=DEF)
resources:
- name: hangouts
type: hangouts-resource
source:
webhook_url: ((webhook_url))
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.
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 tomessage
)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
)
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
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
BSD 2-Clause