fix odl patches
[ccsdk/distribution.git] / dgbuilder-docker / pom.xml
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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3     <modelVersion>4.0.0</modelVersion>
4
5     <parent>
6         <groupId>org.onap.ccsdk.distribution</groupId>
7         <artifactId>distribution-root</artifactId>
8         <version>1.6.1-SNAPSHOT</version>
9     </parent>
10
11     <groupId>org.onap.ccsdk.distribution</groupId>
12     <artifactId>distribution-dgbuilder-docker</artifactId>
13     <packaging>pom</packaging>
14
15     <name>ccsdk-distribution :: dgbuilder-docker</name>
16     <description>Creates docker container for dgbuilder</description>
17     <organization>
18         <name>ONAP</name>
19     </organization>
20
21     <properties>
22         <image.name>onap/ccsdk-dgbuilder-image</image.name>
23     </properties>
24
25     <build>
26         <plugins>
27
28             <plugin>
29                 <groupId>org.codehaus.gmaven</groupId>
30                 <artifactId>groovy-maven-plugin</artifactId>
31                 <version>2.1.1</version>
32                 <executions>
33                     <execution>
34                         <phase>validate</phase>
35                         <goals>
36                             <goal>execute</goal>
37                         </goals>
38                         <configuration>
39                             <source>${basedir}/../src/main/scripts/TagSnapshotVersion.groovy</source>
40                         </configuration>
41                     </execution>
42                 </executions>
43             </plugin>
44             <plugin>
45                 <artifactId>maven-resources-plugin</artifactId>
46                 <version>2.6</version>
47                 <executions>
48                     <execution>
49                         <id>copy-dockerfile</id>
50                         <goals>
51                             <goal>copy-resources</goal>
52                         </goals><!-- here the phase you need -->
53                         <phase>validate</phase>
54                         <configuration>
55                             <outputDirectory>${basedir}/target/docker-stage</outputDirectory>
56                             <resources>
57                                 <resource>
58                                     <directory>src/main/docker</directory>
59                                     <includes>
60                                         <include>Dockerfile</include>
61                                     </includes>
62                                     <filtering>true</filtering>
63                                 </resource>
64                             </resources>
65                         </configuration>
66                     </execution>
67                 </executions>
68             </plugin>
69             <plugin>
70                 <groupId>org.apache.maven.plugins</groupId>
71                 <artifactId>maven-antrun-plugin</artifactId>
72                 <version>1.8</version>
73                 <executions>
74                     <execution>
75                         <id>make-stage-dir</id>
76                         <phase>generate-sources</phase>
77                         <configuration>
78                             <target>
79                                 <mkdir dir="${basedir}/target/docker-stage/opt/onap/ccsdk"/>
80                             </target>
81                         </configuration>
82                         <goals>
83                             <goal>run</goal>
84                         </goals>
85                     </execution>
86                     <execution>
87                         <id>unzip-dgbuilder</id>
88                         <phase>generate-sources</phase>
89                         <configuration>
90                             <target>
91                                 <unzip dest="${basedir}/target/docker-stage/opt/onap/ccsdk">
92                                     <fileset dir="${basedir}/../dgbuilder/target/">
93                                         <include name="**/*.zip"/>
94                                     </fileset>
95                                 </unzip>
96                             </target>
97                         </configuration>
98                         <goals>
99                             <goal>run</goal>
100                         </goals>
101                     </execution>
102                     <execution>
103                         <id>copy-dgbuilder</id>
104                         <phase>generate-sources</phase>
105                         <configuration>
106                             <target>
107                                 <copy todir="${basedir}/target/docker-stage/opt/onap/ccsdk/dgbuilder">
108                                     <fileset dir="${basedir}/../dgbuilder" excludes="target/**"/>
109                                 </copy>
110                             </target>
111                         </configuration>
112                         <goals>
113                             <goal>run</goal>
114                         </goals>
115                     </execution>
116                     <execution>
117                         <id>change shell permissions</id>
118                         <phase>process-sources</phase>
119                         <configuration>
120                             <target>
121                                 <chmod dir="${basedir}/target/docker-stage/opt/onap/ccsdk" perm="+x" includes="**/*.sh"/>
122                             </target>
123                         </configuration>
124                         <goals>
125                             <goal>run</goal>
126                         </goals>
127                     </execution>
128                 </executions>
129             </plugin>
130         </plugins>
131     </build>
132
133     <profiles>
134         <profile>
135             <id>unix</id>
136             <activation>
137                 <os>
138                     <family>unix</family>
139                 </os>
140             </activation>
141             <build>
142                 <plugins>
143                     <plugin>
144                         <groupId>org.codehaus.mojo</groupId>
145                         <artifactId>exec-maven-plugin</artifactId>
146                         <version>1.5.0</version>
147                         <executions>
148                             <!-- TODO: Need to see alternate for below, so that it can execute on Windows Environment -->
149                             <execution>
150                                 <id>dgbuilder-createReleaseDir</id>
151                                 <phase>generate-sources</phase>
152                                 <goals>
153                                     <goal>exec</goal>
154                                 </goals>
155                                 <configuration>
156                                     <executable>/bin/bash</executable>
157                                     <arguments>
158                                         <argument>${basedir}/target/docker-stage/opt/onap/ccsdk/dgbuilder/createReleaseDir.sh</argument>
159                                         <argument>1702</argument>
160                                         <argument>dguser</argument>
161                                         <argument>change_email_id@dgbuilder.com</argument>
162                                     </arguments>
163                                 </configuration>
164                             </execution>
165                         </executions>
166                     </plugin>
167                 </plugins>
168             </build>
169         </profile>
170         <profile>
171             <id>docker</id>
172             <build>
173                 <plugins>
174                     <plugin>
175                         <groupId>io.fabric8</groupId>
176                         <artifactId>docker-maven-plugin</artifactId>
177                         <version>0.34.0</version>
178                         <inherited>false</inherited>
179                         <configuration>
180                             <images>
181                                 <image>
182                                     <name>${image.name}</name>
183                                     <build>
184                                         <cleanup>try</cleanup>
185                                         <noCache>true</noCache>
186                                         <contextDir>${basedir}/target/docker-stage</contextDir>
187                                         <dockerFile>Dockerfile</dockerFile>
188                                         <tags>
189                                             <tag>${project.docker.latestminortag.snapshot.version}</tag>
190                                             <tag>${project.docker.latestfulltag.snapshot.version}</tag>
191                                             <tag>${project.docker.latesttagtimestamp.snapshot.version}</tag>
192                                         </tags>
193                                     </build>
194                                 </image>
195                             </images>
196                             <verbose>${docker.verbose}</verbose>
197                             <skipPush>${docker.skip.push}</skipPush>
198                         </configuration>
199                         <executions>
200                             <execution>
201                                 <id>build-push-images</id>
202                                 <goals>
203                                     <goal>build</goal>
204                                     <goal>push</goal>
205                                 </goals>
206                             </execution>
207                         </executions>
208                     </plugin>
209                 </plugins>
210             </build>
211         </profile>
212     </profiles>
213 </project>