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

Save images and reload them in the deploy step.

parent d77e0fe2
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,8 @@ workflows:
- build
- deploy:
requires:
- build
- test
- build
jobs:
test:
......@@ -24,9 +24,8 @@ jobs:
- checkout
- run:
name: Build Images
name: Run Unit Tests
command: |
# skip building the build image again
touch build-image/.uptodate &&
make BUILD_IN_CONTAINER=false test
......@@ -54,10 +53,20 @@ jobs:
- run:
name: Build Images
command: |
# skip building the build image again
touch build-image/.uptodate &&
make BUILD_IN_CONTAINER=false
- run:
name: Save Images
command: |
touch build-image/.uptodate &&
make BUILD_IN_CONTAINER=false save-images
- save_cache:
key: v1-logish-{{ .Branch }}-{{ .Revision }}
paths:
- images/
deploy:
docker:
- image: gcr.io/metrictank-gcr/logish-build-image:master-017c0b4
......@@ -79,6 +88,15 @@ jobs:
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- restore_cache:
key: v1-logish-{{ .Branch }}-{{ .Revision }}
- run:
name: Load Images
command: |
touch build-image/.uptodate &&
make BUILD_IN_CONTAINER=false load-images
- run:
name: Push Images
command: |
......
......@@ -10,3 +10,4 @@ cmd/distributor/distributor
cmd/ingester/ingester
cmd/querier/querier
*.output
images/
......@@ -125,6 +125,22 @@ shell: build-image/$(UPTODATE)
endif
save-images:
@mkdir -p images
for image_name in $(IMAGE_NAMES); do \
if ! echo $$image_name | grep build; then \
docker save $$image_name:$(IMAGE_TAG) -o images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG); \
fi \
done
load-images:
@mkdir -p images
for image_name in $(IMAGE_NAMES); do \
if ! echo $$image_name | grep build; then \
docker load -i images/$$(echo $$image_name | tr "/" _):$(IMAGE_TAG); \
fi \
done
push-images:
for image_name in $(IMAGE_NAMES); do \
if ! echo $$image_name | grep build; then \
......
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