- <profile>
- <id>docker</id>
- <properties>
- <skipDockerBuild>false</skipDockerBuild>
- <skipDockerTag>false</skipDockerTag>
- <skipTests>true</skipTests>
- </properties>
- <build>
- <!-- Copy files to docker-stage to be included in image -->
- <resources>
- <resource>
- <targetPath>${basedir}/target/docker-stage</targetPath>
- <directory>${basedir}/src/main/resources</directory>
- <includes>
- <include>Dockerfile</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/etc</targetPath>
- <directory>${multiproject.basedir}/certs</directory>
- <includes>
- <include>org.onap.dmaap-bc.cred.props</include>
- <include>org.onap.dmaap-bc.crontab.sh</include>
- <include>org.onap.dmaap-bc.jks</include>
- <include>org.onap.dmaap-bc.keyfile</include>
- <include>org.onap.dmaap-bc.location.props</include>
- <include>org.onap.dmaap-bc.p12</include>
- <include>org.onap.dmaap-bc.props</include>
- <include>org.onap.dmaap-bc.showpass</include>
- <include>org.onap.dmaap-bc.trust.jks</include>
- <include>ca.pem</include>
- <include>client.pem</include>
- <include>key.pem</include>
- </includes>
- </resource>
-
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/bin</targetPath>
- <directory>${basedir}/misc</directory>
- <includes>
- <include>dbc-client</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/etc</targetPath>
- <directory>${basedir}</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- </resource>
- <resource>
- <targetPath>${basedir}/target/docker-stage/opt/app/dbc-client/misc</targetPath>
- <directory>${multiproject.basedir}/misc</directory>
- <includes>
- <include>cert-client-init.sh</include>
- <include>aaf-ca.crt</include>
- </includes>
- </resource>
- </resources>
- <plugins>
-
- <!-- Copy jar to docker-stage to be included in image -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
- <executions>
- <execution>
- <id>copy-jar</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/docker-stage/opt/app/dmaapbc/lib</outputDirectory>
- <resources>
- <resource>
- <directory>${multiproject.basedir}/dbc-client/target</directory>
- <includes>
- <include>dbc-client.jar</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Setup image tags per https://wiki.onap.org/display/DW/Independent+Versioning+and+Release+Process#IndependentVersioningandReleaseProcess-StandardizedDockerTagging -->
- <plugin>
- <groupId>org.codehaus.groovy.maven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <properties>
- <ver>${project.version}</ver>
- <timestamp>${maven.build.timestamp}</timestamp>
- </properties>
- <source>
- println 'ver: ' + project.properties['ver'];
- if ( project.properties['ver'].endsWith("-SNAPSHOT") ) {
- project.properties['dockertag1']=project.properties['ver'] + "-latest";
- project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp'];
- } else {
- project.properties['dockertag1']=project.properties['ver'] + "-STAGING-latest";
- project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp'];
- }
- println 'docker tag 1: ' + project.properties['dockertag1'];
- println 'docker tag 2: ' + project.properties['dockertag2'];
- </source>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>io.fabric8</groupId>
- <artifactId>docker-maven-plugin</artifactId>
- <version>0.28.0</version>
- <configuration>
- <verbose>${docker.verbose}</verbose>
- <apiVersion>${docker.apiVersion}</apiVersion>
- <pullRegistry>${docker.pull.registry}</pullRegistry>
- <pushRegistry>${docker.push.registry}</pushRegistry>
- <images>
- <image>
- <name>${docker.image}</name>
- <build>
- <cleanup>try</cleanup>
- <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
- <dockerFile>Dockerfile</dockerFile>
- <tags>
- <tag>${dockertag1}</tag>
- <tag>${dockertag2}</tag>
- </tags>
- </build>
- </image>
- </images>
- </configuration>
- <executions>
- <execution>
- <id>generate-images</id>
- <phase>install</phase>
- <goals>
- <goal>build</goal>
- </goals>
- </execution>
- <execution>
- <id>push-images</id>
- <phase>deploy</phase>
- <goals>
- <goal>push</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <profile>
+ <id>docker</id>
+ <properties>
+ <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
+ <skipTests>true</skipTests>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <configuration>
+ <images>
+ <image>
+ <name>${dmaapbcclient.image.name}</name>
+ <build>
+ <cleanup>try</cleanup>
+ <noCache>true</noCache>
+ <optimise>true</optimise>
+ <contextDir>${basedir}/target/docker-stage</contextDir>
+ <dockerFile>Dockerfile</dockerFile>
+ <tags>
+ <tag>${dockertag1}</tag>
+ <tag>${dockertag2}</tag>
+ </tags>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-images</id>
+ <phase>install</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>push-images</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>