7915e2e402d0ecf8bd4d29eae0354d9cde299b20
[sdc.git] / openecomp-be / dist / sdc-onboard-backend-docker / pom.xml
1 <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
2     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     <name>openecomp-sdc-docker-backend</name>
6     <artifactId>openecomp-sdc-docker-backend</artifactId>
7     <packaging>pom</packaging>
8
9     <parent>
10         <groupId>org.openecomp.sdc</groupId>
11         <artifactId>openecomp-sdc-docker-dist</artifactId>
12         <version>1.13.1-SNAPSHOT</version>
13     </parent>
14
15     <properties>
16         <docker.image.name>sdc-onboard-backend</docker.image.name>
17     </properties>
18     <dependencies>
19         <dependency>
20             <groupId>org.openecomp.sdc.onboarding</groupId>
21             <artifactId>api-docs</artifactId>
22             <type>war</type>
23             <version>${project.version}</version>
24         </dependency>
25     </dependencies>
26     <profiles>
27         <profile>
28             <id>docker</id>
29             <activation>
30                 <activeByDefault>false</activeByDefault>
31             </activation>
32             <build>
33                 <plugins>
34                     <plugin>
35                         <groupId>org.apache.maven.plugins</groupId>
36                         <artifactId>maven-clean-plugin</artifactId>
37                         <executions>
38                             <execution>
39                                 <id>clean files</id>
40                                 <phase>clean</phase>
41                                 <goals>
42                                     <goal>clean</goal>
43                                 </goals>
44                                 <configuration>
45                                     <filesets>
46                                         <fileset>
47                                             <directory>${project.basedir}/artifacts/</directory>
48                                             <followSymlinks>false</followSymlinks>
49                                             <includes>
50                                                 <include>*.war</include>
51                                                 <include>onboarding_configuration.yaml</include>
52                                                 <include>logback.xml</include>
53                                             </includes>
54                                         </fileset>
55                                     </filesets>
56                                 </configuration>
57                             </execution>
58                         </executions>
59                     </plugin>
60
61                     <plugin>
62                         <artifactId>maven-resources-plugin</artifactId>
63                         <version>3.0.2</version>
64                         <executions>
65                             <execution>
66                                 <id>copy-resources-war</id>
67                                 <phase>verify</phase>
68                                 <goals>
69                                     <goal>copy-resources</goal>
70                                 </goals>
71                                 <configuration>
72                                     <outputDirectory>${project.basedir}/artifacts</outputDirectory>
73                                     <resources>
74                                         <resource>
75                                             <directory>
76                                                 ${project.parent.basedir}/../../openecomp-be/tools/swagger-ui/target/api-docs
77                                             </directory>
78                                             <includes>
79                                                 <include>api-docs.war</include>
80                                             </includes>
81                                         </resource>
82                                         <resource>
83                                             <directory>
84                                                 ${project.parent.basedir}/../../openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target
85                                             </directory>
86                                             <includes>
87                                                 <include>onboarding-be-${project.version}.war</include>
88                                             </includes>
89                                         </resource>
90                                         <resource>
91                                             <directory>
92                                                 ${project.parent.basedir}/../../openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-worker/src/main/resources
93                                             </directory>
94                                             <includes>
95                                                 <include>onboarding_configuration.yaml</include>
96                                             </includes>
97                                         </resource>
98                                         <resource>
99                                             <directory>
100                                                 ${project.parent.basedir}/../../catalog-be/src/main/resources/config
101                                             </directory>
102                                             <includes>
103                                                 <include>logback.xml</include>
104                                             </includes>
105                                         </resource>
106                                     </resources>
107                                 </configuration>
108                             </execution>
109                         </executions>
110                     </plugin>
111
112                     <plugin>
113                         <groupId>io.fabric8</groupId>
114                         <artifactId>docker-maven-plugin</artifactId>
115                         <configuration>
116                             <verbose>${verbose}</verbose>
117                             <apiVersion>${docker.api.version}</apiVersion>
118                             <registry>${docker.registry}</registry>
119                             <authConfig>
120                                 <pull>
121                                     <username>${docker.username}</username>
122                                     <password>${docker.password}</password>
123                                 </pull>
124                             </authConfig>
125                             <images>
126
127                                 <!-- Build backend image -->
128                                 <image>
129                                     <name>${docker.namespace}/${docker.image.name}</name>
130                                     <alias>${docker.image.name}</alias>
131                                     <build>
132                                         <cleanup>try</cleanup>
133                                         <dockerFileDir>${project.basedir}/artifacts</dockerFileDir>
134                                         <tags>
135                                             <tag>latest</tag>
136                                             <tag>
137                                                 ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest
138                                             </tag>
139                                             <tag>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-${maven.build.timestamp}</tag>
140                                         </tags>
141                                     </build>
142                                 </image>
143                             </images>
144                         </configuration>
145                         <executions>
146                             <execution>
147                                 <id>clean-images</id>
148                                 <phase>pre-clean</phase>
149                                 <goals>
150                                     <goal>remove</goal>
151                                 </goals>
152                                 <configuration>
153                                     <removeAll>true</removeAll>
154                                     <image>${docker.namespace}/${docker.image.name}</image>
155                                 </configuration>
156                             </execution>
157
158                             <execution>
159                                 <id>generate-images</id>
160                                 <phase>install</phase>
161                                 <goals>
162                                     <goal>build</goal>
163                                 </goals>
164                             </execution>
165
166                             <execution>
167                                 <id>push-images</id>
168                                 <phase>deploy</phase>
169                                 <goals>
170                                     <goal>push</goal>
171                                 </goals>
172                                 <configuration>
173                                     <image>${docker.namespace}/${docker.image.name}</image>
174                                 </configuration>
175                             </execution>
176                         </executions>
177                     </plugin>
178                 </plugins>
179             </build>
180         </profile>
181     </profiles>
182 </project>