diff options
author | Vijay <vv770d@att.com> | 2017-09-11 02:11:01 +0000 |
---|---|---|
committer | Vijay <vv770d@att.com> | 2017-09-11 16:15:56 +0000 |
commit | e1ab69fa9c80ecfd5ab5bd19da9d67af4e1107fb (patch) | |
tree | 15dc45e7a39f51bc9382653a38ed42fe303089a8 | |
parent | 0f0cfa24a916979a8e500b127bcfbac0b9870ad8 (diff) |
update ves buildscript & fix build error
https://jenkins.onap.org/view/dcagen2/job/dcaegen2-collectors-ves-master-release-version-java-daily/13/console
Change-Id: I21bedaebedd307c792fe7e38f8bc5b2d8875ef06
Issue-Id: DCAEGEN2-82
Signed-off-by: Vijay <vv770d@att.com>
-rw-r--r-- | Dockerfile | 17 | ||||
-rw-r--r-- | docker-build.sh | 87 | ||||
-rw-r--r-- | pom.xml | 60 | ||||
-rw-r--r-- | src/assembly/dep.xml | 8 | ||||
-rw-r--r-- | src/main/scripts/docker-entry.sh | 5 |
5 files changed, 54 insertions, 123 deletions
@@ -1,26 +1,17 @@ FROM ubuntu:16.04 +#FROM dcae-alpine:8-jre-tini MAINTAINER vv770d@att.com WORKDIR /opt/app/manager -#WORKDIR /opt/app/VESCollector +ENV http_proxy http://one.proxy.att.com:8080 +ENV https_proxy http://one.proxy.att.com:8080 ENV HOME /opt/app/VESCollector ENV JAVA_HOME /usr -RUN apt-get update && apt-get install -y \ - bc \ - curl \ - telnet \ - vim \ - netcat \ - openjdk-8-jdk - - COPY opt /opt EXPOSE 9999 8080 8443 -#ENTRYPOINT [ "/usr/bin/tini", "--" ] - -CMD [ "/opt/app/docker-entry.sh" ]
\ No newline at end of file +CMD [ "/opt/app/docker-entry.sh" ] diff --git a/docker-build.sh b/docker-build.sh index b81fb07d..004cf76f 100644 --- a/docker-build.sh +++ b/docker-build.sh @@ -1,6 +1,4 @@ #!/bin/bash - - ### # ============LICENSE_START======================================================= # PROJECT @@ -21,9 +19,7 @@ # ============LICENSE_END========================================================= ### -# -# -# 1 build the docker image with both service manager and ves collector +# 1 build the docker image for ves collector # 2 tag and then push to the remote repo if not verify # @@ -54,21 +50,10 @@ case $phase in esac echo "Running \"$phase\" job for version \"$VERSION\"" - -# 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}" +BASE_DIR="${STAGE}/opt/app" # unarchive the collector AR=${WORKSPACE}/target/VESCollector-${VERSION}-bundle.tar.gz @@ -80,71 +65,33 @@ APP_DIR=${STAGE}/opt/app/VESCollector gunzip -c "${AR}" | tar xvf - -C "${APP_DIR}" --strip-components=1 -# -# 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 -mkdir -p \$LOGS - -cd \$WORKDIR - -echo \$COLLECTOR_IP \$(hostname).dcae.simpledemo.openecomp.org >> /etc/hosts - -if [ ! -e config ]; then - echo no configuration directory setup: \$WORKDIR/config - exit 1 +if [ ! -f "${APP_DIR}/bin/docker-entry.sh" ] +then + echo "FATAL error cannot locate ${APP_DIR}/bin/docker-entry.sh" + exit 2 fi +cp -p ${APP_DIR}/bin/docker-entry.sh ${BASE_DIR}/docker-entry.sh +chmod 755 "${BASE_DIR}/docker-entry.sh" -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/VESCollector -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 +if [ ! -f "${APP_DIR}/Dockerfile" ] +then + echo "FATAL error cannot locate ${APP_DIR}/Dockerfile" + exit 2 +fi +cp -p ${APP_DIR}/Dockerfile ${STAGE}/Dockerfile -CMD [ "/opt/app/manager/start-manager.sh" ] -EOF # # build the docker image. tag and then push to the remote repo # -IMAGE='openecomp/dcae-collector-common-event' +IMAGE='dcaegen2-ves-collector' VERSION="${VERSION//[^0-9.]/}" VERSION2=$(echo "$VERSION" | cut -f1-2 -d'.') @@ -170,17 +117,14 @@ esac # staging registry nexus3.openecomp.org:10004" case $EXT in SNAPSHOT|snapshot) - #REPO='nexus3.openecomp.org:10003' REPO='nexus3.onap.org:10003' EXT="-SNAPSHOT" ;; STAGING|staging) - #REPO='nexus3.openecomp.org:10003' REPO='nexus3.onap.org:10003' EXT="-STAGING" ;; "") - #REPO='nexus3.openecomp.org:10002' REPO='nexus3.onap.org:10002' EXT="" echo "version has no extension, intended for release, in \"$phase\" phase. donot do release here" @@ -202,3 +146,4 @@ do docker push "${NEWTAG}" OLDTAG="${NEWTAG}" done + @@ -5,7 +5,7 @@ <groupId>org.onap.dcaegen2.collectors.ves</groupId> <artifactId>VESCollector</artifactId> <version>1.1.4-SNAPSHOT</version> - <name>dcaegen2-collectors-ves</name> + <name>VESCollector</name> <description>VESCollector</description> <properties> @@ -44,7 +44,11 @@ <dependency.locations.enabled>false</dependency.locations.enabled> <!-- <sonar.host.url>http://localhost:9000</sonar.host.url> --> <!-- <maven.test.skip>true</maven.test.skip> --> - <nexusproxy>https://nexus.openecomp.org</nexusproxy> + + <nexusproxy>https://nexus.onap.org</nexusproxy> + <snapshots.path>content/repositories/snapshots/</snapshots.path> + <releases.path>content/repositories/releases/</releases.path> + <site.path>content/sites/site/org/onap/dcaegen2/collectors/ves/${project.artifactId}/${project.version}</site.path> </properties> <pluginRepositories> @@ -90,13 +94,11 @@ <version>1.0.10</version> </dependency> -<!-- - <dependency> + <!-- <dependency> <groupId>com.att.nsa</groupId> <artifactId>saToolkit</artifactId> <version>1.1.3</version> - </dependency> ---> + </dependency> --> <dependency> <groupId>org.slf4j</groupId> @@ -576,21 +578,6 @@ </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>3.0.0</version> - <executions> - <!-- <execution> <id>copy</id> <phase>compile</phase> <goals> <goal>copy</goal> - </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.openecomp.dcae.controller</groupId> - <artifactId>dcae-controller-service-standardeventcollector-manager</artifactId> - <version>${project.version}</version> <type>zip</type> <classifier>runtime</classifier> - <overWrite>true</overWrite> <outputDirectory>.</outputDirectory> <destFileName>manager.zip</destFileName> - </artifactItem> </artifactItems> </configuration> </execution> --> - </executions> - </plugin> - </plugins> </build> @@ -632,21 +619,22 @@ </reporting> <distributionManagement> - <site> - <id>dcae-javadoc</id> - <!-- <url>file:LOCALDIR/${project.artifactId}/</url> --> - <url>dav:https://ecomp-nexus:8443/repository/dcae-javadoc/${project.artifactId}/${project.version}</url> - </site> - <repository> - <id>ecomp-releases</id> - <name>Open eCOMP Release Repository</name> - <url>${nexusproxy}/content/repositories/releases/</url> - </repository> - <snapshotRepository> - <id>ecomp-snapshots</id> - <name>Open eCOMP Snapshot Repository</name> - <url>${nexusproxy}/content/repositories/snapshots/</url> - </snapshotRepository> + <site> + <id>ecomp-site</id> + <!-- <url>file:LOCALDIR/${project.artifactId}/</url> --> + <url>dav:${nexusproxy}/${site.path}/</url> + </site> + <repository> + <id>ecomp-releases</id> + <name>Open eCOMP Release Repository</name> + <url>${nexusproxy}/${releases.path}</url> + </repository> + <snapshotRepository> + <id>ecomp-snapshots</id> + <name>Open eCOMP Snapshot Repository</name> + <url>${nexusproxy}/${snapshots.path}</url> + </snapshotRepository> </distributionManagement> </project> + diff --git a/src/assembly/dep.xml b/src/assembly/dep.xml index 86f9ffc1..cb72aa4a 100644 --- a/src/assembly/dep.xml +++ b/src/assembly/dep.xml @@ -66,6 +66,13 @@ </includes> <outputDirectory>specs</outputDirectory> </fileSet> + <fileSet> + <directory>./</directory> + <includes> + <include>Dockerfile</include> + </includes> + <outputDirectory>./</outputDirectory> + </fileSet> </fileSets> <dependencySets> <dependencySet> @@ -76,3 +83,4 @@ </dependencySet> </dependencySets> </assembly> + diff --git a/src/main/scripts/docker-entry.sh b/src/main/scripts/docker-entry.sh index e8766d6f..112318b2 100644 --- a/src/main/scripts/docker-entry.sh +++ b/src/main/scripts/docker-entry.sh @@ -1,5 +1,4 @@ #!/bin/sh - ### # ============LICENSE_START======================================================= # PROJECT @@ -19,8 +18,7 @@ # limitations under the License. # ============LICENSE_END========================================================= ### - - +echo \$COLLECTOR_IP \$(hostname).dcae.simpledemo.openecomp.org >> /etc/hosts if [ -z "$CONSUL_HOST" ] || [ -z "$CONFIG_BINDING_SERVICE" ] || [ -z "$HOSTNAME" ]; then echo "INFO: USING STANDARD CONTROLLER" /opt/app/manager/start-manager.sh @@ -30,3 +28,4 @@ else /opt/app/VESCollector/bin/VESrestfulCollector.sh start & fi #while true; do sleep 1000; done + |