a857723b05e1faa633366b43a19b14df2d597b7a
[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.1.2-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.groovy.maven</groupId>
30                 <artifactId>gmaven-plugin</artifactId>
31                 <version>1.0</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
70             <plugin>
71                 <groupId>org.codehaus.mojo</groupId>
72                 <artifactId>exec-maven-plugin</artifactId>
73                 <version>1.5.0</version>
74                 <executions>
75                     <execution>
76                         <id>Make-stage-dir</id>
77                         <phase>generate-sources</phase>
78                         <goals>
79                             <goal>exec</goal>
80                         </goals>
81                         <configuration>
82                             <executable>/bin/mkdir</executable>
83                             <arguments>
84                                 <argument>-p</argument>
85                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
86                             </arguments>
87                         </configuration>
88                     </execution>
89                     <execution>
90                         <id>Unzip dgbuilder</id>
91                         <phase>generate-sources</phase>
92                         <goals>
93                             <goal>exec</goal>
94                         </goals>
95                         <configuration>
96                             <executable>/usr/bin/unzip</executable>
97                             <arguments>
98                                 <argument>-d</argument>
99                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
100                                 <argument>../dgbuilder/target/*.zip</argument>
101                             </arguments>
102                         </configuration>
103                     </execution>
104                     <execution>
105                         <id>Copy dgbuilder</id>
106                         <phase>generate-sources</phase>
107                         <goals>
108                             <goal>exec</goal>
109                         </goals>
110                         <configuration>
111                             <executable>/bin/cp</executable>
112                             <arguments>
113                                 <argument>-r</argument>
114                                 <argument>../dgbuilder</argument>
115                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
116                             </arguments>
117                         </configuration>
118                     </execution>
119
120                     <execution>
121                         <id>dgbuilder createReleaseDir</id>
122                         <phase>generate-sources</phase>
123                         <goals>
124                             <goal>exec</goal>
125                         </goals>
126                         <configuration>
127                             <executable>/bin/bash</executable>
128                             <arguments>
129                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk/dgbuilder/createReleaseDir.sh</argument>
130                                 <argument>1702</argument>
131                                 <argument>dguser</argument>
132                                 <argument>change_email_id@dgbuilder.com</argument>
133                             </arguments>
134                         </configuration>
135                     </execution>
136
137                     <execution>
138                         <id>change shell permissions</id>
139                         <phase>process-sources</phase>
140                         <goals>
141                             <goal>exec</goal>
142                         </goals>
143                         <configuration>
144                             <executable>/usr/bin/find</executable>
145                             <arguments>
146                                 <argument>${basedir}/target/docker-stage/opt/onap/ccsdk</argument>
147                                 <argument>-name</argument>
148                                 <argument>*.sh</argument>
149                                 <argument>-exec</argument>
150                                 <argument>chmod</argument>
151                                 <argument>+x</argument>
152                                 <argument>{}</argument>
153                                 <argument>;</argument>
154                             </arguments>
155                         </configuration>
156                     </execution>
157                 </executions>
158             </plugin>
159         </plugins>
160     </build>
161
162     <profiles>
163         <profile>
164             <id>docker</id>
165             <build>
166                 <plugins>
167                     <plugin>
168                         <groupId>io.fabric8</groupId>
169                         <artifactId>docker-maven-plugin</artifactId>
170                         <version>0.34.0</version>
171                         <inherited>false</inherited>
172                         <configuration>
173                             <images>
174                                 <image>
175                                     <name>${image.name}</name>
176                                     <build>
177                                         <cleanup>try</cleanup>
178                                         <contextDir>${basedir}/target/docker-stage</contextDir>
179                                         <dockerFile>Dockerfile</dockerFile>
180                                         <tags>
181                                             <tag>${project.docker.latestminortag.snapshot.version}</tag>
182                                             <tag>${project.docker.latestfulltag.snapshot.version}</tag>
183                                             <tag>${project.docker.latesttagtimestamp.snapshot.version}</tag>
184                                         </tags>
185                                     </build>
186                                 </image>
187                             </images>
188                             <verbose>${docker.verbose}</verbose>
189                             <skipPush>${docker.skip.push}</skipPush>
190                         </configuration>
191                         <executions>
192                             <execution>
193                                 <id>build-push-images</id>
194                                 <goals>
195                                     <goal>build</goal>
196                                     <goal>push</goal>
197                                 </goals>
198                             </execution>
199                         </executions>
200                     </plugin>
201                 </plugins>
202             </build>
203         </profile>
204     </profiles>
205 </project>