3 # Copyright 2017 Sandvine
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
18 # - Michael Marchetti - mmarchetti@sandvine.com
21 HERE=$(realpath $(dirname $0))
22 OSM_JENKINS=$(dirname $HERE)
23 . $OSM_JENKINS/common/all_funcs
25 # SET YOU MDG repository name here
26 export OSM_MDG=osmclient
30 if [ "$1" = "--notest" ]; then
38 apt-get install -y docker.io
40 # cleanup all pre-existing builds.
41 # deb pkg build fails if previous build image is present
44 docker build -t $OSM_MDG .
45 DOCKER_ARGS="-v $(pwd):$(pwd) -w $(pwd) -u $(id -u):$(id -g) $OSM_MDG"
47 if [ -n "$NOTEST" ]; then
48 docker run $DOCKER_ARGS /bin/bash -c "./docker_command.sh $(id -u -n) $(id -g -n) tox"
51 docker run $DOCKER_ARGS /bin/bash -c "./docker_command.sh $(id -u -n) $(id -g -n) tox -e build"