datalake add multiple docker image tag and push 68/103568/1
authorKate Hsuan <kate.hsuan@qct.io>
Thu, 12 Mar 2020 07:48:48 +0000 (07:48 +0000)
committerKate Hsuan <kate.hsuan@qct.io>
Thu, 12 Mar 2020 07:48:48 +0000 (07:48 +0000)
Issue-ID: DCAEGEN2-2008
Signed-off-by: Kate Hsuan <kate.hsuan@qct.io>
Change-Id: Ic0c5ea2047ed7be19cab3edc8a403df53dcc74cd

components/datalake-handler/admin/pom.xml
components/datalake-handler/feeder/pom.xml

index 509d40a..cd6e3e8 100644 (file)
@@ -17,6 +17,7 @@
                <swagger.version>2.9.2</swagger.version>
                <dockerfile-maven.version>1.4.5</dockerfile-maven.version>
                <docker.image.path>onap/org.onap.dcaegen2.services.datalakeadminui</docker.image.path>
+               <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
        </properties>
        <name>DataLake Admin</name>
        <build>
                                     <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
                                     <tag>${project.version}</tag>
                                     <dockerfile>Dockerfile</dockerfile>
-                                </configuration>
+                               </configuration>
+                               <executions>
+                                       <execution>
+                                               <id>build-datalake-admin-ui-image</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>build</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-latest</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>tag</goal>
+                                                       <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>latest</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-with-version</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>tag</goal>
+                                                       <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>${project.version}</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-with-version-and-date</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>tag</goal>
+                                                       <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>${project.version}-${maven.build.timestamp}Z</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>
+                                       </execution>
+                               </executions>
                                 <dependencies>
                                         <dependency>
                                                 <groupId>javax.activation</groupId>
index f0be2a8..baf1a9f 100644 (file)
@@ -18,6 +18,8 @@
                <swagger.version>2.9.2</swagger.version>
                <dockerfile-maven.version>1.4.5</dockerfile-maven.version>
                <docker.image.path>onap/org.onap.dcaegen2.services.datalakefeeder</docker.image.path>
+               <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
+
        </properties>
 
        <dependencies>
                                                <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                                        </buildArgs>
                                </configuration>
+                               <executions>
+                                       <execution>
+                                               <id>build-sl-feeder-image</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                   <goal>build</goal>
+                                               </goals>
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-latest</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                   <goal>tag</goal>
+                                                   <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>latest</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>        
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-with-version</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                   <goal>tag</goal>
+                                                   <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>${project.version}</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>        
+                                       </execution>
+                                       <execution>
+                                               <id>tag-and-push-image-with-version-and-date</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                   <goal>tag</goal>
+                                                   <goal>push</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <repository>${onap.nexus.dockerregistry.daily}/${docker.image.path}</repository>
+                                                       <tag>${project.version}-${maven.build.timestamp}Z</tag>
+                                                       <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
+                                               </configuration>
+                                       </execution>
+                               </executions>
                                <dependencies>
                                        <!-- To make this work on JDK 9+ -->
                                        <dependency>