Merge "Add conditional proxy values to Makefile"
This commit is contained in:
commit
8f7af62100
16
Makefile
16
Makefile
@ -18,6 +18,9 @@ IMAGE_PREFIX ?= attcomdev
|
|||||||
IMAGE_TAG ?= ocata
|
IMAGE_TAG ?= ocata
|
||||||
HELM ?= helm
|
HELM ?= helm
|
||||||
LABEL ?= commit-id
|
LABEL ?= commit-id
|
||||||
|
PROXY ?= http://proxy.foo.com:8000
|
||||||
|
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||||
|
USE_PROXY ?= false
|
||||||
|
|
||||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
|
|
||||||
@ -43,7 +46,18 @@ dry-run: clean
|
|||||||
# Make targets intended for use by the primary targets above.
|
# Make targets intended for use by the primary targets above.
|
||||||
.PHONY: build_$(IMAGE_NAME)
|
.PHONY: build_$(IMAGE_NAME)
|
||||||
build_$(IMAGE_NAME):
|
build_$(IMAGE_NAME):
|
||||||
docker build -t $(IMAGE) --label $(LABEL) -f Dockerfile .
|
|
||||||
|
ifeq ($(USE_PROXY), true)
|
||||||
|
docker build --network host -t $(IMAGE) --label $(LABEL) -f Dockerfile \
|
||||||
|
--build-arg http_proxy=$(PROXY) \
|
||||||
|
--build-arg https_proxy=$(PROXY) \
|
||||||
|
--build-arg HTTP_PROXY=$(PROXY) \
|
||||||
|
--build-arg HTTPS_PROXY=$(PROXY) \
|
||||||
|
--build-arg no_proxy=$(NO_PROXY) \
|
||||||
|
--build-arg NO_PROXY=$(NO_PROXY) .
|
||||||
|
else
|
||||||
|
docker build --network host -t $(IMAGE) --label $(LABEL) -f Dockerfile .
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
1
tox.ini
1
tox.ini
@ -5,6 +5,7 @@ skipsdist = True
|
|||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user