From 74e4e8dede50ffaf0d2209046959dea98b903c33 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 22 Aug 2017 11:51:54 -0400 Subject: Use docker profile Docker plugin should be defined in separate profile so that it is only triggered by docker Jenkins jobs, which enable the docker profile via -P docker command line arg. Change-Id: I42826bf5fe1c4cfcf6dd0122b3d889ddd031306a Issue-ID: CCSDK-64 Signed-off-by: Dan Timoney --- odlsli/src/main/docker/Dockerfile | 15 +-- opendaylight/pom.xml | 153 +++++++++++++----------- ubuntu/pom.xml | 245 ++++++++++++++++++++------------------ 3 files changed, 212 insertions(+), 201 deletions(-) diff --git a/odlsli/src/main/docker/Dockerfile b/odlsli/src/main/docker/Dockerfile index 4e6afa77..b2a00f91 100644 --- a/odlsli/src/main/docker/Dockerfile +++ b/odlsli/src/main/docker/Dockerfile @@ -5,22 +5,11 @@ ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 ENV ODL_HOME /opt/opendaylight/current ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties -# copy the opendaylight tar and expand -COPY distribution-karaf-${sdnc.opendaylight.version}.tar.gz /tmp/ -RUN mkdir /opt/opendaylight \ - && tar zxvf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz --directory /opt/opendaylight \ - && rm -rf /tmp/distribution-karaf-${sdnc.opendaylight.version}.tar.gz \ - && ln -s /opt/opendaylight/distribution-karaf-${sdnc.opendaylight.version} /opt/opendaylight/current \ - && mkdir /opt/onap - +# copy the opendaylight credentials COPY idmlight.db.mv.db /opt/opendaylight/current -# copy openecomp +# copy deliverables to opt COPY opt /opt -RUN ln -s /opt/onap/sdnc /opt/sdnc -# workaround till we get proxy working -RUN mkdir -p /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version} -COPY mysql-connector-java-${sdnc.mysql-connector-java.version}.jar /opt/opendaylight/current/system/mysql/mysql-connector-java/${sdnc.mysql-connector-java.version} # ENTRYPOINT exec /opt/opendaylight/current/bin/karaf EXPOSE 8181 diff --git a/opendaylight/pom.xml b/opendaylight/pom.xml index 9de65fd0..5924cba0 100644 --- a/opendaylight/pom.xml +++ b/opendaylight/pom.xml @@ -58,99 +58,57 @@ println project.properties['ccsdk.project.version']; def versionArray; - if ( project.properties['ccsdk.project.version'] != null ) { - versionArray = - project.properties['ccsdk.project.version'].split('\\.'); + if (project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.'); } - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) { + if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) + { project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; } else { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['project.docker.latesttag.version']=versionArray[0]+ '.' + versionArray[1] +"-STAGING-latest"; } - println 'New Tag for docker:' + - project.properties['project.docker.latesttag.version']; + println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; + + - io.fabric8 - docker-maven-plugin - 0.16.5 - false - - - - ${image.name} - - try - ${basedir}/target/docker-stage - ${basedir}/target/docker-stage/Dockerfile - - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} - - - - - + org.apache.maven.plugins + maven-dependency-plugin + 3.0.0 - generate-images - package + get-odl-distribution + validate - build + copy - + + + + org.opendaylight.integration + distribution-karaf + ${ccsdk.opendaylight.version} + tar.gz - - push-images - deploy - - build - push - + true + ${basedir}/target/docker-stage + + + false + true + true + - - - org.apache.maven.plugins - maven-dependency-plugin - 3.0.0 - - - get-odl-distribution - validate - - copy - - - - - org.opendaylight.integration - distribution-karaf - ${ccsdk.opendaylight.version} - tar.gz - - true - ${basedir}/target/docker-stage - - - false - true - true - - - - - org.apache.maven.plugins maven-dependency-plugin @@ -213,6 +171,59 @@ + + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.16.5 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + ${basedir}/target/docker-stage/Dockerfile + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + + + + generate-images + package + + build + + + + + push-images + deploy + + build + push + + + + + + + + + + openECOMP diff --git a/ubuntu/pom.xml b/ubuntu/pom.xml index f74058b3..cbaf04c2 100644 --- a/ubuntu/pom.xml +++ b/ubuntu/pom.xml @@ -1,133 +1,144 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - org.onap.ccsdk.distribution - distribution-root - 0.1.0-SNAPSHOT - + + org.onap.ccsdk.distribution + distribution-root + 0.1.0-SNAPSHOT + - 4.0.0 - pom - distribution-ubuntu - 0.1.0-SNAPSHOT + 4.0.0 + pom + distribution-ubuntu + 0.1.0-SNAPSHOT - Distribution - ubuntu - Creates base ubuntu Docker container + Distribution - ubuntu + Creates base ubuntu Docker container - - onap/ccsdk-ubuntu-image - ${project.version} - + + onap/ccsdk-ubuntu-image + ${project.version} + - - + + - - org.codehaus.groovy.maven - gmaven-plugin - - - validate - - execute - - - - println project.properties['ccsdk.project.version']; - def versionArray; - if ( project.properties['ccsdk.project.version'] != null ) { - versionArray = - project.properties['ccsdk.project.version'].split('\\.'); - } + + org.codehaus.groovy.maven + gmaven-plugin + + + validate + + execute + + + + println project.properties['ccsdk.project.version']; + def versionArray; + if ( project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.'); + } - if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; - } else { - project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; - } + if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) + { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + } else { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + } - println 'New Tag for docker:' + - project.properties['project.docker.latesttag.version']; - - - - - - - io.fabric8 - docker-maven-plugin - 0.16.5 - false - + println 'New Tag for docker:' + + project.properties['project.docker.latesttag.version']; + + + + + - - - ${image.name} - - try - ${basedir}/target/docker-stage - ${basedir}/target/docker-stage/Dockerfile - - ${project.version} - ${project.version}-STAGING-${maven.build.timestamp} - ${project.docker.latesttag.version} - - - - - - - - generate-images - generate-sources - - build - - + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + Dockerfile + + true + + + + + + + - - push-images - deploy - - build - push - - - - + - - maven-resources-plugin - 2.6 - - - copy-dockerfile - - copy-resources - - validate - - ${basedir}/target/docker-stage - - - src/main/docker - - Dockerfile - - true - - - - - - - + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.16.5 + false + - - - openECOMP - + + + ${image.name} + + try + ${basedir}/target/docker-stage + ${basedir}/target/docker-stage/Dockerfile + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + + + + generate-images + generate-sources + + build + + + + + push-images + deploy + + build + push + + + + + + + + + + + openECOMP + -- cgit 1.2.3-korg