blob: a8092026f99eccbb398882a1b53bfa6281a23c84 [file] [log] [blame]
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -04001<?xml version="1.0" encoding="UTF-8"?>
Timoney, Dan (dt5972)ea652692019-01-08 15:56:26 -05002<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)12622052018-09-12 10:53:10 -04003
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +01004 <parent>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -04005 <groupId>org.onap.ccsdk.parent</groupId>
6 <artifactId>odlparent-lite</artifactId>
Timoney, Dan (dt5972)e7cfae52019-01-03 15:14:58 -05007 <version>1.2.1-SNAPSHOT</version>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -04008 </parent>
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +01009
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040010 <modelVersion>4.0.0</modelVersion>
11 <packaging>pom</packaging>
12 <groupId>org.onap.ccsdk.distribution</groupId>
13 <artifactId>ansible-server</artifactId>
Timoney, Dan (dt5972)e7cfae52019-01-03 15:14:58 -050014 <version>0.4.1-SNAPSHOT</version>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040015
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 Desbureaux1bc56902019-01-30 14:36:14 +010022 <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040023 <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
Timoney, Dan (dt5972)f3129a22019-01-31 10:10:04 -050024 <docker.verbose>true</docker.verbose>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040025 </properties>
26
27
28 <build>
29 <plugins>
30 <plugin>
31 <groupId>org.codehaus.groovy.maven</groupId>
32 <artifactId>gmaven-plugin</artifactId>
33 <executions>
34 <execution>
35 <phase>validate</phase>
36 <goals>
37 <goal>execute</goal>
38 </goals>
39 <configuration>
40 <source>
41 println project.properties['ccsdk.project.version'];
42 def versionArray;
43 if ( project.properties['ccsdk.project.version'] != null ) {
44 versionArray = project.properties['ccsdk.project.version'].split('\\.');
45 }
46
47 if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT"))
48 {
49 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
50 } else {
51 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
52 }
53
54 println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'];
55 </source>
56 </configuration>
57 </execution>
58 </executions>
59 </plugin>
60
61 <plugin>
62 <artifactId>maven-resources-plugin</artifactId>
63 <version>2.6</version>
64 <executions>
65 <execution>
66 <id>copy-dockerfile</id>
67 <goals>
68 <goal>copy-resources</goal>
69 </goals><!-- here the phase you need -->
70 <phase>validate</phase>
71 <configuration>
72 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
73 <resources>
74 <resource>
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010075 <directory>src/main</directory>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040076 <includes>
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +010077 <include>**/*</include>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -040078 </includes>
79 <filtering>false</filtering>
80 </resource>
81 </resources>
82 </configuration>
83 </execution>
84 </executions>
85 </plugin>
86
87 <plugin>
88 <artifactId>exec-maven-plugin</artifactId>
89 <groupId>org.codehaus.mojo</groupId>
90 <version>1.5.0</version>
91 <executions>
92 <execution>
93 <id>change python permissions</id>
94 <phase>process-sources</phase>
95 <goals>
96 <goal>exec</goal>
97 </goals>
98 <configuration>
99 <executable>/usr/bin/find</executable>
100 <arguments>
Sylvain Desbureaux1bc56902019-01-30 14:36:14 +0100101 <argument>${basedir}/target/docker-stage/ansible-server</argument>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -0400102 <argument>-name</argument>
103 <argument>*.py</argument>
104 <argument>-exec</argument>
105 <argument>chmod</argument>
106 <argument>+x</argument>
107 <argument>{}</argument>
108 <argument>;</argument>
109 </arguments>
110 </configuration>
111 </execution>
Timoney, Dan (dt5972)12622052018-09-12 10:53:10 -0400112 </executions>
113 </plugin>
114 </plugins>
115 </build>
116
117 <profiles>
118 <profile>
119 <id>docker</id>
120 <build>
121 <plugins>
122 <plugin>
123 <groupId>io.fabric8</groupId>
124 <artifactId>docker-maven-plugin</artifactId>
125 <version>0.16.5</version>
126 <inherited>false</inherited>
127 <configuration>
128 <images>
129 <image>
130 <name>${image.name}</name>
131 <build>
132 <cleanup>try</cleanup>
133 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
134 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
135 <tags>
136 <tag>${project.version}</tag>
137 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
138 <tag>${project.docker.latesttag.version}</tag>
139 </tags>
140 </build>
141 </image>
142 </images>
143 </configuration>
144 <executions>
145 <execution>
146 <id>generate-images</id>
147 <phase>package</phase>
148 <goals>
149 <goal>build</goal>
150 </goals>
151 </execution>
152
153 <execution>
154 <id>push-images</id>
155 <phase>deploy</phase>
156 <goals>
157 <goal>build</goal>
158 <goal>push</goal>
159 </goals>
160 </execution>
161 </executions>
162 </plugin>
163 </plugins>
164 </build>
165 </profile>
166 </profiles>
167 <organization>
168 <name>ONAP</name>
169 </organization>
170</project>