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