Fix CCSDK docker version
[sdnc/oam.git] / installation / dgbuilder / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5
6         <parent>
7                 <groupId>org.onap.ccsdk.parent</groupId>
8                 <artifactId>odlparent-lite</artifactId>
9                 <version>1.1.2-SNAPSHOT</version>
10         </parent>
11
12         <modelVersion>4.0.0</modelVersion>
13         <packaging>pom</packaging>
14         <groupId>org.onap.sdnc.oam</groupId>
15         <artifactId>installation-dgbuilder</artifactId>
16         <version>1.3.2-SNAPSHOT</version>
17
18         <name>sdnc-oam :: installation :: ${project.artifactId}</name>
19         <description>Creates docker container for dgbuilder</description>
20
21         <properties>
22                 <image.name>onap/dgbuilder-sdnc-image</image.name>
23                 <sdnc.project.version>${project.version}</sdnc.project.version>
24                 <ccsdk.docker.version>0.3-STAGING-latest</ccsdk.docker.version>
25         </properties>
26
27
28         <build>
29                 <plugins>
30
31
32                         <plugin>
33                                 <groupId>org.codehaus.groovy.maven</groupId>
34                                 <artifactId>gmaven-plugin</artifactId>
35                                 <executions>
36                                         <execution>
37                                                 <phase>validate</phase>
38                                                 <goals>
39                                                         <goal>execute</goal>
40                                                 </goals>
41                                                 <configuration>
42                                                         <source>
43                                                                 println project.properties['sdnc.project.version'];
44                                                                 def
45                                                                 versionArray;
46                                                                 if ( project.properties['sdnc.project.version'] !=
47                                                                 null ) {
48                                                                 versionArray =
49                                                                 project.properties['sdnc.project.version'].split('\\.');
50                                                                 }
51
52                                                                 if
53                                                                 (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT"))
54                                                                 {
55                                                                 project.properties['project.docker.latesttag.version']=versionArray[0]
56                                                                 + '.' + versionArray[1] + "-STAGING-latest";
57                                                                 } else {
58                                                                 project.properties['project.docker.latesttag.version']=versionArray[0]
59                                                                 + '.' + versionArray[1] + "-STAGING-latest";
60                                                                 }
61
62                                                                 println 'New Tag
63                                                                 for docker:' +
64                                                                 project.properties['project.docker.latesttag.version'];
65                                                         </source>
66                                                 </configuration>
67                                         </execution>
68                                 </executions>
69                         </plugin>
70                         <plugin>
71                                 <groupId>io.fabric8</groupId>
72                                 <artifactId>docker-maven-plugin</artifactId>
73                                 <version>0.16.5</version>
74                                 <inherited>false</inherited>
75                                 <configuration>
76
77                                         <images>
78                                                 <image>
79                                                         <name>${image.name}</name>
80                                                         <build>
81                                                                 <cleanup>try</cleanup>
82                                                                 <dockerFileDir>${basedir}/target/docker-stage</dockerFileDir>
83                                                                 <dockerFile>${basedir}/target/docker-stage/Dockerfile</dockerFile>
84                                                                 <tags>
85                                                                         <tag>${project.version}</tag>
86                                                                         <tag>${project.version}-STAGING-${maven.build.timestamp}</tag>
87                                                                         <tag>${project.docker.latesttag.version}</tag>
88                                                                 </tags>
89                                                         </build>
90                                                 </image>
91                                         </images>
92                                 </configuration>
93                                 <executions>
94                                         <execution>
95                                                 <id>generate-images</id>
96                                                 <phase>package</phase>
97                                                 <goals>
98                                                         <goal>build</goal>
99                                                 </goals>
100                                         </execution>
101
102                                         <execution>
103                                                 <id>push-images</id>
104                                                 <phase>deploy</phase>
105                                                 <goals>
106                                                         <goal>build</goal>
107                                                         <goal>push</goal>
108                                                 </goals>
109                                         </execution>
110                                 </executions>
111                         </plugin>
112                         <plugin>
113                                 <artifactId>maven-resources-plugin</artifactId>
114                                 <version>2.6</version>
115                                 <executions>
116                                         <execution>
117                                                 <id>copy-dockerfile</id>
118                                                 <goals>
119                                                         <goal>copy-resources</goal>
120                                                 </goals><!-- here the phase you need -->
121                                                 <phase>validate</phase>
122                                                 <configuration>
123                                                         <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
124                                                         <resources>
125                                                                 <resource>
126                                                                         <directory>src/main/docker</directory>
127                                                                         <includes>
128                                                                                 <include>Dockerfile</include>
129                                                                         </includes>
130                                                                         <filtering>true</filtering>
131                                                                 </resource>
132                                                         </resources>
133                                                 </configuration>
134                                         </execution>
135                                 </executions>
136                         </plugin>
137
138                         <plugin>
139                                 <artifactId>exec-maven-plugin</artifactId>
140                                 <groupId>org.codehaus.mojo</groupId>
141                                 <version>1.5.0</version>
142                                 <executions>
143                                         <execution>
144                                                 <id>Make-stage-dir</id>
145                                                 <phase>generate-sources</phase>
146                                                 <goals>
147                                                         <goal>exec</goal>
148                                                 </goals>
149                                                 <configuration>
150                                                         <executable>/bin/mkdir</executable>
151                                                         <arguments>
152                                                                 <argument>-p</argument>
153                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
154                                                         </arguments>
155                                                 </configuration>
156                                         </execution>
157                                         <execution>
158                                                 <id>Unzip dgbuilder</id>
159                                                 <phase>generate-sources</phase>
160                                                 <goals>
161                                                         <goal>exec</goal>
162                                                 </goals>
163                                                 <configuration>
164                                                         <executable>/usr/bin/unzip</executable>
165                                                         <arguments>
166                                                                 <argument>-d</argument>
167                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
168                                                                 <argument>../../dgbuilder/target/*.zip</argument>
169                                                         </arguments>
170                                                 </configuration>
171                                         </execution>
172                                         <execution>
173                                                 <id>Copy dgbuilder</id>
174                                                 <phase>generate-sources</phase>
175                                                 <goals>
176                                                         <goal>exec</goal>
177                                                 </goals>
178                                                 <configuration>
179                                                         <executable>/bin/cp</executable>
180                                                         <arguments>
181                                                                 <argument>-r</argument>
182                                                                 <argument>../../dgbuilder</argument>
183                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
184                                                         </arguments>
185                                                 </configuration>
186                                         </execution>
187
188                                         <execution>
189                                                 <id>dgbuilder createReleaseDir</id>
190                                                 <phase>generate-sources</phase>
191                                                 <goals>
192                                                         <goal>exec</goal>
193                                                 </goals>
194                                                 <configuration>
195                                                         <executable>/bin/bash</executable>
196                                                         <arguments>
197                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc/dgbuilder/createReleaseDir.sh</argument>
198                                                                 <argument>1702</argument>
199                                                                 <argument>dguser</argument>
200                                                                 <argument>change_email_id@dgbuilder.com</argument>
201                                                         </arguments>
202                                                 </configuration>
203                                         </execution>
204
205                                         <execution>
206                                                 <id>change shell permissions</id>
207                                                 <phase>process-sources</phase>
208                                                 <goals>
209                                                         <goal>exec</goal>
210                                                 </goals>
211                                                 <configuration>
212                                                         <executable>/usr/bin/find</executable>
213                                                         <arguments>
214                                                                 <argument>${basedir}/target/docker-stage/opt/onap/sdnc</argument>
215                                                                 <argument>-name</argument>
216                                                                 <argument>*.sh</argument>
217                                                                 <argument>-exec</argument>
218                                                                 <argument>chmod</argument>
219                                                                 <argument>+x</argument>
220                                                                 <argument>{}</argument>
221                                                                 <argument>;</argument>
222                                                         </arguments>
223                                                 </configuration>
224                                         </execution>
225                                 </executions>
226                         </plugin>
227
228
229                 </plugins>
230
231         </build>
232         <organization>
233                 <name>openECOMP</name>
234         </organization>
235 </project>