projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update install_osm.sh to solve the issue with no valid OpenPGP data found
[osm/devops.git]
/
tools
/
local-build.sh
diff --git
a/tools/local-build.sh
b/tools/local-build.sh
index
f471e03
..
9c40272
100755
(executable)
--- a/
tools/local-build.sh
+++ b/
tools/local-build.sh
@@
-16,9
+16,10
@@
# limitations under the License.
#######################################################################################
# limitations under the License.
#######################################################################################
+APT_PROXY=""
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
HTTPDDIR="$( cd "${HOME}/snap/qhttp/common" &> /dev/null && pwd )"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
HTTPDDIR="$( cd "${HOME}/snap/qhttp/common" &> /dev/null && pwd )"
-HTTPPORT=
1148
0
+HTTPPORT=
800
0
KUBECFG="~/.osm/microk8s-config.yaml"
NO_CACHE=""
OPENSTACKRC="/var/snap/microstack/common/etc/microstack.rc"
KUBECFG="~/.osm/microk8s-config.yaml"
NO_CACHE=""
OPENSTACKRC="/var/snap/microstack/common/etc/microstack.rc"
@@
-30,6
+31,7
@@
function check_arguments(){
while [ $# -gt 0 ] ; do
case $1 in
--debug) set -x ;;
while [ $# -gt 0 ] ; do
case $1 in
--debug) set -x ;;
+ --apt-proxy) APT_PROXY="$2" && shift ;;
--help | -h) show_help && exit 0 ;;
--httpddir) HTTPDIR="$2" && shift;;
--install-local-registry) 'install_local_registry' ;;
--help | -h) show_help && exit 0 ;;
--httpddir) HTTPDIR="$2" && shift;;
--install-local-registry) 'install_local_registry' ;;
@@
-67,8
+69,9
@@
same process as Jenkins.
OPTIONS:
--help display this help message
OPTIONS:
--help display this help message
+ --apt-proxy provide an apt proxy to docker build steps
--debug enable set -x for this script
--debug enable set -x for this script
- --install-local-registry install and enable Microk8s local registry on port 32000
+ --install-local-registry
install and enable Microk8s local registry on port 32000
--install-microstack install Microstack and configure to run robot tests
--install-qhttpd install QHTTPD as an HTTP server on port ${HTTPPORT}
--kubecfg path to kubecfg.yaml (uses Charmed OSM by default)
--install-microstack install Microstack and configure to run robot tests
--install-qhttpd install QHTTPD as an HTTP server on port ${HTTPPORT}
--kubecfg path to kubecfg.yaml (uses Charmed OSM by default)
@@
-171,7
+174,12
@@
function stage_2() {
print_section "Building ${MODULE}"
cd ${MODULE}
find . -name '*.deb' -exec rm -v {} \;
print_section "Building ${MODULE}"
cd ${MODULE}
find . -name '*.deb' -exec rm -v {} \;
- docker build ${NO_CACHE} -t ${MODULE,,}-stage2 .
+
+ BUILD_ARGS=""
+ if [ ! -z $APT_PROXY ] ; then
+ BUILD_ARGS="${BUILD_ARGS}--build-arg APT_PROXY=${APT_PROXY} "
+ fi
+ docker build ${NO_CACHE} ${BUILD_ARGS} -t ${MODULE,,}-stage2 .
STAGES="stage-build.sh"
if [ ! -z $TESTS ] ; then
STAGES="stage-build.sh"
if [ ! -z $TESTS ] ; then
@@
-217,6
+225,10
@@
function stage_3() {
print_section "Performing Stage 3"
MODULES=$(_find_module_dockerfile $1)
BUILD_ARGS=""
print_section "Performing Stage 3"
MODULES=$(_find_module_dockerfile $1)
BUILD_ARGS=""
+ if [ ! -z $APT_PROXY ] ; then
+ BUILD_ARGS="${BUILD_ARGS}--build-arg APT_PROXY=${APT_PROXY} "
+ fi
+
HOSTIP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for file in ~/snap/qhttp/common/*.deb ; do
file=`basename ${file}`
HOSTIP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for file in ~/snap/qhttp/common/*.deb ; do
file=`basename ${file}`
@@
-359,7
+371,8
@@
EOF
-v "$(pwd)/robot.etc.hosts":/etc/hosts \
-v ~/.osm/microk8s-config.yaml:/root/.kube/config \
-v "$(pwd)/clouds.yaml":/etc/openstack/clouds.yaml \
-v "$(pwd)/robot.etc.hosts":/etc/hosts \
-v ~/.osm/microk8s-config.yaml:/root/.kube/config \
-v "$(pwd)/clouds.yaml":/etc/openstack/clouds.yaml \
- -v "$(pwd)/reports:"/robot-systest/reports \
+ -v "${HOME}/snap/qhttp/common"/robot-systest/reports \
+ -v "${HOME}/snap/qhttp/common:"/robot-systest/conformance-tests/reports \
-v "${ROOTDIR}/tests/robot-systest/lib":${LOCAL_MOUNT_1} \
-v "${ROOTDIR}/tests/robot-systest/resources":${LOCAL_MOUNT_2} \
-v "${ROOTDIR}/tests/robot-systest/testsuite":${LOCAL_MOUNT_3} \
-v "${ROOTDIR}/tests/robot-systest/lib":${LOCAL_MOUNT_1} \
-v "${ROOTDIR}/tests/robot-systest/resources":${LOCAL_MOUNT_2} \
-v "${ROOTDIR}/tests/robot-systest/testsuite":${LOCAL_MOUNT_3} \