4fe121936e598a7fc40c71983c23feb07d4c82cf
[ric-app/mc.git] / src / 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.
24 #       Date:           22 August 2-19
25 #       Author:         E. Scott Daniels
26 # -----------------------------------------------------------------------------------
27
28 skip_dev=1
29 if [[ $1 == "all" ]]
30 then
31         skip_dev=0
32         shift
33 fi
34
35 if [[ $1 == "-?" || $1 == "-h" ]]
36 then
37         echo "usage: $0 [all] [mcl-version-tag [patch-level]]"
38         echo "   using all as first keyword causes both runtime and dev images to build"
39         exit 0
40 fi
41
42
43 ver=${1:-1.1}
44 patch=${2:-0}
45
46 if (( skip_dev == 0 ))
47 then
48         echo "building development image"
49         docker build -f mcl_dev.df -t mcl_dev:$ver.$patch .
50 fi
51
52 echo "building runtime image mc_listener:$ver"
53 if docker build -f mcl_runtime.df -t mc_listener:$ver.$patch .
54 then
55         echo "build finished"
56         echo ""
57         docker images|grep mc_
58 fi
59