A Concourse resource to post to notification to Google Hagouts room using webhooks, the notification includes the pipeline name, The job name and build number which the resource is running under, and an optional message.
Listed in Concourse community resources
resource_types:
- name: hangouts-resource
type: docker-image
source:
repository: cloudinn/concourse-hangouts-resource
tag: latestwebhook_url: Required - (String). The webhook generated for Hagouts channel. (i.e. "https://chat.googleapis.com/v1/spaces/ABC/messages?key=DEF)post_url: Optional - (Boolean). Include link to the current job, this is pipeline wide setting in all jobs using resource, can be overridden inparamsin each step. (Default:true)
resources:
- name: hangouts
type: hangouts-resource
source:
webhook_url: {{pipeline_alerts_webhook}}
post_url: truePosts the given message to Google Hangouts channel that is corresponding to the webhook. It additionally includes information from the current running build as $BUILD_PIPELINE_NAME which is the pipeline name, $BUILD_NAME which reflects the build id shown in Concourse Web UI, and $BUILD_JOB_NAME which is the job name as defined in the pipeline, both build id and job name belongs to the current build for the job the resource is used under.
message: Optional - (String). The message to post along the other information to Hangouts room.message_fileOptional - (String). Path to file containing text to append tomessage)post_urlOptional - (Boolean). Include link to the current job, if set this will overridepost_urlinsourcefor the current step. (Default: Fall back topost_urlinsource)
You're suggested to use it under try: step, you don't want your build to fail if the resource failed
jobs:
- name: some-job
plan:
- try:
put: hangouts
params:
message: "Successfully released version: "
message_file: project/version.txtjobs:
- name: some-job
plan:
- try:
put: hangouts
params:
message: Job Started !
post_url: true
# .
# .
# .
# Some steps to execute
# .
# .
# .
on_failure:
try:
put: hangouts
params:
message: Job Failed !
on_success:
try:
put: hangouts
params:
message: Job Succeeded !
post_url: falseThis 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 hangouts_webhook while setting up the pipeline or replacing ((hangouts_webhook)) in place with the webhook URL.
resource_types:
- name: hangouts-resource
type: docker-image
source:
repository: cloudinn/concourse-hangouts-resource
tag: latest
post_url: true
resources:
- name: hangouts
type: hangouts-resource
source:
webhook_url: ((hangouts_webhook))
post_url: true
# .
# .
# .
# Some other resources
# .
# .
# .
jobs:
- name: some-job
serial: true
plan:
- try:
put: hangouts
params:
message: Build Started !
# .
# .
# .
# Some steps to execute
# .
# .
# .
on_failure:
try:
put: hangouts
params:
message: Build Failed !
on_success:
try:
put: hangouts
params:
message: Build Successed !BSD 2-Clause