/concourse-http-resource

A generic Concourse resource for hitting an HTTP URL based on a small alpine base image.

Primary LanguageShellMIT LicenseMIT

HTTP Resource

A generic resource for hitting an HTTP URL based on a small alpine base image. Useful for generic HTTP REST APIs (e.g. notifications, comments, etc..). Because this is a resource, it has access to the build metadata.

Installing

Add the following to the resource_types section of a pipeline config:

---
resource_types:
- name: concourse-http-resource
  type: docker-image
  source:
    repository: edtan1/concourse-http-resource

Source configuration

---
resources:
- name: my-http-resource
  type: concourse-http-resource
  source:
    url: https://mattermost.com/hooks/randomhash
    method: "POST"
    headers:
      Content-Type: "application/json"
  • url: Required. HTTP URL to access.

  • method: Optional. HTTP method to use. Defaults to GET.

  • headers: Optional. Map of HTTP headers to send

check: no-op

This resource currently does nothing for check.

in: no-op

This resource currently does nothing for in.

out: Hit an HTTP URL

Access an HTTP URL using curl.

Configuration:

plan:
- put: my-http-resource
  params:
    data_text: "The build $BUILD_NAME $BUILD_ID completed"

Parameters

  • data_file: Optional. File containing data to be sent with the request. Cannot be specified at the same time as data_text.

  • data_text: Optional. Text to be sent with the request. Cannot be specified at the same time as data_file.