Patrick Brady | f92128c | 2018-03-15 17:52:35 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | ============LICENSE_START========================================== |
| 4 | ONAP : APPC |
| 5 | =================================================================== |
| 6 | Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. |
| 7 | =================================================================== |
| 8 | |
| 9 | Unless otherwise specified, all software contained herein is licensed |
| 10 | under the Apache License, Version 2.0 (the License); |
| 11 | you may not use this software except in compliance with the License. |
| 12 | You may obtain a copy of the License at |
| 13 | |
| 14 | http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | |
| 16 | Unless required by applicable law or agreed to in writing, software |
| 17 | distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | See the License for the specific language governing permissions and |
| 20 | limitations under the License. |
| 21 | |
| 22 | ============LICENSE_END============================================ |
| 23 | --> |
| 24 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 25 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 26 | |
| 27 | <parent> |
| 28 | <groupId>org.onap.appc.deployment</groupId> |
| 29 | <artifactId>appc-docker-project</artifactId> |
| 30 | <version>1.3.0-SNAPSHOT</version> |
| 31 | </parent> |
| 32 | |
| 33 | <modelVersion>4.0.0</modelVersion> |
| 34 | <packaging>pom</packaging> |
| 35 | <groupId>org.onap.appc.deployment</groupId> |
| 36 | <artifactId>installation-cdt</artifactId> |
| 37 | <version>1.3.0-SNAPSHOT</version> |
| 38 | |
| 39 | <name>Installation - CDT Docker</name> |
| 40 | <description>Creates APPC CDT Docker container</description> |
| 41 | |
| 42 | <properties> |
| 43 | <image.name>onap/appc-cdt-image</image.name> |
| 44 | <appc.release.version>1.6.0</appc.release.version> |
| 45 | <appc.snapshot.version>1.6.0-SNAPSHOT</appc.snapshot.version> |
| 46 | <!--This version will be over-ridden by jenkins |
| 47 | injecting the version.properties variable file during docker build--> |
| 48 | <appc.docker.staging.version>1.0.0</appc.docker.staging.version> |
Jessica Wagantall | b4b8bc4 | 2018-04-04 18:28:53 -0700 | [diff] [blame] | 49 | <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> |
Patrick Brady | f92128c | 2018-03-15 17:52:35 -0400 | [diff] [blame] | 50 | </properties> |
| 51 | |
| 52 | |
| 53 | <build> |
| 54 | <plugins> |
| 55 | |
| 56 | <!-- This is to add any extra scripts, sql dump files, properties files APPC may need even after inheriting from the sdnc base image --> |
| 57 | <plugin> |
| 58 | <artifactId>maven-resources-plugin</artifactId> |
| 59 | <version>2.6</version> |
| 60 | <executions> |
| 61 | <execution> |
| 62 | <id>copy-dockerfile</id> |
| 63 | <goals> |
| 64 | <goal>copy-resources</goal> |
| 65 | </goals><!-- here the phase you need --> |
| 66 | <phase>validate</phase> |
| 67 | <configuration> |
| 68 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 69 | <resources> |
| 70 | <resource> |
| 71 | <directory>src/main/docker</directory> |
| 72 | <includes> |
| 73 | <include>Dockerfile</include> |
| 74 | </includes> |
| 75 | <filtering>true</filtering> |
| 76 | </resource> |
| 77 | </resources> |
| 78 | </configuration> |
| 79 | </execution> |
| 80 | |
| 81 | <!--<execution> |
| 82 | <id>copy-scripts</id> |
| 83 | <goals> |
| 84 | <goal>copy-resources</goal> |
| 85 | </goals> |
| 86 | <phase>validate</phase> |
| 87 | <configuration> |
| 88 | <outputDirectory>${basedir}/target/docker-stage/opt/onap/appc/bin</outputDirectory> |
| 89 | <resources> |
| 90 | <resource> |
| 91 | <directory>src/main/scripts</directory> |
| 92 | <includes> |
| 93 | <include>*.sh</include> |
| 94 | </includes> |
| 95 | <filtering>false</filtering> |
| 96 | </resource> |
| 97 | </resources> |
| 98 | </configuration> |
| 99 | </execution> --> |
| 100 | |
| 101 | </executions> |
| 102 | </plugin> |
| 103 | <plugin> |
| 104 | <artifactId>exec-maven-plugin</artifactId> |
| 105 | <groupId>org.codehaus.mojo</groupId> |
| 106 | <version>1.5.0</version> |
| 107 | <executions> |
| 108 | <execution> |
| 109 | <id>Get features</id> |
| 110 | <phase>generate-sources</phase> |
| 111 | <goals> |
| 112 | <goal>exec</goal> |
| 113 | </goals> |
| 114 | <configuration> |
| 115 | <executable>bash</executable> |
| 116 | <environmentVariables> |
| 117 | <APPC_VERSION>${appc.version}</APPC_VERSION> |
| 118 | <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION> |
| 119 | <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION> |
| 120 | </environmentVariables> |
| 121 | <arguments> |
| 122 | <argument>${basedir}/src/main/scripts/installZips.sh</argument> |
| 123 | <argument>${basedir}/target/docker-stage</argument> |
| 124 | </arguments> |
| 125 | </configuration> |
| 126 | </execution> |
| 127 | |
| 128 | </executions> |
| 129 | </plugin> |
| 130 | </plugins> |
| 131 | </build> |
| 132 | |
| 133 | <profiles> |
| 134 | <profile> |
| 135 | <id>docker</id> |
| 136 | <build> |
| 137 | <plugins> |
| 138 | <plugin> |
| 139 | <groupId>org.codehaus.groovy.maven</groupId> |
| 140 | <artifactId>gmaven-plugin</artifactId> |
| 141 | <executions> |
| 142 | <execution> |
| 143 | <phase>validate</phase> |
| 144 | <goals> |
| 145 | <goal>execute</goal> |
| 146 | </goals> |
| 147 | <configuration> |
| 148 | <properties> |
| 149 | <ver>${project.version}</ver> |
| 150 | <timestamp>${maven.build.timestamp}</timestamp> |
| 151 | </properties> |
| 152 | <source> |
| 153 | println project.properties['ver']; |
| 154 | def versionArray; |
| 155 | if ( project.properties['ver'] != null ) { |
| 156 | versionArray = project.properties['ver'].split('\\.'); |
| 157 | } |
| 158 | if ( project.properties['ver'].endsWith("-SNAPSHOT") ) { |
| 159 | project.properties['dockertag1']=project.properties['ver'] + "-latest"; |
Patrick Brady | d64f840 | 2018-04-06 15:28:17 -0700 | [diff] [blame] | 160 | project.properties['dockertag2']=project.properties['ver'] + "-" + project.properties['timestamp']; |
Patrick Brady | f92128c | 2018-03-15 17:52:35 -0400 | [diff] [blame] | 161 | project.properties['appc.version']=project.properties['appc.snapshot.version']; |
| 162 | } else { |
| 163 | project.properties['dockertag1']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 164 | project.properties['dockertag2']=project.properties['ver'] + "-STAGING-" + project.properties['timestamp']; |
| 165 | project.properties['appc.version']=project.properties['appc.release.version']; |
| 166 | } |
| 167 | println 'docker tag 1: ' + project.properties['dockertag1']; |
| 168 | println 'docker tag 2: ' + project.properties['dockertag2']; |
| 169 | </source> |
| 170 | </configuration> |
| 171 | </execution> |
| 172 | </executions> |
| 173 | </plugin> |
| 174 | <plugin> |
| 175 | <groupId>io.fabric8</groupId> |
| 176 | <artifactId>docker-maven-plugin</artifactId> |
| 177 | <version>0.16.5</version> |
| 178 | <inherited>false</inherited> |
| 179 | <configuration> |
| 180 | <images> |
| 181 | <image> |
| 182 | <name>${image.name}</name> |
| 183 | <build> |
| 184 | <cleanup>try</cleanup> |
| 185 | <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> |
| 186 | <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> |
| 187 | <tags> |
| 188 | <tag>${dockertag1}</tag> |
| 189 | <tag>${dockertag2}</tag> |
| 190 | </tags> |
| 191 | </build> |
| 192 | </image> |
| 193 | </images> |
| 194 | </configuration> |
| 195 | <executions> |
| 196 | <execution> |
| 197 | <id>generate-images</id> |
| 198 | <phase>package</phase> |
| 199 | <goals> |
| 200 | <goal>build</goal> |
| 201 | </goals> |
| 202 | </execution> |
| 203 | |
| 204 | <execution> |
| 205 | <id>push-images</id> |
| 206 | <phase>deploy</phase> |
| 207 | <goals> |
| 208 | <goal>build</goal> |
| 209 | <goal>push</goal> |
| 210 | </goals> |
| 211 | </execution> |
| 212 | </executions> |
| 213 | </plugin> |
| 214 | |
| 215 | <!-- This is to add any extra scripts, sql dump files, properties files |
| 216 | APPC may need even after inheriting from the sdnc base image --> |
| 217 | <plugin> |
| 218 | <artifactId>maven-resources-plugin</artifactId> |
| 219 | <version>2.6</version> |
| 220 | <executions> |
| 221 | <execution> |
| 222 | <id>copy-dockerfile</id> |
| 223 | <goals> |
| 224 | <goal>copy-resources</goal> |
| 225 | </goals><!-- here the phase you need --> |
| 226 | <phase>validate</phase> |
| 227 | <configuration> |
| 228 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 229 | <resources> |
| 230 | <resource> |
| 231 | <directory>src/main/docker</directory> |
| 232 | <includes> |
| 233 | <include>Dockerfile</include> |
| 234 | </includes> |
| 235 | <filtering>true</filtering> |
| 236 | </resource> |
| 237 | </resources> |
| 238 | </configuration> |
| 239 | </execution> |
| 240 | </executions> |
| 241 | </plugin> |
| 242 | <plugin> |
| 243 | <artifactId>exec-maven-plugin</artifactId> |
| 244 | <groupId>org.codehaus.mojo</groupId> |
| 245 | <version>1.5.0</version> |
| 246 | <executions> |
| 247 | <execution> |
| 248 | <id>Get features</id> |
| 249 | <phase>generate-sources</phase> |
| 250 | <goals> |
| 251 | <goal>exec</goal> |
| 252 | </goals> |
| 253 | <configuration> |
| 254 | <executable>bash</executable> |
| 255 | <environmentVariables> |
| 256 | <APPC_VERSION>${appc.version}</APPC_VERSION> |
| 257 | <APPC_OAM_VERSION>${project.version}</APPC_OAM_VERSION> |
| 258 | <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION> |
| 259 | </environmentVariables> |
| 260 | <arguments> |
| 261 | <argument>${basedir}/src/main/scripts/installZips.sh</argument> |
| 262 | <argument>${basedir}/target/docker-stage</argument> |
| 263 | <argument>${basedir}/target/docker-stage</argument> |
| 264 | </arguments> |
| 265 | </configuration> |
| 266 | </execution> |
| 267 | |
| 268 | |
| 269 | </executions> |
| 270 | </plugin> |
| 271 | </plugins> |
| 272 | </build> |
| 273 | |
| 274 | </profile> |
| 275 | </profiles> |
| 276 | |
| 277 | <organization> |
| 278 | <name>ONAP</name> |
| 279 | </organization> |
| 280 | |
| 281 | </project> |