blob: 0b9c73e9a9a1e35d22fafe00c6bdd3fcd83749cd [file] [log] [blame]
tierno7d782ef2019-10-04 12:56:31 +00001#!/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
22HERE=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
23export RO_BASE=$(dirname $HERE)
24
25echo -e "\n\n[STAGE 1] Building docker image opensourcemano/ro:py3_local based on debian packages"
26docker build $RO_BASE -f $RO_BASE/Dockerfile-local -t opensourcemano/ro:py3_local ||
27 ! echo "error generating local dockerfile" >&2 || exit 1
28sleep 2
29docker service update osm_ro --force --image opensourcemano/ro:py3_local
30sleep 2
31docker container prune -f
32docker service logs osm_ro