diff options
author | 2017-02-22 01:31:31 +0000 | |
---|---|---|
committer | 2017-02-22 01:31:31 +0000 | |
commit | d34bdc524eed752d9e76d5b4c6dbd3ea42bf0ca4 (patch) | |
tree | 273f2ca1d235d8974d1cf5ecfeb87e748c1ffbd7 | |
parent | 0e02120e4197de97f1b9538e8fe026e1144173a7 (diff) | |
parent | c2cc8f476ae1983d3f5c021cc7ef767517878138 (diff) |
Merge "Moved docker build script into DCAE project"
-rw-r--r-- | jjb/dcae/collectors-ves.yaml | 12 | ||||
-rwxr-xr-x | jjb/dcae/script-collectors-ves-daily-release.sh | 108 | ||||
-rwxr-xr-x | jjb/dcae/script-collectors-ves-merge.sh | 108 | ||||
-rwxr-xr-x | jjb/dcae/script-collectors-ves-verify.sh | 104 |
4 files changed, 6 insertions, 326 deletions
diff --git a/jjb/dcae/collectors-ves.yaml b/jjb/dcae/collectors-ves.yaml index 43232cc28..c95f20f85 100644 --- a/jjb/dcae/collectors-ves.yaml +++ b/jjb/dcae/collectors-ves.yaml @@ -27,15 +27,15 @@ mvn-goals: 'clean deploy' maven-deploy-properties: | deployAtEnd=true - script: - !include-raw-escape: 'script-collectors-ves-daily-release.sh' + script: | + bash ./docker-build.sh release - '{project-name}-{stream}-merge-scm-mvn-script': # job specific mvn-goals: 'clean deploy' - script: - !include-raw-escape: 'script-collectors-ves-merge.sh' + script: | + bash ./docker-build.sh merge - '{project-name}-{stream}-verify-scm-mvn-script': # job specific mvn-goals: 'clean install' - script: - !include-raw-escape: 'script-collectors-ves-verify.sh' + script: | + bash ./docker-build.sh verify diff --git a/jjb/dcae/script-collectors-ves-daily-release.sh b/jjb/dcae/script-collectors-ves-daily-release.sh deleted file mode 100755 index 9d99194fc..000000000 --- a/jjb/dcae/script-collectors-ves-daily-release.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/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 - - -# downloading DCAE Controller service manager for VES collector -DCM_AR="${WORKSPACE}/manager.zip" -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" -REPO='nexus3.openecomp.org:10003' - -if [ ! -z "$REPO" ]; then - RFQI="${REPO}/${LFQI}" - # tag - docker tag "${LFQI}" "${RFQI}" - - # push to remote repo - docker push "${RFQI}" -fi diff --git a/jjb/dcae/script-collectors-ves-merge.sh b/jjb/dcae/script-collectors-ves-merge.sh deleted file mode 100755 index ba468473a..000000000 --- a/jjb/dcae/script-collectors-ves-merge.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/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 - - -# DCAE Controller service manager for VES collector -DCM_AR="${WORKSPACE}/manager.zip" -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" -REPO='nexus3.openecomp.org:10003' - -if [ ! -z "$REPO" ]; then - RFQI="${REPO}/${LFQI}" - # tag - docker tag "${LFQI}" "${RFQI}" - - # push to remote repo - docker push "${RFQI}" -fi diff --git a/jjb/dcae/script-collectors-ves-verify.sh b/jjb/dcae/script-collectors-ves-verify.sh deleted file mode 100755 index 08939084a..000000000 --- a/jjb/dcae/script-collectors-ves-verify.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/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" - - - -# DCAE Controller service manager for VES collector -DCM_AR="${WORKSPACE}/manager.zip" -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" |