Are you using git, Jenkins and maybe Atlassian JIRA ®? Are you communicating via Slack? Chances are you've found some useful plugins, but for a few use cases there just isn't anything suitable out there. Isthmus covers the gap between the tools we use for development on a daily basis. It allows to automate those "if this then that" rules your team has, but occasionally fails to observe. Isthmus takes an HTTP JSON payload, either triggered via webhook or scheduled event, and transforms it into another HTTP JSON payload.
Use Isthmus if:
I'm hooked .. download
https://www.mycompany.com/jira/rest/api/2/search?jql=filter='Filter for Isthmus'
{ "text": "Tasks in progress for tomorrow:\n<#list issues as issue><https://www.mycompany.com/jira/${issue.key}|${issue.key} - ${issue.fields.summary}>\n</#list>", "username" : "Isthmus", "icon_emoji" : ":heavy_exclamation_mark:", "channel" : "jira-updates" }
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
script {
payload = changelistJSON()
echo "Sending JSON to Isthmus: ${payload}"
sh "curl -d '${payload}' -H "Content-Type: application/json" -X POST http://localhost:8087/isthmus/webhooks/jenkins"
}
(the -X POST here is unnecessary, but illustrates that we're sending POST)
{ "update": { "labels": [{ "add": "deployed" }] } }
http://localhost:8081/jira/rest/api/2/issue/${key}
#!/bin/bash
read oldrev newrev _branch
branch=$(echo $_branch | sed 's/.*\/\([a-z0-9][a-z0-9]*\)$/\1/')
commit_message=$(git log -1 --pretty=format:'%h %cn: %s%b' $newrev)
curl --header 'Content-Type: application/json' --data "$commit_message" http://localhost:8087/devtaskhub/webhooks/git &
.*FUN-.*
with type RegExp.*?: ([\w-]+).*
{ "update": { "labels": [{ "add": "code-changes" }, { "remove": "deployed" }] } }
http://localhost:8081/jira/rest/api/2/issue/${group1}
--server.port=nnnn
--server.servlet.context-path=/mypath
-Disthmus.logincoming=true
to log incoming payloads (useful if you're unsure what payload you'll be receiving)-Disthmus.logincoming=true
and then checking the console helps resolve most issues around payload filtering and mappingcurl -v --user username:password -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:8087/isthmus/webhooks/jenkins
java -Disthmus.logincoming=true -jar isthmus-0.0.94.jar --server.port=8087 --server.servlet.context-path=/isthmus &
http://localhost/jenkins/my-pipeline-job
,
then the pipeline syntax is explained at http://localhost/jenkins/my-pipeline-job/pipeline-syntax/
http://localhost/jenkins/my-pipeline-job/999/replay/