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

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use