Skip to content

Commit

Permalink
[SDFAB-1180] Allow to build fabric-tna when behind proxy (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-moro authored May 10, 2022
1 parent a33fb69 commit 5376d8c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ SDE_VER_ := $(shell echo $(SDE_VERSION) | tr . _)
# local ~/.m2 directory using the MVN_CACHE env.
MVN_CACHE_DOCKER_VOLUME := mvn-cache-$(DIR_SHA)
MVN_CACHE ?= $(MVN_CACHE_DOCKER_VOLUME)
# By default use the maven settings in local ~/.m2, but allow passing a custom
# settings.
MVN_SETTINGS ?= $(shell test -f ~/.m2/settings.xml && echo "$${HOME}/.m2/settings.xml")
MVN_FLAGS ?=

ONOS_HOST ?= localhost
Expand Down Expand Up @@ -94,14 +97,18 @@ constants:

_m2_vol:
docker volume create --opt o=uid=$(UID) --opt device=tmpfs --opt type=tmpfs $(MVN_CACHE_DOCKER_VOLUME)
ifneq ($(MVN_SETTINGS),)
$(eval MVN_SETTINGS_MOUNT := -v $(MVN_SETTINGS):/.m2/settings.xml)
endif

_mvn_package: _m2_vol
$(info *** Building ONOS app...)
@mkdir -p target
docker run --rm -v $(DIR):/mvn-src -w /mvn-src --user $(UID) \
-e MAVEN_OPTS=-Dmaven.repo.local=/.m2 \
-e MAVEN_CONFIG=/.m2 \
-v $(MVN_CACHE):/.m2 $(MAVEN_DOCKER_IMAGE) mvn $(MVN_FLAGS) clean package
-v $(MVN_CACHE):/.m2 \
$(MVN_SETTINGS_MOUNT) $(MAVEN_DOCKER_IMAGE) mvn $(MVN_FLAGS) clean package

pipeconf: _mvn_package
$(info *** ONOS pipeconf .oar package created succesfully)
Expand All @@ -112,15 +119,17 @@ pipeconf-test: _mvn_package
docker run --rm -v $(DIR):/mvn-src -w /mvn-src --user $(UID) \
-e MAVEN_OPTS=-Dmaven.repo.local=/.m2 \
-e MAVEN_CONFIG=/.m2 \
-v $(MVN_CACHE):/.m2 $(MAVEN_DOCKER_IMAGE) mvn test
-v $(MVN_CACHE):/.m2 \
$(MVN_SETTINGS_MOUNT) $(MAVEN_DOCKER_IMAGE) mvn test

pipeconf-ci: _m2_vol
$(info *** Building ONOS app...)
@mkdir -p target
docker run --rm -v $(DIR):/mvn-src -w /mvn-src --user $(UID) \
-e MAVEN_OPTS=-Dmaven.repo.local=/.m2 \
-e MAVEN_CONFIG=/.m2 \
-v $(MVN_CACHE):/.m2 $(MAVEN_DOCKER_IMAGE) mvn $(MVN_FLAGS) clean package verify
-v $(MVN_CACHE):/.m2 \
$(MVN_SETTINGS_MOUNT) $(MAVEN_DOCKER_IMAGE) mvn $(MVN_FLAGS) clean package verify

_pipeconf-oar-exists:
@test -f $(PIPECONF_OAR_FILE) || (echo "pipeconf .oar not found" && exit 1)
Expand Down

0 comments on commit 5376d8c

Please sign in to comment.