Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Fix saving cnab base image to a global tmp directory and put it in a …
Browse files Browse the repository at this point in the history
…local git ignored directory (_build).

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
  • Loading branch information
silvin-lubecki committed Jan 17, 2019
1 parent 5812410 commit c10d616
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pipeline {
dir('src/github.com/docker/app') {
checkout scm
sh 'make -f docker.Makefile save-invocation-image'
stash name: 'invocation-image', includes: 'invocation-image.tar'
stash name: 'invocation-image', includes: './_build/invocation-image.tar'
}
}
post {
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile.baguette
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ pipeline {
sh 'make -f docker.Makefile save-invocation-image'
}
dir('/tmp') {
stash name: 'invocation-image', includes: 'invocation-image-*.tar'
archiveArtifacts 'invocation-image-*.tar'
stash name: 'invocation-image', includes: './_build/invocation-image-*.tar'
archiveArtifacts './_build/invocation-image-*.tar'
}
dir('src/github.com/docker/app') {
sh 'make -f docker.Makefile clean-invocation-image'
Expand Down
7 changes: 4 additions & 3 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ E2E_CROSS_CTNR_NAME := $(BIN_NAME)-e2e-cross-$(TAG)
COV_CTNR_NAME := $(BIN_NAME)-cov-$(TAG)
SCHEMAS_CTNR_NAME := $(BIN_NAME)-schemas-$(TAG)


BUILD_ARGS=--build-arg=EXPERIMENTAL=$(EXPERIMENTAL) --build-arg=TAG=$(TAG) --build-arg=COMMIT=$(COMMIT)

PKG_PATH := /go/src/$(PKG_NAME)

CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(TAG)

CNAB_BASE_INVOCATION_IMAGE_PATH := /tmp/invocation-image-$(TAG).tar
CNAB_BASE_INVOCATION_IMAGE_PATH := ./_build/invocation-image-$(TAG).tar
RM := rm
ifeq ($(OS),Windows_NT)
CNAB_BASE_INVOCATION_IMAGE_PATH := c:\tmp\invocation-image-$(TAG).tar
CNAB_BASE_INVOCATION_IMAGE_PATH := .\_build\invocation-image-$(TAG).tar
RM := del
endif

Expand Down Expand Up @@ -109,9 +108,11 @@ invocation-image:
docker build $(BUILD_ARGS) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME) .

save-invocation-image: invocation-image
@$(call mkdir,_build)
docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME) -o $(CNAB_BASE_INVOCATION_IMAGE_PATH)

load-invocation-image:
@$(call mkdir,_build)
docker load -i $(CNAB_BASE_INVOCATION_IMAGE_PATH)
$(RM) $(CNAB_BASE_INVOCATION_IMAGE_PATH)

Expand Down

0 comments on commit c10d616

Please sign in to comment.