Skip to content

Commit 84d1234

Browse files
Prevent Jenkins build from cleaning baseimage
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 <[email protected]>
1 parent d40a004 commit 84d1234

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Makefile

+10-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
# - gotools - installs go tools like golint
2929
# - linter - runs all code checks
3030
# - images[-clean] - ensures all docker images are available[/cleaned]
31+
# - images-scrub - ensures all docker images are cleaned including fabric-baseimage
3132
# - peer-image[-clean] - ensures the peer-image is available[/cleaned] (for behave, etc)
3233
# - membersrvc-image[-clean] - ensures the membersrvc-image is available[/cleaned] (for behave, etc)
3334
# - protos - generate all protobuf artifacts based on .proto files
3435
# - node-sdk - builds the node.js client sdk
3536
# - node-sdk-unit-tests - runs the node.js client sdk unit tests
3637
# - clean - cleans the build area
3738
# - dist-clean - superset of 'clean' that also removes persistent state
39+
# - dist-scrub - superset of 'clean' that also removes fabric-baseimage
3840

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

7072
JAVASHIM_DEPS = $(shell git ls-files core/chaincode/shim/java)
7173
PROJECT_FILES = $(shell git ls-files)
72-
IMAGES = base src ccenv peer membersrvc javaenv
73-
74+
SUBIMAGES = src ccenv peer membersrvc javaenv
75+
IMAGES = base $(SUBIMAGES)
7476

7577
all: peer membersrvc checks
7678

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

248-
images-clean: $(patsubst %,%-image-clean, $(IMAGES))
250+
images-clean: $(patsubst %,%-image-clean, $(SUBIMAGES))
251+
252+
images-scrub: $(patsubst %,%-image-clean, $(IMAGES))
249253

250254
node-sdk: sdk/node
251255

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

259263
.PHONY: clean
260264
clean: images-clean $(filter-out gotools-clean, $(SUBDIRS:=-clean))
265+
266+
.PHONY: scrub
267+
scrub: images-scrub $(filter-out gotools-clean, $(SUBDIRS:=-clean))
261268
-@rm -rf build ||:
262269

263270
.PHONY: dist-clean

0 commit comments

Comments
 (0)