Adding cover to tox.ini default envs
[osm/RO.git] / test-docker / test-gen-local.sh
1 #!/bin/bash
2
3 ##
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15 #
16 # For those usages not covered by the Apache License, Version 2.0 please
17 # contact with: nfvlabs@tid.es
18 ##
19
20 # Generates a docker image base on Dockerfile-local and update a running docker stack with the generated image
21
22 HERE=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
23 export RO_BASE=$(dirname $HERE)
24
25 echo -e "\n\n[STAGE 1] Building docker image opensourcemano/ro:py3_local based on debian packages"
26 docker build $RO_BASE -f $RO_BASE/Dockerfile-local -t opensourcemano/ro:py3_local ||
27 ! echo "error generating local dockerfile" >&2 || exit 1
28 sleep 2
29 docker service update osm_ro --force --image opensourcemano/ro:py3_local
30 sleep 2
31 docker container prune -f
32 docker service logs osm_ro