A Concourse resource to make HTTP calls to JSON endpoints, and parse them using custom JQ filter.
Parameter | Required | Example | Description |
---|---|---|---|
base_url |
Yes | https://api.github.com/users/octocat/orgs |
Url for the json payload to get. |
jq_filter |
No | {user, title: .titles[]} |
Valid JQ filter. Defaults to ".". The output of JQ filter needs to be vaild JSON. |
credentials |
No | root:hunter2 |
Basic auth. Will be base64 encoded. |
headers |
No | ["Cookie: UserName=Bob"] |
an array containing headers, in "Name: Value" format. |
Notes:
- Look at the Concourse Resources documentation for webhook token configuration.
Produces new versions from a JSON payload defined in base_url
. jq_filter
then parses the payload accordingly to your needs.
Does nothing.
Does nothing.
Triggering a job in concourse based on a release in bamboo.
resource_types:
- name: http-jq-resource
type: docker-image
source:
repository: qudini/concourse-http-jq-resource
tag: latest
resources:
- name: bamboo-staging-release
type: http-jq-resource
source:
base_url: https://<Bamboo instance>/rest/api/latest/deploy/environment/{env_id}/results?os_authType=basic
jq_filter: "{.results[] | {"deploymentVersionName":.deploymentVersionName,"id":.id|tostring,"key":.deploymentVersion.items[0].planResultKey.key,"startedDate":.startedDate|tostring,finishedDate:.finishedDate|tostring}"
# bamboo_readonly_credentials = username:password
credentials: ((bamboo_readonly_credentials))
Results in
[
{
"deploymentVersionName": "master-718",
"id": "107282481",
"key": "KEY-QD678-718",
"startedDate": "1579089918295",
"finishedDate": "1579090971755"
},
{
"deploymentVersionName": "master-717",
"id": "107282475",
"key": "KEY-QD678-717",
"startedDate": "1579027585024",
"finishedDate": "1579028083334"
}
]
resource_types:
- name: http-jq-resource
type: docker-image
source:
repository: qudini/concourse-http-jq-resource
tag: latest
resources:
- name: dockerhub-http-jq-release
type: http-jq-resource
source:
base_url: https://registry.hub.docker.com/v1/repositories/qudini/concourse-http-jq-resource/tags
jq_filter: ".[] | {releaseTag:.name}"
Results in