Skip to content

Commit

Permalink
Prevent Jenkins build from cleaning baseimage
Browse files Browse the repository at this point in the history
Jenkins build runs 'make dist-clean' before it begins the build
process. This has the unfortunate side effect of deleting the
fabric-baseimage docker image in the local repository. Hence,
while we enhanced the make targets so that we could leverage
a baseimage previously built, it is not benefiting CI.

Added a 'scrub' target that does clean the baseimage, and
removed 'base' from the set of image targets cleaned, normally.

Fixes FAB-255

Change-Id: Ib9087211e30e2cf74c8a69caf26370c9fc57e60d
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
  • Loading branch information
christo4ferris committed Aug 30, 2016
1 parent d40a004 commit 84d1234
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
# - gotools - installs go tools like golint
# - linter - runs all code checks
# - images[-clean] - ensures all docker images are available[/cleaned]
# - images-scrub - ensures all docker images are cleaned including fabric-baseimage
# - peer-image[-clean] - ensures the peer-image is available[/cleaned] (for behave, etc)
# - membersrvc-image[-clean] - ensures the membersrvc-image is available[/cleaned] (for behave, etc)
# - protos - generate all protobuf artifacts based on .proto files
# - node-sdk - builds the node.js client sdk
# - node-sdk-unit-tests - runs the node.js client sdk unit tests
# - clean - cleans the build area
# - dist-clean - superset of 'clean' that also removes persistent state
# - dist-scrub - superset of 'clean' that also removes fabric-baseimage

PROJECT_NAME = hyperledger/fabric
BASE_VERSION = 0.6.0
Expand Down Expand Up @@ -69,8 +71,8 @@ BASEIMAGE_DEPS = $(shell git ls-files images/base scripts/provision)

JAVASHIM_DEPS = $(shell git ls-files core/chaincode/shim/java)
PROJECT_FILES = $(shell git ls-files)
IMAGES = base src ccenv peer membersrvc javaenv

SUBIMAGES = src ccenv peer membersrvc javaenv
IMAGES = base $(SUBIMAGES)

all: peer membersrvc checks

Expand Down Expand Up @@ -245,7 +247,9 @@ src-image-clean: ccenv-image-clean peer-image-clean membersrvc-image-clean
-docker images -q $(PROJECT_NAME)-$(TARGET) | xargs -r docker rmi -f
-@rm -rf build/image/$(TARGET) ||:

images-clean: $(patsubst %,%-image-clean, $(IMAGES))
images-clean: $(patsubst %,%-image-clean, $(SUBIMAGES))

images-scrub: $(patsubst %,%-image-clean, $(IMAGES))

node-sdk: sdk/node

Expand All @@ -258,6 +262,9 @@ $(SUBDIRS:=-clean):

.PHONY: clean
clean: images-clean $(filter-out gotools-clean, $(SUBDIRS:=-clean))

.PHONY: scrub
scrub: images-scrub $(filter-out gotools-clean, $(SUBDIRS:=-clean))
-@rm -rf build ||:

.PHONY: dist-clean
Expand Down

0 comments on commit 84d1234

Please sign in to comment.