Dan Timoney | 471dafa | 2017-08-21 14:44:05 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 4 | |
| 5 | <parent> |
| 6 | <groupId>org.onap.ccsdk.distribution</groupId> |
| 7 | <artifactId>distribution-root</artifactId> |
| 8 | <version>0.1.0-SNAPSHOT</version> |
| 9 | </parent> |
| 10 | <modelVersion>4.0.0</modelVersion> |
| 11 | <packaging>pom</packaging> |
| 12 | <artifactId>distribution-odlsli</artifactId> |
| 13 | <version>0.1.0-SNAPSHOT</version> |
| 14 | |
| 15 | <name>Distribution - odlsli</name> |
| 16 | <description>Creates SDN Controller Docker container</description> |
| 17 | |
| 18 | <properties> |
| 19 | <image.name>onap/ccsdk-odlsli-image</image.name> |
| 20 | <ccsdk.project.version>${project.version}</ccsdk.project.version> |
| 21 | <ccsdk.core.version>${project.version}</ccsdk.core.version> |
| 22 | <ccsdk.adaptors.version>${project.version}</ccsdk.adaptors.version> |
| 23 | <ccsdk.northbound.version>${project.version}</ccsdk.northbound.version> |
| 24 | <ccsdk.plugins.version>${project.version}</ccsdk.plugins.version> |
| 25 | <ccsdk.mysql-connector-java.version>5.1.39</ccsdk.mysql-connector-java.version> |
| 26 | <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy> |
| 27 | </properties> |
| 28 | |
| 29 | |
| 30 | <build> |
| 31 | <plugins> |
| 32 | |
| 33 | |
| 34 | <plugin> |
| 35 | <groupId>org.codehaus.groovy.maven</groupId> |
| 36 | <artifactId>gmaven-plugin</artifactId> |
| 37 | <executions> |
| 38 | <execution> |
| 39 | <phase>validate</phase> |
| 40 | <goals> |
| 41 | <goal>execute</goal> |
| 42 | </goals> |
| 43 | <configuration> |
| 44 | <source> |
| 45 | println project.properties['ccsdk.project.version']; |
| 46 | def versionArray; |
| 47 | if ( project.properties['ccsdk.project.version'] != null ) { |
| 48 | versionArray = project.properties['ccsdk.project.version'].split('\\.'); |
| 49 | } |
| 50 | |
| 51 | if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) |
| 52 | { |
| 53 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 54 | } else { |
| 55 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 56 | } |
| 57 | |
| 58 | println 'New Tag for docker:' + |
| 59 | project.properties['project.docker.latesttag.version']; |
| 60 | </source> |
| 61 | </configuration> |
| 62 | </execution> |
| 63 | </executions> |
| 64 | </plugin> |
| 65 | |
| 66 | |
| 67 | |
| 68 | <plugin> |
| 69 | <artifactId>maven-resources-plugin</artifactId> |
| 70 | <version>2.6</version> |
| 71 | <executions> |
| 72 | <execution> |
| 73 | <id>copy-dockerfile</id> |
| 74 | <goals> |
| 75 | <goal>copy-resources</goal> |
| 76 | </goals><!-- here the phase you need --> |
| 77 | <phase>validate</phase> |
| 78 | <configuration> |
| 79 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 80 | <resources> |
| 81 | <resource> |
| 82 | <directory>src/main/docker</directory> |
| 83 | <includes> |
| 84 | <include>Dockerfile</include> |
| 85 | </includes> |
| 86 | <filtering>true</filtering> |
| 87 | </resource> |
| 88 | </resources> |
| 89 | </configuration> |
| 90 | </execution> |
| 91 | |
| 92 | <execution> |
| 93 | <id>copy-scripts</id> |
| 94 | <goals> |
| 95 | <goal>copy-resources</goal> |
| 96 | </goals><!-- here the phase you need --> |
| 97 | <phase>validate</phase> |
| 98 | <configuration> |
| 99 | <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/bin</outputDirectory> |
| 100 | <resources> |
| 101 | <resource> |
| 102 | <directory>src/main/scripts</directory> |
| 103 | <includes> |
| 104 | <include>*.sh</include> |
| 105 | </includes> |
| 106 | <filtering>false</filtering> |
| 107 | </resource> |
| 108 | </resources> |
| 109 | </configuration> |
| 110 | </execution> |
| 111 | |
| 112 | <execution> |
| 113 | <id>copy-tarballs</id> |
| 114 | <goals> |
| 115 | <goal>copy-resources</goal> |
| 116 | </goals><!-- here the phase you need --> |
| 117 | <phase>validate</phase> |
| 118 | <configuration> |
| 119 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 120 | <resources> |
| 121 | <resource> |
| 122 | <directory>src/main/resources</directory> |
| 123 | <includes> |
| 124 | <include>idmlight.db.mv.db</include> |
| 125 | </includes> |
| 126 | <filtering>false</filtering> |
| 127 | </resource> |
| 128 | </resources> |
| 129 | </configuration> |
| 130 | </execution> |
| 131 | <execution> |
| 132 | <id>copy-data</id> |
| 133 | <goals> |
| 134 | <goal>copy-resources</goal> |
| 135 | </goals><!-- here the phase you need --> |
| 136 | <phase>validate</phase> |
| 137 | <configuration> |
| 138 | <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data</outputDirectory> |
| 139 | <resources> |
| 140 | <resource> |
| 141 | <directory>src/main/resources</directory> |
| 142 | <includes> |
| 143 | <include>*.dump</include> |
| 144 | </includes> |
| 145 | <filtering>false</filtering> |
| 146 | </resource> |
| 147 | </resources> |
| 148 | </configuration> |
| 149 | </execution> |
| 150 | <execution> |
| 151 | <id>copy-properties</id> |
| 152 | <goals> |
| 153 | <goal>copy-resources</goal> |
| 154 | </goals><!-- here the phase you need --> |
| 155 | <phase>validate</phase> |
| 156 | <configuration> |
| 157 | <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/properties</outputDirectory> |
| 158 | <resources> |
| 159 | <resource> |
| 160 | <directory>src/main/properties</directory> |
| 161 | <includes> |
| 162 | <include>*.properties</include> |
| 163 | </includes> |
| 164 | <filtering>false</filtering> |
| 165 | </resource> |
| 166 | </resources> |
| 167 | </configuration> |
| 168 | </execution> |
| 169 | <execution> |
| 170 | <id>copy-keystores</id> |
| 171 | <goals> |
| 172 | <goal>copy-resources</goal> |
| 173 | </goals><!-- here the phase you need --> |
| 174 | <phase>validate</phase> |
| 175 | <configuration> |
| 176 | <outputDirectory>${basedir}/target/docker-stage/opt/onap/sdnc/data/stores</outputDirectory> |
| 177 | <resources> |
| 178 | <resource> |
| 179 | <directory>../src/main/stores</directory> |
| 180 | <includes> |
| 181 | <include>*.jks</include> |
| 182 | </includes> |
| 183 | <filtering>false</filtering> |
| 184 | </resource> |
| 185 | </resources> |
| 186 | </configuration> |
| 187 | </execution> |
| 188 | </executions> |
| 189 | </plugin> |
| 190 | <plugin> |
| 191 | <artifactId>exec-maven-plugin</artifactId> |
| 192 | <groupId>org.codehaus.mojo</groupId> |
| 193 | <version>1.5.0</version> |
| 194 | <executions> |
| 195 | |
| 196 | <execution> |
| 197 | <id>Get features</id> |
| 198 | <phase>generate-sources</phase> |
| 199 | <goals> |
| 200 | <goal>exec</goal> |
| 201 | </goals> |
| 202 | <configuration> |
| 203 | <executable>/bin/bash</executable> |
| 204 | <environmentVariables> |
| 205 | <SDNC_CORE_VERSION>${ccsdk.core.version}</SDNC_CORE_VERSION> |
| 206 | <SDNC_ADAPTORS_VERSION>${ccsdk.adaptors.version}</SDNC_ADAPTORS_VERSION> |
| 207 | <SDNC_NORTHBOUND_VERSION>${ccsdk.northbound.version}</SDNC_NORTHBOUND_VERSION> |
| 208 | <SDNC_PLUGINS_VERSION>${ccsdk.plugins.version}</SDNC_PLUGINS_VERSION> |
| 209 | <SDNC_OAM_VERSION>${project.version}</SDNC_OAM_VERSION> |
| 210 | </environmentVariables> |
| 211 | <arguments> |
| 212 | <argument>${basedir}/src/main/scripts/installZips.sh</argument> |
| 213 | <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument> |
| 214 | </arguments> |
| 215 | </configuration> |
| 216 | </execution> |
| 217 | |
| 218 | <execution> |
| 219 | <id>change shell permissions</id> |
| 220 | <phase>process-sources</phase> |
| 221 | <goals> |
| 222 | <goal>exec</goal> |
| 223 | </goals> |
| 224 | <configuration> |
| 225 | <executable>/usr/bin/find</executable> |
| 226 | <arguments> |
| 227 | <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument> |
| 228 | <argument>-name</argument> |
| 229 | <argument>*.sh</argument> |
| 230 | <argument>-exec</argument> |
| 231 | <argument>chmod</argument> |
| 232 | <argument>+x</argument> |
| 233 | <argument>{}</argument> |
| 234 | <argument>;</argument> |
| 235 | </arguments> |
| 236 | </configuration> |
| 237 | </execution> |
| 238 | </executions> |
| 239 | </plugin> |
| 240 | |
| 241 | |
| 242 | </plugins> |
| 243 | |
| 244 | </build> |
| 245 | |
| 246 | <profiles> |
| 247 | <profile> |
| 248 | <id>docker</id> |
| 249 | <build> |
| 250 | <plugins> |
| 251 | <plugin> |
| 252 | <groupId>io.fabric8</groupId> |
| 253 | <artifactId>docker-maven-plugin</artifactId> |
| 254 | <version>0.16.5</version> |
| 255 | <inherited>false</inherited> |
| 256 | <configuration> |
| 257 | <images> |
| 258 | <image> |
| 259 | <name>${image.name}</name> |
| 260 | <build> |
| 261 | <cleanup>try</cleanup> |
| 262 | <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> |
| 263 | <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> |
| 264 | <tags> |
| 265 | <tag>${project.version}</tag> |
| 266 | <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> |
| 267 | <tag>${project.docker.latesttag.version}</tag> |
| 268 | </tags> |
| 269 | </build> |
| 270 | </image> |
| 271 | </images> |
| 272 | </configuration> |
| 273 | <executions> |
| 274 | <execution> |
| 275 | <id>generate-images</id> |
| 276 | <phase>package</phase> |
| 277 | <goals> |
| 278 | <goal>build</goal> |
| 279 | </goals> |
| 280 | </execution> |
| 281 | |
| 282 | <execution> |
| 283 | <id>push-images</id> |
| 284 | <phase>deploy</phase> |
| 285 | <goals> |
| 286 | <goal>build</goal> |
| 287 | <goal>push</goal> |
| 288 | </goals> |
| 289 | </execution> |
| 290 | </executions> |
| 291 | </plugin> |
| 292 | </plugins> |
| 293 | </build> |
| 294 | </profile> |
| 295 | </profiles> |
| 296 | <organization> |
| 297 | <name>openECOMP</name> |
| 298 | </organization> |
| 299 | </project> |