4 # 1 fetch DCAE Controller service manager
5 # 2 build the docker imagei with both service manager and ves collector
6 # 3 tag and then push to the remote repo
9 # !!! make sure the yaml jjb file includes docker-login as a builder
10 # before calling this script
13 # io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
14 # release registry nexus3.openecomp.org:10002 \
15 # snapshot registry nexus3.openecomp.org:10003"
19 # DCAE Controller service manager for VES collector
20 DCM_AR="${WORKSPACE}/manager.zip"
21 if [ ! -f "${DCM_AR}" ]
23 echo "FATAL error cannot locate ${DCM_AR}"
27 # unarchive the service manager
28 TARGET="${WORKSPACE}/target"
29 STAGE="${TARGET}/stage"
30 DCM_DIR="${STAGE}/opt/app/manager"
31 [ ! -d "${DCM_DIR}" ] && mkdir -p "${DCM_DIR}"
32 unzip -qo -d "${DCM_DIR}" "${DCM_AR}"
35 # generate the manager start-up.sh
37 [ -f "${DCM_DIR}/start-manager.sh" ] && exit 0
39 cat <<EOF > "${DCM_DIR}/start-manager.sh"
42 MAIN='org.openecomp.dcae.controller.service.standardeventcollector.servers.manager.DcaeControllerServiceStandardeventcollectorManagerServer'
45 WORKDIR='/opt/app/manager'
46 LOGS="${WORKDIR}/logs"
48 [ ! -d "$LOGS" ] && mkdir -p "$LOGS"
50 echo 10.0.4.102 $(hostname).dcae.simpledemo.openecomp.org >> /etc/hosts
52 exec java -cp ./config:./lib:./lib/*:./bin "${MAIN}" "${ACTION}" \
53 > logs/manager.out 2>logs/manager.err
56 chmod 775 "${DCM_DIR}/start-manager.sh"
60 # generate docker file
62 cat <<EOF > "${STAGE}/Dockerfile"
65 MAINTAINER dcae@lists.openecomp.org
67 WORKDIR /opt/app/manager
72 RUN apt-get update && apt-get install -y \
84 CMD [ '/opt/app/manager/start-manager.sh' ]
88 # build the docker image. tag and then push to the remote repo
90 IMAGE='dcae-controller-common-event'
92 LFQI="${IMAGE}:${TAG}"
93 BUILD_PATH="${WORKSPACE}/target/stage"
95 # build a docker image
96 docker build --rm -t "${LFQI}" "${BUILD_PATH}"
102 # io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
103 # release registry nexus3.openecomp.org:10002 \
104 # snapshot registry nexus3.openecomp.org:10003"