Update gate for Ubuntu 18.04 and proxy

- Remove apt conf for proxy, rely on environment
- Update schema to correctly support no_proxy
- Update build-image stage to support a proxy

Change-Id: Ie07a72ad35fde57596af88f838c8c1836b1e8510
This commit is contained in:
Scott Hussey 2018-04-24 13:40:38 -05:00
parent c1e7a74c1e
commit c52027332f
4 changed files with 24 additions and 9 deletions

View File

@ -102,7 +102,7 @@ data:
additional_no_proxy:
type: array
items:
$ref: '#/definitions/hostname_or_ip_address'
type: 'string'
url:
$ref: '#/definitions/url'
required:

View File

@ -1,5 +0,0 @@
# Generated by Promenade
{% if config['KubernetesNetwork:proxy.url'] is defined -%}
Acquire::http::Proxy "{{ config['KubernetesNetwork:proxy.url'] }}";
Acquire::https::Proxy "{{ config['KubernetesNetwork:proxy.url'] }}";
{% endif -%}

View File

@ -4,8 +4,28 @@ set -e
source "${GATE_UTILS}"
CONFIG_PROXY=${HTTP_PROXY:-}
log Building docker image "${IMAGE_PROMENADE}"
docker build -q -t "${IMAGE_PROMENADE}" "${WORKSPACE}"
if [[ -z "$CONFIG_PROXY" ]]
then
docker build -q \
--network host \
-t "${IMAGE_PROMENADE}" \
"${WORKSPACE}"
else
docker build -q \
--network host \
-t "${IMAGE_PROMENADE}" \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg NO_PROXY=${NO_PROXY} \
--build-arg http_proxy=${http_proxy} \
--build-arg https_proxy=${https_proxy} \
--build-arg no_proxy=${no_proxy} \
"${WORKSPACE}"
fi
log Loading Promenade image "${IMAGE_PROMENADE}" into local registry
docker tag "${IMAGE_PROMENADE}" "localhost:5000/${IMAGE_PROMENADE}" &>> "${LOG_FILE}"

View File

@ -32,9 +32,9 @@ sudo apt-get install -q -y --no-install-recommends \
virtinst
log_stage_header "Joining User Groups"
for grp in docker libvirtd; do
for grp in docker libvirtd libvirt; do
if ! groups | grep $grp > /dev/null; then
sudo adduser "$(id -un)" $grp
sudo adduser "$(id -un)" $grp || echo "Group $grp not found, not added to user"
REQUIRE_RELOG=1
fi
done