{"id":14984762,"url":"https://github.com/jenkinsci/hubot-steps-plugin","last_synced_at":"2025-04-06T14:11:46.596Z","repository":{"id":16040291,"uuid":"79162377","full_name":"jenkinsci/hubot-steps-plugin","owner":"jenkinsci","description":"Jenkins pipeline steps for integration with Hubot.","archived":false,"fork":false,"pushed_at":"2025-03-10T17:16:30.000Z","size":2773,"stargazers_count":59,"open_issues_count":3,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T13:08:15.516Z","etag":null,"topics":["chatops","hipchat","hubot","hubot-scripts","irc","jenkins","jenkins-pipeline","jenkins-plugin","microsoft-teams","pipeline","slack"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/hubot-steps","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.adoc","contributing":"CONTRIBUTING.adoc","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-16T21:45:30.000Z","updated_at":"2025-02-21T11:45:07.000Z","dependencies_parsed_at":"2023-02-19T09:46:38.527Z","dependency_job_id":"317fb75e-0a2e-4acc-996f-9e681d2f9494","html_url":"https://github.com/jenkinsci/hubot-steps-plugin","commit_stats":{"total_commits":94,"total_committers":10,"mean_commits":9.4,"dds":0.648936170212766,"last_synced_commit":"86e59f54a064818e47c1021d89ce18d1edf6c82d"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fhubot-steps-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fhubot-steps-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fhubot-steps-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fhubot-steps-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/hubot-steps-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492557,"owners_count":20947545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatops","hipchat","hubot","hubot-scripts","irc","jenkins","jenkins-pipeline","jenkins-plugin","microsoft-teams","pipeline","slack"],"created_at":"2024-09-24T14:09:38.202Z","updated_at":"2025-04-06T14:11:46.565Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Hubot Pipeline Steps\n:toc: macro\n:note-caption: :information_source:\n:tip-caption: :bulb:\n\nimage:images/JenkinsPlusHubot.png[Jenkins,300]\n\nlink:https://ci.jenkins.io/job/Plugins/job/hubot-steps-plugin/job/master/[image:https://ci.jenkins.io/job/Plugins/job/hubot-steps-plugin/job/master/badge/icon[Build]] image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[License] link:https://plugins.jenkins.io/hubot-steps[image:https://img.shields.io/badge/Hubot%20Plugin-WIKI-blue.svg[Wiki]] image:https://badges.gitter.im/jenkinsci/hubot-steps-plugin.svg[link=\"https://gitter.im/jenkinsci/hubot-steps-plugin?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"]\n\nJenkins Pipeline Steps for integration with the https://hubot.github.com/[Hubot Chat Bot] and with human approval.\n\n'''\ntoc::[]\n\n== Configuration\n=== **Hubot Site**\n* *Default Site* `optional`, default to false. Default at folder level or Global level, when there are multiple default sites at the same level (Global or at a certain folder level), randomly picked.\n* *Name* `required`, site name.\n* *URL* `required`, hubot url, including port number, Ex: `https://localhost:9999/`.\n* *Room* `optional`, room name, which can include #, depends on the chat service. Is optional when using folder name as room option.\n* *Use Folder Name as Room* `optional`, by default is `false`, use folder name as room name.\n* *Room Prefix* `optional`, only applicable for folder name as room option enabled. Ex: For personal organization folder @ required to send direct messages.\n* *Fail On Error* `optional`, default `true`.\n* *Advanced*\n** *Build Notifications* `optional` - List of build notifications.\n*** *Enabled* - Enable this notification.\n*** *Type* - List of available build notifications.\n*** *Room(s)* - `optional`, list of rooms, comma separated, when it is different from actual room name above.\n*** *Token(s)* - `optional`, list of tokens, comma separated, refer to https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin[Token Macro plugin] for more info. Ex: `'BUILD_DURATION, BUILD_URL'`. NOTE: no `${}` around token name.\n\n=== **Global Config**\n* List of Global Hubot Sites\n\nimage::images/globalSite.png[Global Site,900]\n\n=== **Folder Config**\n* List of Hubot Sites\n\nimage::images/folderSite.png[Folder Site,900]\n\n=== **Job Config**\n* *Enable Notifications* - defaults to `false`.\n* *Hubot Site Name* `optional`, given there is a default site at folder(or one of the parent folders) level/ global level.\n\nimage::images/jobConfig.png[Job Config,900]\n\n== Build Notifications\n\nSupports sending notifications for the following build statuses.\n\n* Build Started.\n* Build Aborted.\n* Build Successful.\n* Build Failed.\n* Build Unstable.\n* Build Back to Normal.\n* Module not built.\n\nimage::images/buildNotifications.png[Build Notifications,900]\n\n== Pipeline Steps\n\nThe following Jenkins pipeline steps are available.\n\n=== **hubotSend**\n\nSends a given message to site/room.\n\n[source,groovy]\n----\nhubotSend message: 'Releasing Test project.'\n----\n\n* *message* `required`, actual message to send.\n* *status* `optional`, text which can be used in script to differentiate. Ex: INFO, WARN, ERROR or SUCCESS - So that in Slack it can be used to decide card colors.\n* *tokens* `optional`, list of tokens, comma separated, Refer to https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin[Token Macro plugin] for more information.\n* *extraData* `optional`, extra data like attachments in case of slack, Any kind of Map, given it is Serializable.\n* *site* `optional`, hubot site name either it is from Folder Level or Global Level, Only used when *url* is not present. Optional, it will fallback to first default site that it found while searching from immediate folder to Global site configurations.\n* *url* `optional`, if it is provided as global environment variable *HUBOT_URL* or provided by `withEnv` step, this should always end with `/`, environment variable takes the lower precedence.\n* *room* `optional`, if it is provided as global environment variable *HUBOT_DEFAULT_ROOM* or provided by `withEnv` step, and room doesn't require `#`, it is added in the code, environment variable takes the lower precedence.\n* *failOnError* `optional` and by default it is `true`, if any error it won't abort the job, it can also be provided as global environment variable *HUBOT_FAIL_ON_ERROR*, environment variable takes the lower precedence.\n\n=== **hubotApprove**\n\nSends a hubot message the project chat room for a project when the build is waiting for user input with the hubot commands to proceed or abort the build.\n\n[source,groovy]\n----\nhubotApprove message: 'Promote to Production?'\n----\n\n* *message* `required`, actual message to send.\n* *status* `optional`, text which can be used in script to differentiate. Ex: INFO, WARN, ERROR or SUCCESS - So that in Slack it can be used to decide card colors.\n* *tokens* `optional`, list of tokens, comma separated, Refer to https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin[Token Macro plugin] for more information.\n* *extraData* `optional`, extra data like attachments in case of slack, Any kind of Map, given it is Serializable.\n* *site* `optional`, hubot site name either it is from Folder Level or Global Level, Only used when *url* is not present. Optional, it will fallback to first default site that it found while searching from immediate folder to Global site configurations.\n* *url* `optional`, if it is provided as global environment variable *HUBOT_URL* or provided by `withEnv` step, this should always end with `/`, environment variable takes the lower precedence.\n* *room* `optional`, if it is provided as global environment variable *HUBOT_DEFAULT_ROOM* or provided by `withEnv` step, and room doesn't require `#`, it is added in the code, environment variable takes the lower precedence.\n* *failOnError* `optional` and by default it is `true`, if any error it won't abort the job, it can also be provided as global environment variable *HUBOT_FAIL_ON_ERROR*, environment variable takes the lower precedence.\n* *id* `optional`, defaults to *Proceed*, refer to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/[input step] for more information.\n* *submitter* `optional`, comma separated list of users who can provide input. Refer to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/[input step] for more information.\n* *ok* `optional`, Proceed button label, Refer to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/[input step] for more information.\n* *submitterParameter* `optional` If specified, this is the name of the return value that will contain the ID of the user that approves this input. Refer to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/[input step] for more information.\n* *parameters* `optional`, Request that the submitter specify one or more parameter values when approving. Refer to https://jenkins.io/doc/pipeline/steps/pipeline-input-step/[input step] for more information.\n\n==== Example\n\n[source,groovy]\n----\nhubotSend message: \"*Release Started*. \\n Releasing Test Project. :sunny: \\n\u003c!here\u003e \u003c!channel\u003e \u003c@nrayapati\u003e \", tokens: \"BUILD_NUMBER,BUILD_ID\", status: 'STARTED'\n\nhubotSend message: \"*Release Completed*. \\n Releasing Test Project.\", tokens: \"BUILD_NUMBER,BUILD_ID\", status: 'SUCCESS'\n\nhubotApprove message: 'Promote to Staging?', tokens: \"BUILD_NUMBER, BUILD_DURATION\", status: 'ABORTED'\n\nhubotSend message: \"*Staging Deployment Successful...* \\n Deployed Test Project to 192.168.1.175 node.\", tokens: \"BUILD_NUMBER,BUILD_ID\", status: 'SUCCESS'\n\nhubotApprove message: 'Promote to Production?', tokens: \"BUILD_NUMBER, BUILD_DURATION\", status: 'ABORTED'\n\nhubotSend message: \"*Hooray! Went to Prod... :satisfied:* \\n Deployed Test Project to prod(10.12.1.191) node.\", tokens: \"BUILD_NUMBER,BUILD_ID\", status: 'SUCCESS'\n----\n\n**Jenkins Approved Job**\n\nimage::images/slackProceed.png[Slack Example,900]\n\nimage::images/proceed.png[Slack Example,500]\n\n**Jenkins Aborted Job**:\n\nimage::images/slackAbort.png[Slack Example,900]\n\nimage::images/abort.png[Slack Example,500]\n\n== Hubot Setup\n\n=== New to hubot?\n\nRefer to https://github.com/ThoughtsLive/hubot-base[hubot-base] to setup a either docker container or to run it locally.\n\nTIP: Please replace scripts on hubot-base repo with the scripts under this hubot-steps repo and it is always a good idea to copy over the scripts from appropriate tag based on the version being installed on Jenkins.\n\n=== Already running hubot.\n\nThen just copy over following scripts from `scripts` folder (jenkins, and one of the hubot scripts based on chat service you are using.). These are just examples and can be modified based on chat service / per the actual needs.\n\n* https://github.com/jenkinsci/hubot-steps/blob/master/scripts/hubot_slack.coffee[hubot_slack]\n* https://github.com/jenkinsci/hubot-steps/blob/master/scripts/hubot.coffee[hubot]\n* https://github.com/jenkinsci/hubot-steps/blob/master/scripts/jenkins.coffee[jenkins]\n\n== Examples\n\n==== Default Site at Folder/Global level.\n\n[source,groovy]\n----\nhubotSend message: 'test message.'\nhubotApprove message: 'Proceed with building this job?'\n----\n==== With Site Name either at Folder or Global level.\n\n[source,groovy]\n----\nhubotSend message: 'test message.', site: 'release'\nhubotApprove message: 'Proceed with building this job?', site: 'release'\n----\n\n==== Site with Folder Name as Room.\n\n[source,groovy]\n----\nhubotSend message: 'test message.', site: 'release'\nhubotApprove message: 'Proceed with building this job?', site: 'release'\n----\n\n==== With Global Environment Variables / No Default Site at Folder/Global level.\nimage::images/global.png[Global,900]\n\n[source,groovy]\n----\nhubotSend message: 'test message.'\nhubotApprove message: 'Proceed with building this job?'\n----\n==== withEnv Variables / No Default Site at Folder/Global level.\n[source,groovy]\n----\nwithEnv(['HUBOT_URL=http://192.168.1.176:9999','HUBOT_DEFAULT_ROOM=botlab','HUBOT_FAIL_ON_ERROR=false']) {\n  hubotSend message: 'building job $BUILD_URL'\n  hubotApprove message: 'Proceed with building this job?'\n}\n----\n==== No Environment Variables\n\nScreenshot:\n\nimage::images/pipeline_syntax.png[Pipeline Syntax,900]\n\n[source,groovy]\n----\nhubotSend failOnError: 'false', message: 'testMessage', room: 'botlab', url: 'http://192.168.1.176:9999/'\nhubotApprove failOnError: 'false', message: 'Proceed with building this job?', room: 'botlab', url: 'http://192.168.1.176:9999/'\n----\n\n== Blue Ocean View\n\nimage::images/blueocean.png[BlueOcean,900]\n\n== Known Issues\n\n* https://github.com/jenkinsci/hubot-steps/blob/master/scripts/hubot.coffee[hubot] script doesn't work when *Prevent Cross Site Request Forgery exploits* enabled in Configure Global Security, need to modify script to query crumb before actual request.\n\n== Maintainers\n\n* https://github.com/nrayapati[Naresh Rayapati]\n\n== Disclaimer\n\nPlease don't hesitate to log a https://issues.jenkins-ci.org/secure/RapidBoard.jspa?rapidView=171\u0026projectKey=JENKINS[JIRA] or github pull request if you need any help or if you can be of help with this plugin :).\nRefer to the link:./CONTRIBUTION.adoc[contribution guide] for more information.\n\nDeveloped by https://github.com/nrayapati[Naresh Rayapati], this repo was initially cloned from https://github.com/ThoughtsLive/hubot-steps[ThoughtsLive]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fhubot-steps-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fhubot-steps-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fhubot-steps-plugin/lists"}