projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work around version conflicts between Rift and Ubuntu archives
[osm/devops.git]
/
jenkins
/
host
/
start_build
diff --git
a/jenkins/host/start_build
b/jenkins/host/start_build
index
06ce3a6
..
45d495f
100755
(executable)
--- a/
jenkins/host/start_build
+++ b/
jenkins/host/start_build
@@
-1,5
+1,6
@@
#!/bin/bash
# Copyright 2016 RIFT.IO Inc
#!/bin/bash
# Copyright 2016 RIFT.IO Inc
+# Copyright 2016 Telefónica Investigación y Desarrollo S.A.U.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@
-16,36
+17,45
@@
# start-build is run on a host to start a MDG build
#
# 24 June 2016 -- Jeremy Mordkoff -- Genesis
# start-build is run on a host to start a MDG build
#
# 24 June 2016 -- Jeremy Mordkoff -- Genesis
+# -- Gerardo Garcia
HERE=$(realpath $(dirname $0))
OSM_JENKINS=$(dirname $HERE)
. $OSM_JENKINS/common/all_funcs
HERE=$(realpath $(dirname $0))
OSM_JENKINS=$(dirname $HERE)
. $OSM_JENKINS/common/all_funcs
-[ $# -
eq 1 ] ||
FATAL "arg is MDG name"
+[ $# -
lt 1 ] &&
FATAL "arg is MDG name"
export OSM_MDG=$1
export OSM_MDG=$1
+shift
OSM_load_config
if ! container_exists $OSM_BUILD_CONTAINER; then
OSM_load_config
if ! container_exists $OSM_BUILD_CONTAINER; then
- if [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]]; then
- create_privileged_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER
- else
- create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER
- fi
+ CONTAINER_OPTS=""
+ [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
+ [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
+ create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
wait_container_up $OSM_BUILD_CONTAINER
RE="fedora|fc[0-9]"
if [[ $OSM_BASE_IMAGE =~ $RE ]]; then
wait_container_up $OSM_BUILD_CONTAINER
RE="fedora|fc[0-9]"
if [[ $OSM_BASE_IMAGE =~ $RE ]]; then
- container_exec $OSM_BUILD_CONTAINER yum -y install git
+ container_exec $OSM_BUILD_CONTAINER yum -y install git tar make sudo
+ else
+ container_exec $OSM_BUILD_CONTAINER apt -y install git realpath make sudo
+ fi
+ if [ ${OSM_USE_LOCAL_DEVOPS:-false} ]; then
+ container_push_devops $OSM_BUILD_CONTAINER
else
else
- container_exec $OSM_BUILD_CONTAINER
apt -y install git realpath
+ container_exec $OSM_BUILD_CONTAINER
git clone ${OSM_GIT_URL}/devops
fi
fi
- container_exec $OSM_BUILD_CONTAINER git clone ${OSM_GIT_URL}/devops
else
else
- container_exec $OSM_BUILD_CONTAINER git -C devops pull
+ if [ ${OSM_USE_LOCAL_DEVOPS:-false} ]; then
+ container_push_devops $OSM_BUILD_CONTAINER
+ else
+ container_exec $OSM_BUILD_CONTAINER git -C devops pull
+ fi
fi
fi
-container_exec $OSM_BUILD_CONTAINER ./devops/jenkins/$OSM_MDG/start_build
+container_exec $OSM_BUILD_CONTAINER ./devops/jenkins/$OSM_MDG/start_build
$*
RC=$?
INFO "$OSM_MDG build complete. Return code was $RC"
exit $RC
RC=$?
INFO "$OSM_MDG build complete. Return code was $RC"
exit $RC