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