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 # downloading DCAE Controller service manager for VES collector
14 DCM_AR="${WORKSPACE}/manager.zip"
15 if [ ! -f "${DCM_AR}" ]
17 echo "FATAL error cannot locate ${DCM_AR}"
21 # unarchive the service manager
22 TARGET="${WORKSPACE}/target"
23 STAGE="${TARGET}/stage"
24 DCM_DIR="${STAGE}/opt/app/manager"
25 [ ! -d "${DCM_DIR}" ] && mkdir -p "${DCM_DIR}"
26 unzip -qo -d "${DCM_DIR}" "${DCM_AR}"
29 # generate the manager start-up.sh
31 [ -f "${DCM_DIR}/start-manager.sh" ] && exit 0
33 cat <<EOF > "${DCM_DIR}/start-manager.sh"
36 MAIN='org.openecomp.dcae.controller.service.standardeventcollector.servers.manager.DcaeControllerServiceStandardeventcollectorManagerServer'
39 WORKDIR='/opt/app/manager'
40 LOGS="${WORKDIR}/logs"
42 [ ! -d "$LOGS" ] && mkdir -p "$LOGS"
44 echo 10.0.4.102 $(hostname).dcae.simpledemo.openecomp.org >> /etc/hosts
46 exec java -cp ./config:./lib:./lib/*:./bin "${MAIN}" "${ACTION}" \
47 > logs/manager.out 2>logs/manager.err
50 chmod 775 "${DCM_DIR}/start-manager.sh"
54 # generate docker file
56 cat <<EOF > "${STAGE}/Dockerfile"
59 MAINTAINER dcae@lists.openecomp.org
61 WORKDIR /opt/app/manager
66 RUN apt-get update && apt-get install -y \
78 CMD [ '/opt/app/manager/start-manager.sh' ]
82 # build the docker image. tag and then push to the remote repo
84 IMAGE='dcae-controller-common-event'
86 LFQI="${IMAGE}:${TAG}"
87 BUILD_PATH="${WORKSPACE}/target/stage"
89 # build a docker image
90 docker build --rm -t "${LFQI}" "${BUILD_PATH}"
96 # io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
97 # release registry nexus3.openecomp.org:10002 \
98 # snapshot registry nexus3.openecomp.org:10003"
99 REPO='nexus3.openecomp.org:10003'
101 if [ ! -z "$REPO" ]; then
102 RFQI="${REPO}/${LFQI}"
104 docker tag "${LFQI}" "${RFQI}"
106 # push to remote repo
107 docker push "${RFQI}"