aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2019-06-26 06:31:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-06-26 06:31:57 +0000
commitaf7cd29970cf56cd8e0a0fc697022933bce652e7 (patch)
tree4515d0f3ad7660713dfa513848b133ee8a126af3
parentb4a1423c7dae5032bb062610224bffe5a9c13da2 (diff)
parent8b604e60a3bb1c2943ff716ce57ab6c891b069c4 (diff)
Merge "Set proxies in Cloudify container" into stable/iruya
-rw-r--r--functest/ci/add_proxy.sh56
1 files changed, 39 insertions, 17 deletions
diff --git a/functest/ci/add_proxy.sh b/functest/ci/add_proxy.sh
index 3244f246a..f815ef09b 100644
--- a/functest/ci/add_proxy.sh
+++ b/functest/ci/add_proxy.sh
@@ -4,28 +4,32 @@ set -e
pushd "${1:-/home/opnfv/functest/images}" > /dev/null
+http_proxy=${http_proxy:-http://proxy:8080}
+https_proxy=${https_proxy:-${http_proxy:-http://proxy:8080}}
+ftp_proxy=${ftp_proxy:-${http_proxy:-http://proxy:8080}}
+no_proxy=${no_proxy:-"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
+
images=${images-"\
-cloudify-manager-premium-4.0.1.qcow2 \
ubuntu-14.04-server-cloudimg-amd64-disk1.img \
ubuntu-16.04-server-cloudimg-amd64-disk1.img"}
add_proxy () {
cat << EOF >> "$1"
-http_proxy=${http_proxy:-http://proxy:8080}
-HTTP_PROXY=${http_proxy:-http://proxy:8080}
-https_proxy=${https_proxy:-${http_proxy:-http://proxy:8080}}
-HTTPS_PROXY=${https_proxy:-${http_proxy:-http://proxy:8080}}
-ftp_proxy=${ftp_proxy:-${http_proxy:-http://proxy:8080}}
-FTP_PROXY=${ftp_proxy:-${http_proxy:-http://proxy:8080}}
-no_proxy=${no_proxy:-"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
-NO_PROXY=${no_proxy:-"10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"}
+http_proxy=${http_proxy}
+HTTP_PROXY=${http_proxy}
+https_proxy=${https_proxy}
+HTTPS_PROXY=${https_proxy}
+ftp_proxy=${ftp_proxy}
+FTP_PROXY=${ftp_proxy}
+no_proxy=${no_proxy}
+NO_PROXY=${no_proxy}
EOF
}
add_proxy_apt () {
cat << EOF >> "$1"
-Acquire::http::Proxy "${http_proxy:-http://proxy:8080}";
-Acquire::https::Proxy "${https_proxy:-http://proxy:8080}";
+Acquire::http::Proxy "${http_proxy}";
+Acquire::https::Proxy "${https_proxy}";
EOF
}
@@ -37,17 +41,35 @@ for image in $images; do
fi
guestmount -a "${image}" -i --rw "${tmpdir}"
add_proxy "${tmpdir}/etc/environment"
- if [[ ${image} == *"cloudify-manager"* ]]; then
- echo >> "${tmpdir}/etc/sysconfig/cloudify-mgmtworker"
- add_proxy "${tmpdir}/etc/sysconfig/cloudify-mgmtworker"
- echo >> "${tmpdir}/etc/sysconfig/cloudify-restservice"
- add_proxy "${tmpdir}/etc/sysconfig/cloudify-restservice"
- fi
if [[ ${image} == "ubuntu"* ]]; then
add_proxy_apt "${tmpdir}/etc/apt/apt.conf"
fi
guestunmount "${tmpdir}"
done
+sudo docker load -i cloudify-docker-manager-community-19.01.24.tar
+dockerfile=${tmpdir}/Dockerfile
+cat << EOF > $dockerfile
+FROM docker-cfy-manager:latest
+ENV HTTP_PROXY "${http_proxy}"
+ENV HTTPS_PROXY "${https_proxy}"
+ENV NO_PROXY "${no_proxy}"
+EOF
+for f in /etc/sysconfig/cloudify-mgmtworker /etc/sysconfig/cloudify-restservice; do \
+ cat << EOF >> $dockerfile
+RUN echo >> $f
+RUN echo "http_proxy=${http_proxy}" >> $f
+RUN echo "https_proxy=${https_proxy}" >> $f
+RUN echo "HTTP_PROXY=${http_proxy}" >> $f
+RUN echo "HTTPS_PROXY=${https_proxy}" >> $f
+RUN echo "no_proxy=${no_proxy}" >> $f
+EOF
+done
+sudo docker build -t docker-cfy-manager -f $dockerfile ${tmpdir}
+sudo docker save \
+ docker-cfy-manager > cloudify-docker-manager-community-19.01.24.tar
+sudo docker rmi docker-cfy-manager
+
+rm "${dockerfile}"
rmdir "${tmpdir}"
popd > /dev/null