30b9a9b71026e98a82540fe4501cde7aa08f364d
[ric-app/mc.git] / sidecars / listener / build_images.sh
1 #!/usr/bin/env bash
2 # vim: ts=4 sw=4 noet:
3
4 #--------------------------------------------------------------------------------
5 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #          http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #--------------------------------------------------------------------------------
19
20 #------------------------------------------------------------------------------------
21 #       Mnemonic:       build_images.sh
22 #       Abstract:       This script will create both the mc_listener runtime and development
23 #                               images when "all" is given on the command line, otherwise it builds
24 #                               just a runtime environment.
25 #       Date:           22 August 2-19
26 #       Author:         E. Scott Daniels
27 # -----------------------------------------------------------------------------------
28
29 skip_dev=1
30 if [[ $1 == "all" ]]
31 then
32         skip_dev=0
33         shift
34 fi
35
36 if [[ $1 == "-?" || $1 == "-h" ]]
37 then
38         echo "usage: $0 [all] [mcl-version-tag [patch-level]]"
39         echo "   using all as first keyword causes both runtime and dev images to build"
40         exit 0
41 fi
42
43
44 ver=${1:-1.3}
45 patch=${2:-0}
46
47 if (( skip_dev == 0 ))
48 then
49         echo "building development image"
50         docker build -f mcl_dev.df -t mcl_dev:$ver.$patch .
51 fi
52
53 # use the main dockerfile for the runtime image
54 echo "building runtime image mc_listener:$ver"
55 if docker build -f Dockerfile -t mc_listener:$ver.$patch .
56 then
57         echo "build finished"
58         echo ""
59         docker images|grep mc_
60 fi
61