Skip to content

Commit

Permalink
Update circleci build (#296)
Browse files Browse the repository at this point in the history
Update based on the latest upstream prometheus circleci config.

Signed-off-by: Ben Kochie <superq@gmail.com>
  • Loading branch information
SuperQ authored Jun 29, 2018
1 parent b95972b commit 5d71796
Showing 1 changed file with 5 additions and 44 deletions.
49 changes: 5 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ jobs:
machine: true
working_directory: /home/circleci/.go_workspace/src/github.com/prometheus/mysqld_exporter

environment:
DOCKER_IMAGE_NAME: prom/mysqld-exporter
QUAY_IMAGE_NAME: quay.io/prometheus/mysqld-exporter
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.10-base
REPO_PATH: github.com/prometheus/mysqld_exporter

steps:
- checkout
- run: make promu
Expand All @@ -40,28 +34,6 @@ jobs:
root: .
paths:
- .build
- run: ln -s .build/linux-amd64/mysqld_exporter mysqld_exporter
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME
fi
- run: docker images
- run: docker network create mysql-test
- run: docker run --network mysql-test -e MYSQL_ROOT_PASSWORD=secret -p 3306:3306 -d percona/percona-server:latest

- run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make test-docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make test-docker
fi

docker_hub_master:
docker:
Expand All @@ -71,8 +43,6 @@ jobs:
environment:
DOCKER_IMAGE_NAME: prom/mysqld-exporter
QUAY_IMAGE_NAME: quay.io/prometheus/mysqld-exporter
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.10-base
REPO_PATH: github.com/prometheus/mysqld_exporter

steps:
- checkout
Expand All @@ -96,8 +66,6 @@ jobs:
environment:
DOCKER_IMAGE_NAME: prom/mysqld-exporter
QUAY_IMAGE_NAME: quay.io/prometheus/mysqld-exporter
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.10-base
REPO_PATH: github.com/prometheus/mysqld_exporter

steps:
- checkout
Expand All @@ -115,24 +83,17 @@ jobs:
path: .tarballs
destination: releases
- run: ln -s .build/linux-amd64/mysqld_exporter mysqld_exporter
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME
make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME
fi
- run: make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: make docker DOCKER_IMAGE_NAME=$QUAY_IMAGE_NAME DOCKER_IMAGE_TAG=$CIRCLE_TAG
- run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- run: docker login -u $QUAY_LOGIN -p $QUAY_PASSWORD quay.io
- run: |
if [[ "$CIRCLE_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
docker tag "$DOCKER_IMAGE_NAME:$CIRCLE_TAG" "$DOCKER_IMAGE_NAME:latest"
docker tag "$QUAY_IMAGE_NAME:$CIRCLE_TAG" "$QUAY_IMAGE_NAME:latest"
fi
- run: docker push $DOCKER_IMAGE_NAME:$CIRCLE_TAG
- run: docker push $QUAY_IMAGE_NAME:$CIRCLE_TAG
- run: docker push $DOCKER_IMAGE_NAME
- run: docker push $QUAY_IMAGE_NAME

workflows:
version: 2
Expand Down Expand Up @@ -163,6 +124,6 @@ workflows:
- build
filters:
tags:
only: /^v.*/
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
branches:
ignore: /.*/

0 comments on commit 5d71796

Please sign in to comment.