diff --git a/Dockerfile b/Dockerfile index 637df7e..0406cba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,15 @@ -FROM alpine:3.11 +FROM alpine:3 + +ARG VERSION +ARG BUILD_DATE +ARG VCS_REF +LABEL maintainer="Stark & Wayne " \ + summary="Concourse Slack Notifications Resource" \ + version=$VERSION \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-url="https://github.com/cloudfoundry-community/slack-notification-resource.git" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.schema-version="1.0.0" RUN apk add --no-cache curl bash jq gettext-dev diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4504814 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +IMAGE ?= cfcommunity/slack-notification-resource +VERSION ?= dev + +build: + docker build \ + --build-arg BUILD_DATE="$(shell date -u --iso-8601)" \ + --build-arg VCS_REF="$(shell git rev-parse --short HEAD)" \ + --build-arg vERSION="$(VERSION)" \ + . -t $(IMAGE):$(VERSION) + +push: build + docker push $(IMAGE):$(VERSION) + +release: build + docker tag $(IMAGE):$(VERSION) $(IMAGE):latest + docker push $(IMAGE):latest + docker push $(IMAGE):$(VERSION) diff --git a/README.md b/README.md index ad4d5e8..da6d871 100644 --- a/README.md +++ b/README.md @@ -280,8 +280,25 @@ body: { ``` +## Release Engineering +To build local versions of this, for testing: + $ docker build -t slack-notification-resources + +Tests will run as part of the build, and be left in the image for +future testing. This adds about 100k to the image. + +To cut a new officialy release of the +`cfcommunity/slack-notification-resource` image on +[Docker Hub][hub]: + + $ make VERSION=x.y.z release + + + + +[hub]: https://hub.docker.com/r/cfcommunity/slack-notification-resource [attach]: https://api.slack.com/docs/message-attachment [uidmap]: https://api.slack.com/changelog/2017-09-the-one-about-usernames#mapping [chans]: https://api.slack.com/docs/message-formatting#linking_to_channels_and_users