blob: 33302bc15d18a452a55eb4e5551372e09d3fb348 [file] [log] [blame]
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -05001<?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.openecomp.sdnc.oam</groupId>
7 <artifactId>installation</artifactId>
Dan Timoney139e1b52017-04-26 08:13:03 -04008 <version>1.1.1-SNAPSHOT</version>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -05009 </parent>
10
11 <modelVersion>4.0.0</modelVersion>
12 <packaging>pom</packaging>
13 <groupId>org.openecomp.sdnc.oam</groupId>
14 <artifactId>installation-dgbuilder</artifactId>
Dan Timoney139e1b52017-04-26 08:13:03 -040015 <version>1.1.1-SNAPSHOT</version>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050016
17 <name>Installation - dgbuilder</name>
18 <description>Creates docker container for dgbuilder</description>
19
20 <properties>
Dan Timoneyb2175582017-03-31 17:47:19 -040021 <image.name>openecomp/dgbuilder-sdnc-image</image.name>
Dan Timoney8f773512017-04-24 16:30:26 -040022 <sdnc.project.version>${project.version}</sdnc.project.version>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050023 </properties>
24
25
26 <build>
27 <plugins>
28
29
30 <plugin>
Dan Timoney8f773512017-04-24 16:30:26 -040031 <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['sdnc.project.version'];
42 def versionArray;
43 if ( project.properties['sdnc.project.version'] != null ) {
Dan Timoney687146e2017-04-25 08:43:30 -040044 versionArray =
45 project.properties['sdnc.project.version'].split('\\.');
Dan Timoney8f773512017-04-24 16:30:26 -040046 }
47
Dan Timoney687146e2017-04-25 08:43:30 -040048 if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) {
Dan Timoney47020692017-05-15 10:28:02 -040049 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040050 } else {
Dan Timoney687146e2017-04-25 08:43:30 -040051 project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
Dan Timoney8f773512017-04-24 16:30:26 -040052 }
53
54 println 'New Tag for docker:' +
55 project.properties['project.docker.latesttag.version'];
56 </source>
57 </configuration>
58 </execution>
59 </executions>
60 </plugin>
61 <plugin>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050062 <groupId>io.fabric8</groupId>
63 <artifactId>docker-maven-plugin</artifactId>
64 <version>0.16.5</version>
65 <inherited>false</inherited>
66 <configuration>
67
68 <images>
69 <image>
70 <name>${image.name}</name>
71 <build>
72 <cleanup>try</cleanup>
73 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
74 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
75 <tags>
Dan Timoney687146e2017-04-25 08:43:30 -040076 <tag>${project.version}</tag>
Dan Timoney8f773512017-04-24 16:30:26 -040077 <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
78 <tag>${project.docker.latesttag.version}</tag>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050079 </tags>
80 </build>
81 </image>
82 </images>
83 </configuration>
84 <executions>
85 <execution>
86 <id>generate-images</id>
Timoney, Daniel (dt5972)15323be2017-04-25 12:40:01 +000087 <phase>package</phase>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -050088 <goals>
89 <goal>build</goal>
90 </goals>
91 </execution>
92
93 <execution>
94 <id>push-images</id>
95 <phase>deploy</phase>
96 <goals>
97 <goal>build</goal>
98 <goal>push</goal>
99 </goals>
100 </execution>
101 </executions>
102 </plugin>
103 <plugin>
104 <artifactId>maven-resources-plugin</artifactId>
105 <version>2.6</version>
106 <executions>
107 <execution>
108 <id>copy-dockerfile</id>
109 <goals>
110 <goal>copy-resources</goal>
111 </goals><!-- here the phase you need -->
112 <phase>validate</phase>
113 <configuration>
114 <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
115 <resources>
116 <resource>
117 <directory>src/main/docker</directory>
118 <includes>
119 <include>Dockerfile</include>
120 </includes>
121 <filtering>true</filtering>
122 </resource>
123 </resources>
124 </configuration>
125 </execution>
126 </executions>
127 </plugin>
128
129 <plugin>
130 <artifactId>exec-maven-plugin</artifactId>
131 <groupId>org.codehaus.mojo</groupId>
Timoney, Daniel (dt5972)12dc3ee2017-03-07 10:01:56 -0500132 <version>1.5.0</version>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500133 <executions>
Dan Timoneyb2175582017-03-31 17:47:19 -0400134 <execution>
Timoney, Daniel (dt5972)15323be2017-04-25 12:40:01 +0000135 <id>Make-stage-dir</id>
136 <phase>generate-sources</phase>
137 <goals>
138 <goal>exec</goal>
139 </goals>
140 <configuration>
141 <executable>/bin/mkdir</executable>
142 <arguments>
143 <argument>-p</argument>
144 <argument>${basedir}/target/docker-stage/opt/openecomp/sdnc</argument>
145 </arguments>
146 </configuration>
147 </execution>
148 <execution>
Dan Timoneyb2175582017-03-31 17:47:19 -0400149 <id>Unzip dgbuilder</id>
150 <phase>generate-sources</phase>
151 <goals>
152 <goal>exec</goal>
153 </goals>
154 <configuration>
155 <executable>/usr/bin/unzip</executable>
156 <arguments>
157 <argument>-d</argument>
158 <argument>${basedir}/target/docker-stage/opt/openecomp/sdnc</argument>
159 <argument>../../dgbuilder/target/*.zip</argument>
160 </arguments>
161 </configuration>
162 </execution>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500163 <execution>
164 <id>Copy dgbuilder</id>
165 <phase>generate-sources</phase>
166 <goals>
167 <goal>exec</goal>
168 </goals>
169 <configuration>
170 <executable>/bin/cp</executable>
171 <arguments>
172 <argument>-r</argument>
173 <argument>../../dgbuilder</argument>
174 <argument>${basedir}/target/docker-stage/opt/openecomp/sdnc</argument>
175 </arguments>
176 </configuration>
177 </execution>
178
179 <execution>
180 <id>dgbuilder createReleaseDir</id>
181 <phase>generate-sources</phase>
182 <goals>
183 <goal>exec</goal>
184 </goals>
185 <configuration>
186 <executable>/bin/bash</executable>
187 <arguments>
Dan Timoneyb2175582017-03-31 17:47:19 -0400188 <argument>${basedir}/target/docker-stage/opt/openecomp/sdnc/dgbuilder/createReleaseDir.sh</argument>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500189 <argument>1702</argument>
190 <argument>dguser</argument>
191 <argument>change_email_id@dgbuilder.com</argument>
192 </arguments>
193 </configuration>
194 </execution>
195
196 <execution>
197 <id>change shell permissions</id>
Dan Timoneyb2175582017-03-31 17:47:19 -0400198 <phase>process-sources</phase>
Timoney, Daniel (dt5972)324ee362017-02-15 10:37:53 -0500199 <goals>
200 <goal>exec</goal>
201 </goals>
202 <configuration>
203 <executable>/usr/bin/find</executable>
204 <arguments>
205 <argument>${basedir}/target/docker-stage/opt/openecomp/sdnc</argument>
206 <argument>-name</argument>
207 <argument>*.sh</argument>
208 <argument>-exec</argument>
209 <argument>chmod</argument>
210 <argument>+x</argument>
211 <argument>{}</argument>
212 <argument>;</argument>
213 </arguments>
214 </configuration>
215 </execution>
216 </executions>
217 </plugin>
218
219
220 </plugins>
221
222 </build>
223 <organization>
224 <name>openECOMP</name>
225 </organization>
226</project>