mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-04-29 07:58:51 +00:00
Build ARM container images (#242)
It also updates the Circle CI configuration to use the Prometheus orb. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
611dd8c60a
commit
eb51631f33
|
@ -1,6 +1,9 @@
|
||||||
---
|
---
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
|
orbs:
|
||||||
|
prometheus: prometheus/prometheus@0.1.0
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
# Whenever the Go version is updated here, .travis.yml and .promu.yml
|
# Whenever the Go version is updated here, .travis.yml and .promu.yml
|
||||||
# should also be updated.
|
# should also be updated.
|
||||||
|
@ -13,80 +16,11 @@ jobs:
|
||||||
executor: golang
|
executor: golang
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- prometheus/setup_environment
|
||||||
- run: make promu
|
|
||||||
- run: make
|
- run: make
|
||||||
- run: git diff --exit-code
|
- run: git diff --exit-code
|
||||||
- store_artifacts:
|
- prometheus/store_artifact:
|
||||||
path: statsd_exporter
|
file: statsd_exporter
|
||||||
destination: /build/statsd_exporter
|
|
||||||
- run: rm -v statsd_exporter
|
|
||||||
|
|
||||||
build:
|
|
||||||
machine: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: make promu
|
|
||||||
- run: promu crossbuild -v
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: .
|
|
||||||
paths:
|
|
||||||
- .build
|
|
||||||
- store_artifacts:
|
|
||||||
path: .build
|
|
||||||
destination: /build
|
|
||||||
|
|
||||||
docker_hub_master:
|
|
||||||
executor: golang
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- setup_remote_docker
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run: ln -s .build/linux-amd64/statsd_exporter statsd_exporter
|
|
||||||
- run: make docker
|
|
||||||
- run: make docker DOCKER_REPO=quay.io/prometheus
|
|
||||||
- run: docker images
|
|
||||||
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
||||||
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
|
|
||||||
- run: make docker-publish
|
|
||||||
- run: make docker-publish DOCKER_REPO=quay.io/prometheus
|
|
||||||
|
|
||||||
docker_hub_release_tags:
|
|
||||||
executor: golang
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- setup_remote_docker
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run: make promu
|
|
||||||
- run: promu crossbuild tarballs
|
|
||||||
- run: promu checksum .tarballs
|
|
||||||
- run: promu release .tarballs
|
|
||||||
- store_artifacts:
|
|
||||||
path: .tarballs
|
|
||||||
destination: releases
|
|
||||||
- run: ln -s .build/linux-amd64/statsd_exporter statsd_exporter
|
|
||||||
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
|
|
||||||
- run: make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG DOCKER_REPO=quay.io/prometheus
|
|
||||||
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
||||||
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
|
|
||||||
- run: make docker-publish DOCKER_IMAGE_TAG="$CIRCLE_TAG"
|
|
||||||
- run: make docker-publish DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
|
|
||||||
- run: make docker-manifest DOCKER_IMAGE_TAG="$CIRCLE_TAG"
|
|
||||||
- run: make docker-manifest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
|
|
||||||
- run: |
|
|
||||||
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
|
|
||||||
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG"
|
|
||||||
make docker-tag-latest DOCKER_IMAGE_TAG="$CIRCLE_TAG" DOCKER_REPO=quay.io/prometheus
|
|
||||||
make docker-publish DOCKER_IMAGE_TAG="latest"
|
|
||||||
make docker-publish DOCKER_IMAGE_TAG="latest" DOCKER_REPO=quay.io/prometheus
|
|
||||||
make docker-manifest DOCKER_IMAGE_TAG="latest"
|
|
||||||
make docker-manifest DOCKER_IMAGE_TAG="latest" DOCKER_REPO=quay.io/prometheus
|
|
||||||
fi
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
@ -96,11 +30,12 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- build:
|
- prometheus/build:
|
||||||
|
name: build
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- docker_hub_master:
|
- prometheus/publish_master:
|
||||||
context: org-context
|
context: org-context
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
|
@ -108,7 +43,7 @@ workflows:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
- docker_hub_release_tags:
|
- prometheus/publish_release:
|
||||||
context: org-context
|
context: org-context
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
|
|
|
@ -2,3 +2,5 @@
|
||||||
.tarballs/
|
.tarballs/
|
||||||
|
|
||||||
!.build/linux-amd64
|
!.build/linux-amd64
|
||||||
|
!.build/linux-armv7
|
||||||
|
!.build/linux-arm64
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
FROM quay.io/prometheus/busybox:latest
|
ARG ARCH="amd64"
|
||||||
|
ARG OS="linux"
|
||||||
|
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
|
||||||
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>"
|
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>"
|
||||||
|
|
||||||
COPY statsd_exporter /bin/statsd_exporter
|
ARG ARCH="amd64"
|
||||||
|
ARG OS="linux"
|
||||||
|
COPY .build/${OS}-${ARCH}/statsd_exporter /bin/statsd_exporter
|
||||||
|
|
||||||
USER nobody
|
USER nobody
|
||||||
EXPOSE 9102 9125 9125/udp
|
EXPOSE 9102 9125 9125/udp
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -11,6 +11,9 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Needs to be defined before including Makefile.common to auto-generate targets
|
||||||
|
DOCKER_ARCHS ?= amd64 armv7 arm64
|
||||||
|
|
||||||
include Makefile.common
|
include Makefile.common
|
||||||
|
|
||||||
STATICCHECK_IGNORE =
|
STATICCHECK_IGNORE =
|
||||||
|
|
Loading…
Reference in a new issue