Skip to content
Snippets Groups Projects
Commit b43f88aa authored by Tom Wilkie's avatar Tom Wilkie
Browse files

Update circle config, deploy master branch automatically


Signed-off-by: default avatarTom Wilkie <tom.wilkie@gmail.com>
parent b5b6999a
No related branches found
No related tags found
No related merge requests found
......@@ -6,20 +6,29 @@ workflows:
jobs:
- test
- build
- deploy:
- publish:
requires:
- test
- build
- deploy:
requires:
- publish
filters:
branches:
only: master
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: gcr.io/metrictank-gcr/logish-build-image:master-b5b6999
auth:
username: _json_key
password: $GCR_CREDS
working_directory: /go/src/github.com/grafana/logish
jobs:
test:
docker:
- image: gcr.io/metrictank-gcr/logish-build-image:master-017c0b4
auth:
username: _json_key
password: $GCR_CREDS
working_directory: /go/src/github.com/grafana/logish
<<: *defaults
steps:
- checkout
......@@ -30,26 +39,11 @@ jobs:
make BUILD_IN_CONTAINER=false test
build:
docker:
- image: gcr.io/metrictank-gcr/logish-build-image:master-017c0b4
auth:
username: _json_key
password: $GCR_CREDS
working_directory: /go/src/github.com/grafana/logish
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run:
name: Build Images
command: |
......@@ -67,27 +61,12 @@ jobs:
paths:
- images/
deploy:
docker:
- image: gcr.io/metrictank-gcr/logish-build-image:master-017c0b4
auth:
username: _json_key
password: $GCR_CREDS
working_directory: /go/src/github.com/grafana/logish
publish:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- restore_cache:
key: v1-logish-{{ .Branch }}-{{ .Revision }}
......@@ -102,3 +81,13 @@ jobs:
command: |
docker login -u _json_key -p "$GCR_CREDS" https://gcr.io &&
make push-images
deploy:
<<: *defaults
steps:
- run: |
images=$(make images)
curl -s --header "Content-Type: application/json" \
--data "{\"build_parameters\": {\"CIRCLE_JOB\": \"deploy\", \"IMAGE_NAMES\": \"$(make images-names)\"}}" \
--request POST \
https://circleci.com/api/v1.1/project/github/raintank/deployment_tools/tree/master?circle-token=$CIRCLE_TOKEN
......@@ -125,6 +125,9 @@ shell: build-image/$(UPTODATE)
endif
images:
echo $(IMAGE_NAMES)
save-images:
@mkdir -p images
for image_name in $(IMAGE_NAMES); do \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment