3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # install is run on a host to install a MDG from binaries
19 HERE=$(realpath $(dirname $0))
20 OSM_JENKINS=$(dirname $HERE)
21 . $OSM_JENKINS/common/all_funcs
23 [ $# -lt 1 ] && FATAL "arg is MDG name"
29 if ! container_exists $OSM_BUILD_CONTAINER; then
31 [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
32 [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
33 create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
34 wait_container_up $OSM_BUILD_CONTAINER
35 if [ ${OSM_USE_LOCAL_DEVOPS:-false} != false ]; then
36 container_push_devops $OSM_BUILD_CONTAINER
38 container_exec $OSM_BUILD_CONTAINER git clone ${OSM_GIT_URL}/devops
41 if [ ${OSM_USE_LOCAL_DEVOPS:-false} != false ]; then
42 container_push_devops $OSM_BUILD_CONTAINER
44 container_exec $OSM_BUILD_CONTAINER git -C devops pull
48 container_exec $OSM_BUILD_CONTAINER ./devops/jenkins/$OSM_MDG/install $*
50 INFO "$OSM_MDG install complete. Return code was $RC"