summaryrefslogtreecommitdiffstats
path: root/jjb/dcae/script-collectors-ves-verify.sh
diff options
context:
space:
mode:
authorlj1412 <lji@research.att.com>2017-02-20 03:25:58 +0000
committerLusheng Ji <lji@research.att.com>2017-02-20 18:49:50 +0000
commit0555df3e1870977d8c0c1e0d9b73d79bd43dd71a (patch)
tree200e18ca4c89cf121d1f16753ff173a35cec3e8b /jjb/dcae/script-collectors-ves-verify.sh
parent596787c9792b1537904df3424a6eecbfe1035626 (diff)
ves collector related
Change-Id: I0dd9f6f083b567b8230c68b18406d9566e8b2f05 Signed-off-by: lj1412 <lji@research.att.com>
Diffstat (limited to 'jjb/dcae/script-collectors-ves-verify.sh')
-rwxr-xr-xjjb/dcae/script-collectors-ves-verify.sh114
1 files changed, 114 insertions, 0 deletions
diff --git a/jjb/dcae/script-collectors-ves-verify.sh b/jjb/dcae/script-collectors-ves-verify.sh
new file mode 100755
index 000000000..b39efbe8f
--- /dev/null
+++ b/jjb/dcae/script-collectors-ves-verify.sh
@@ -0,0 +1,114 @@
+#!/bin/bash
+#
+#
+# 1 fetch DCAE Controller service manager
+# 2 build the docker imagei with both service manager and ves collector
+# 3 tag and then push to the remote repo
+#
+#
+# !!! make sure the yaml jjb file includes docker-login as a builder
+# before calling this script
+
+
+# io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
+# release registry nexus3.openecomp.org:10002 \
+# snapshot registry nexus3.openecomp.org:10003"
+
+
+
+# downloading DCAE Controller service manager for VES collector
+GROUP_ID='org.openecomp.dcae.controller'
+ARTIFACT_ID='dcae-controller-service-standardeventcollector-manager'
+VERSION='0.1.0-SNAPSHOT'
+FORMAT='zip'
+SCOPE='runtime'
+ARTIFACT_FQID="${GROUP_ID}:${ARTIFACT_ID}:${VERSION}:${FORMAT}:${SCOPE}"
+ARTIFACT_FILENAME="${ARTIFACT_ID}-${VERSION}-${SCOPE}.${FORMAT}"
+mvn -s "$SETTINGS_FILE" \
+ org.apache.maven.plugins:maven-dependency-plugin:2.10:copy \
+ -Dartifact="${ARTIFACT_FQID}" -DoutputDirectory=/tmp
+DCM_AR="/tmp/${ARTIFACT_FILENAME}"
+if [ ! -f "${DCM_AR}" ]
+then
+ echo "FATAL error cannot locate ${DCM_AR}"
+ exit 2
+fi
+
+# unarchive the service manager
+TARGET="${WORKSPACE}/target"
+STAGE="${TARGET}/stage"
+DCM_DIR="${STAGE}/opt/app/manager"
+[ ! -d "${DCM_DIR}" ] && mkdir -p "${DCM_DIR}"
+unzip -qo -d "${DCM_DIR}" "${DCM_AR}"
+
+#
+# generate the manager start-up.sh
+#
+[ -f "${DCM_DIR}/start-manager.sh" ] && exit 0
+
+cat <<EOF > "${DCM_DIR}/start-manager.sh"
+#!/bin/bash
+
+MAIN='org.openecomp.dcae.controller.service.standardeventcollector.servers.manager.DcaeControllerServiceStandardeventcollectorManagerServer'
+ACTION='start'
+
+WORKDIR='/opt/app/manager'
+LOGS="${WORKDIR}/logs"
+
+[ ! -d "$LOGS" ] && mkdir -p "$LOGS"
+
+echo 10.0.4.102 $(hostname).dcae.simpledemo.openecomp.org >> /etc/hosts
+
+exec java -cp ./config:./lib:./lib/*:./bin "${MAIN}" "${ACTION}" \
+ > logs/manager.out 2>logs/manager.err
+EOF
+
+chmod 775 "${DCM_DIR}/start-manager.sh"
+
+
+#
+# generate docker file
+#
+cat <<EOF > "${STAGE}/Dockerfile"
+FROM ubuntu:14.04
+
+MAINTAINER dcae@lists.openecomp.org
+
+WORKDIR /opt/app/manager
+
+ENV HOME /opt/app/SEC
+ENV JAVA_HOME /usr
+
+RUN apt-get update && apt-get install -y \
+ bc \
+ curl \
+ telnet \
+ vim \
+ netcat \
+ openjdk-7-jdk
+
+COPY opt /opt
+
+EXPOSE 9999
+
+CMD [ '/opt/app/manager/start-manager.sh' ]
+EOF
+
+#
+# build the docker image. tag and then push to the remote repo
+#
+IMAGE='dcae-controller-common-event'
+TAG='1.0.0'
+LFQI="${IMAGE}:${TAG}"
+BUILD_PATH="${WORKSPACE}/target/stage"
+
+# build a docker image
+docker build --rm -t "${LFQI}" "${BUILD_PATH}"
+
+
+#
+# push the image
+#
+# io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
+# release registry nexus3.openecomp.org:10002 \
+# snapshot registry nexus3.openecomp.org:10003" \ No newline at end of file