From 9cec84e1594129c4035cb5e258e13cd1191eac19 Mon Sep 17 00:00:00 2001 From: Serban Jora Date: Thu, 5 Oct 2017 00:53:51 -0400 Subject: Add Docker build plugin and support Change-Id: I5dde9d9c12a5f62f53a1ce943fe5acf8a2c236bd Issue-Id: MODELING-26 Signed-off-by: Serban Jora --- javatoscachecker/service/pom.xml | 99 +++++++++++++++++++++- .../service/src/main/docker/Dockerfile | 15 ++++ .../service/src/main/docker/startService.sh | 26 ++++++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 javatoscachecker/service/src/main/docker/Dockerfile create mode 100644 javatoscachecker/service/src/main/docker/startService.sh (limited to 'javatoscachecker/service') diff --git a/javatoscachecker/service/pom.xml b/javatoscachecker/service/pom.xml index 26597c4..94da89f 100644 --- a/javatoscachecker/service/pom.xml +++ b/javatoscachecker/service/pom.xml @@ -27,12 +27,27 @@ 1.8 - yyyy-MM-dd HH:mm:ss a + yyyy.MM.dd'T'hh.mm.ss'Z' + ${onap.nexus.dockerregistry.daily} + ${project.version} + ${maven.build.timestamp} src/main/java + + + org.apache.maven.plugins + maven-surefire-plugin + 2.4.2 + + + tcp://127.0.0.1:2375 + + + + maven-compiler-plugin 3.1 @@ -115,6 +130,88 @@ + + + com.spotify + docker-maven-plugin + 1.0.0 + + onap/modeling/javatoscachecker + ${project.basedir}/src/main/docker + + + + true + + latest + ${docker.tag.version}-${docker.tag.timestamp} + + true + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + / + ${project.basedir} + application.properties + + + + + + build-image + package + + build + + + + tag-image-latest-timestamp + package + + tag + + + onap/modeling/javatoscachecker:${docker.tag.version}-${docker.tag.timestamp} + ${docker.push.registry}/onap/modeling/javatoscachecker:${docker.tag.version}-${docker.tag.timestamp} + + + + push-image-latest-timestamp + deploy + + push + + + ${docker.push.registry}/onap/modeling/javatoscachecker:${docker.tag.version}-${docker.tag.timestamp} + + + + tag-image-latest + package + + tag + + + onap/modeling/javatoscachecker:latest + ${docker.push.registry}/onap/modeling/javatoscachecker:latest + + + + push-image-latest + deploy + + push + + + ${docker.push.registry}/onap/modeling/javatoscachecker:latest + + + + diff --git a/javatoscachecker/service/src/main/docker/Dockerfile b/javatoscachecker/service/src/main/docker/Dockerfile new file mode 100644 index 0000000..2287b7d --- /dev/null +++ b/javatoscachecker/service/src/main/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM openjdk:8 + +MAINTAINER "sj2381@att.com" + +ADD Service-1.0.0-SNAPSHOT.jar /opt/modeling/Service-1.0.0-SNAPSHOT.jar +ADD application.properties /opt/modeling/application.properties +VOLUME /etc +ADD startService.sh /opt/modeling/startService.sh +RUN chmod 700 /opt/modeling/startService.sh + +WORKDIR /opt/modeling/ +EXPOSE 8080 +ENTRYPOINT /opt/modeling/startService.sh + + diff --git a/javatoscachecker/service/src/main/docker/startService.sh b/javatoscachecker/service/src/main/docker/startService.sh new file mode 100644 index 0000000..d42cfe1 --- /dev/null +++ b/javatoscachecker/service/src/main/docker/startService.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +### +# ============LICENSE_START======================================================= +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# =================================================================== +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +### + +java -Xms1024m -Xmx1024m -jar ./Service-1.0.0-SNAPSHOT.jar + -- cgit 1.2.3-korg