Skip to content

Commit

Permalink
FAB-12044 javaenv-docker to pull javaenv images
Browse files Browse the repository at this point in the history
Add javaenv-docker image tag to pull javaenv images with "BASE_VERSION-stable"
image tag and re-tag them to "amd64-latest". Also, update cleanup script
to delete the pulled javaenv image from nexus.

Change-Id: Ie2f6d72b1c97fa61a7a2b12f3c3ffb49d1a6e0e4
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
  • Loading branch information
rameshthoomu committed Sep 18, 2018
1 parent e6bdd23 commit d4fa156
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# - enable_ci_only_tests - triggers unit-tests in downstream jobs. Applicable only for CI not to
# use in the local machine.
# - docker-thirdparty - pulls thirdparty images (kafka,zookeeper,couchdb)
# - javaenv-docker - pulls javaenv image from nexus and re-tags to amd64-latest tag
# - docker-tag-latest - re-tags the images made by 'make docker' with the :latest tag
# - docker-tag-stable - re-tags the images made by 'make docker' with the :stable tag
# - help-docs - generate the command reference docs
Expand All @@ -60,6 +61,7 @@ endif
EXPERIMENTAL ?= true

BUILD_DIR ?= .build
NEXUS_REPO = nexus3.hyperledger.org:10001/hyperledger

ifeq ($(EXPERIMENTAL),true)
GO_TAGS += experimental
Expand Down Expand Up @@ -138,6 +140,13 @@ docker-thirdparty:
docker pull $(BASE_DOCKER_NS)/fabric-kafka:$(BASE_DOCKER_TAG)
docker tag $(BASE_DOCKER_NS)/fabric-kafka:$(BASE_DOCKER_TAG) $(DOCKER_NS)/fabric-kafka

# Pull javenv docker image based on the stable version published to nexus
.PHONY: javaenv-docker
javaenv-docker:
docker pull $(NEXUS_REPO)/fabric-javaenv:$(STABLE_TAG)
docker tag $(NEXUS_REPO)/fabric-javaenv:$(STABLE_TAG) $(DOCKER_NS)/fabric-javaenv
docker tag $(NEXUS_REPO)/fabric-javaenv:$(STABLE_TAG) $(DOCKER_NS)/fabric-javaenv:$(ARCH)-latest

.PHONY: spelling
spelling:
@scripts/check_spelling.sh
Expand Down Expand Up @@ -184,10 +193,10 @@ testenv: $(BUILD_DIR)/image/testenv/$(DUMMY)
ccenv: $(BUILD_DIR)/image/ccenv/$(DUMMY)

.PHONY: integration-test
integration-test: gotool.ginkgo ccenv docker-thirdparty
integration-test: gotool.ginkgo javaenv-docker ccenv docker-thirdparty
./scripts/run-integration-tests.sh

unit-test: unit-test-clean peer-docker testenv ccenv
unit-test: unit-test-clean peer-docker javaenv-docker testenv ccenv
cd unit-test && docker-compose up --abort-on-container-exit --force-recreate && docker-compose down

unit-tests: unit-test
Expand Down Expand Up @@ -420,6 +429,7 @@ docker-list: $(patsubst %,%-docker-list, $(IMAGES))
%-docker-clean:
$(eval TARGET = ${patsubst %-docker-clean,%,${@}})
-docker images --quiet --filter=reference='$(DOCKER_NS)/fabric-$(TARGET):$(ARCH)-$(BASE_VERSION)$(if $(EXTRA_VERSION),-snapshot-*,)' | xargs docker rmi -f
-docker rmi -f $(NEXUS_REPO)/fabric-javaenv:$(STABLE_TAG)
-@rm -rf $(BUILD_DIR)/image/$(TARGET) ||:

docker-clean: $(patsubst %,%-docker-clean, $(IMAGES))
Expand Down
2 changes: 2 additions & 0 deletions docker-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ DBUILD = docker build $(DOCKER_BUILD_FLAGS)
BASE_DOCKER_NS ?= hyperledger
BASE_DOCKER_TAG=$(ARCH)-$(BASEIMAGE_RELEASE)

STABLE_TAG=$(ARCH)-$(BASE_VERSION)-stable

DOCKER_NS ?= hyperledger
DOCKER_TAG=$(ARCH)-$(PROJECT_VERSION)
PREV_TAG=$(ARCH)-$(PREV_VERSION)
Expand Down

0 comments on commit d4fa156

Please sign in to comment.