Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Timoney, Dan (dt5972) | ea65269 | 2019-01-08 15:56:26 -0500 | [diff] [blame] | 2 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 3 | |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 4 | <parent> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 5 | <groupId>org.onap.ccsdk.parent</groupId> |
| 6 | <artifactId>odlparent-lite</artifactId> |
Timoney, Dan (dt5972) | e7cfae5 | 2019-01-03 15:14:58 -0500 | [diff] [blame] | 7 | <version>1.2.1-SNAPSHOT</version> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 8 | </parent> |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 9 | |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 10 | <modelVersion>4.0.0</modelVersion> |
| 11 | <packaging>pom</packaging> |
| 12 | <groupId>org.onap.ccsdk.distribution</groupId> |
| 13 | <artifactId>ansible-server</artifactId> |
Timoney, Dan (dt5972) | e7cfae5 | 2019-01-03 15:14:58 -0500 | [diff] [blame] | 14 | <version>0.4.1-SNAPSHOT</version> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 15 | |
| 16 | <name>ccsdk :: distribution :: ${project.artifactId}</name> |
| 17 | <description>Creates ansible-server Docker container</description> |
| 18 | |
| 19 | <properties> |
| 20 | <image.name>onap/ccsdk-ansible-server-image</image.name> |
| 21 | <ccsdk.project.version>${project.version}</ccsdk.project.version> |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 22 | <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 23 | <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy> |
| 24 | <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> |
Timoney, Dan (dt5972) | f3129a2 | 2019-01-31 10:10:04 -0500 | [diff] [blame^] | 25 | <docker.verbose>true</docker.verbose> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 26 | </properties> |
| 27 | |
| 28 | |
| 29 | <build> |
| 30 | <plugins> |
| 31 | <plugin> |
| 32 | <groupId>org.codehaus.groovy.maven</groupId> |
| 33 | <artifactId>gmaven-plugin</artifactId> |
| 34 | <executions> |
| 35 | <execution> |
| 36 | <phase>validate</phase> |
| 37 | <goals> |
| 38 | <goal>execute</goal> |
| 39 | </goals> |
| 40 | <configuration> |
| 41 | <source> |
| 42 | println project.properties['ccsdk.project.version']; |
| 43 | def versionArray; |
| 44 | if ( project.properties['ccsdk.project.version'] != null ) { |
| 45 | versionArray = project.properties['ccsdk.project.version'].split('\\.'); |
| 46 | } |
| 47 | |
| 48 | if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) |
| 49 | { |
| 50 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 51 | } else { |
| 52 | project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; |
| 53 | } |
| 54 | |
| 55 | println 'New Tag for docker:' + project.properties['project.docker.latesttag.version']; |
| 56 | </source> |
| 57 | </configuration> |
| 58 | </execution> |
| 59 | </executions> |
| 60 | </plugin> |
| 61 | |
| 62 | <plugin> |
| 63 | <artifactId>maven-resources-plugin</artifactId> |
| 64 | <version>2.6</version> |
| 65 | <executions> |
| 66 | <execution> |
| 67 | <id>copy-dockerfile</id> |
| 68 | <goals> |
| 69 | <goal>copy-resources</goal> |
| 70 | </goals><!-- here the phase you need --> |
| 71 | <phase>validate</phase> |
| 72 | <configuration> |
| 73 | <outputDirectory>${basedir}/target/docker-stage</outputDirectory> |
| 74 | <resources> |
| 75 | <resource> |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 76 | <directory>src/main</directory> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 77 | <includes> |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 78 | <include>**/*</include> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 79 | </includes> |
| 80 | <filtering>false</filtering> |
| 81 | </resource> |
| 82 | </resources> |
| 83 | </configuration> |
| 84 | </execution> |
| 85 | </executions> |
| 86 | </plugin> |
| 87 | |
| 88 | <plugin> |
| 89 | <artifactId>exec-maven-plugin</artifactId> |
| 90 | <groupId>org.codehaus.mojo</groupId> |
| 91 | <version>1.5.0</version> |
| 92 | <executions> |
| 93 | <execution> |
| 94 | <id>change python permissions</id> |
| 95 | <phase>process-sources</phase> |
| 96 | <goals> |
| 97 | <goal>exec</goal> |
| 98 | </goals> |
| 99 | <configuration> |
| 100 | <executable>/usr/bin/find</executable> |
| 101 | <arguments> |
Sylvain Desbureaux | 1bc5690 | 2019-01-30 14:36:14 +0100 | [diff] [blame] | 102 | <argument>${basedir}/target/docker-stage/ansible-server</argument> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 103 | <argument>-name</argument> |
| 104 | <argument>*.py</argument> |
| 105 | <argument>-exec</argument> |
| 106 | <argument>chmod</argument> |
| 107 | <argument>+x</argument> |
| 108 | <argument>{}</argument> |
| 109 | <argument>;</argument> |
| 110 | </arguments> |
| 111 | </configuration> |
| 112 | </execution> |
Timoney, Dan (dt5972) | 1262205 | 2018-09-12 10:53:10 -0400 | [diff] [blame] | 113 | </executions> |
| 114 | </plugin> |
| 115 | </plugins> |
| 116 | </build> |
| 117 | |
| 118 | <profiles> |
| 119 | <profile> |
| 120 | <id>docker</id> |
| 121 | <build> |
| 122 | <plugins> |
| 123 | <plugin> |
| 124 | <groupId>io.fabric8</groupId> |
| 125 | <artifactId>docker-maven-plugin</artifactId> |
| 126 | <version>0.16.5</version> |
| 127 | <inherited>false</inherited> |
| 128 | <configuration> |
| 129 | <images> |
| 130 | <image> |
| 131 | <name>${image.name}</name> |
| 132 | <build> |
| 133 | <cleanup>try</cleanup> |
| 134 | <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir> |
| 135 | <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile> |
| 136 | <tags> |
| 137 | <tag>${project.version}</tag> |
| 138 | <tag>${project.version}-STAGING-${maven.build.timestamp}</tag> |
| 139 | <tag>${project.docker.latesttag.version}</tag> |
| 140 | </tags> |
| 141 | </build> |
| 142 | </image> |
| 143 | </images> |
| 144 | </configuration> |
| 145 | <executions> |
| 146 | <execution> |
| 147 | <id>generate-images</id> |
| 148 | <phase>package</phase> |
| 149 | <goals> |
| 150 | <goal>build</goal> |
| 151 | </goals> |
| 152 | </execution> |
| 153 | |
| 154 | <execution> |
| 155 | <id>push-images</id> |
| 156 | <phase>deploy</phase> |
| 157 | <goals> |
| 158 | <goal>build</goal> |
| 159 | <goal>push</goal> |
| 160 | </goals> |
| 161 | </execution> |
| 162 | </executions> |
| 163 | </plugin> |
| 164 | </plugins> |
| 165 | </build> |
| 166 | </profile> |
| 167 | </profiles> |
| 168 | <organization> |
| 169 | <name>ONAP</name> |
| 170 | </organization> |
| 171 | </project> |