summaryrefslogtreecommitdiffstats
path: root/dcae-demo-controller/src/main/docker-build/build.sh
blob: 2500aa8558b301700e1d34f52e34bbacd5623964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

set -e
set -x

## ensure we are in the right directory.
cd $(dirname $(readlink -e $0))

ROOT=../../..

## setup files

rm -rf lib/
mkdir -p lib

# copy core controller ZIP file

cp $ROOT/target/assembly/lib/*zip controller.zip
VERSION=$(grep version $ROOT/pom.xml | head -1 | sed 'sX</.*XX' | sed 's/.*>//')

# copy JAR required by controller
cp $ROOT/target/assembly/lib/*.jar lib/

# copy configuration files for controller
( 
  cd $ROOT/..
  tar cfz - OPENECOMP-DEMO OPENECOMP-DEMO-* 
) > config.tar.gz

if [ "$1" == "nobuild" ]; then exit; fi

## build Docker

docker build -t dcae-controller:$VERSION .