Support the pushing of docker images 68/1568/1
authorRehanRaza <muhammad.rehan.raza@est.tech>
Wed, 13 Nov 2019 14:29:17 +0000 (15:29 +0100)
committerRehanRaza <muhammad.rehan.raza@est.tech>
Wed, 13 Nov 2019 14:29:27 +0000 (15:29 +0100)
Change-Id: I89a09ec832ee1930d2783a674831ef4ce604e0ae
Signed-off-by: RehanRaza <muhammad.rehan.raza@est.tech>
dashboard/webapp-backend/pom.xml
near-rt-ric-simulator/nearric-service/Dockerfile [deleted file]
near-rt-ric-simulator/nearric-service/container-tag.yaml [deleted file]
near-rt-ric-simulator/nearric-service/pom.xml
pom.xml
sdnc-a1-controller/oam/installation/sdnc/pom.xml
sdnc-a1-controller/oam/installation/src/main/yaml/docker-compose.yml

index a7100be..4519170 100644 (file)
@@ -257,7 +257,7 @@ limitations under the License.
                                                <image>
                                                        <!-- Specify a tag to avoid default tag "latest" -->
                                                        <!-- Avoid maven artifact name here -->
-                                                       <name>ric-dashboard:${project.version}</name>
+                                                       <name>nonrtric-dashboard:${project.version}</name>
                                                        <build>
                                                                <from>openjdk:11-jre-slim</from>
                                                                <tags>
diff --git a/near-rt-ric-simulator/nearric-service/Dockerfile b/near-rt-ric-simulator/nearric-service/Dockerfile
deleted file mode 100644 (file)
index a56687a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-
-FROM openjdk:11-jre-slim
-
-ARG JAR_FILE
-
-WORKDIR /opt/app/nearricsimulator
-
-COPY ${JAR_FILE} nearric-simulator.jar
-
-ENTRYPOINT ["java", "-jar", "/opt/app/nearricsimulator/nearric-simulator.jar"]
\ No newline at end of file
diff --git a/near-rt-ric-simulator/nearric-service/container-tag.yaml b/near-rt-ric-simulator/nearric-service/container-tag.yaml
deleted file mode 100644 (file)
index 62ee399..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# The Jenkins job requires a tag to build the Docker image.
-# Global-JJB script assumes this file is in the repo root.
----
-tag: 1.0.0
\ No newline at end of file
index fcd5f86..85650f4 100644 (file)
                                        </execution>
                                </executions>
                        </plugin>
-                       <plugin>
-                               <groupId>com.spotify</groupId>
-                               <artifactId>dockerfile-maven-plugin</artifactId>
-                               <version>${dockerfile-maven-version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>default</id>
-                                               <goals>
-                                                       <goal>build</goal>
-                                                       <goal>push</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <repository>nearric-simulator</repository>
-                                       <tag>${project.version}</tag>
-                                       <buildArgs>
-                                               <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
-                                       </buildArgs>
-                               </configuration>
+            <plugin>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>0.30.0</version>
+                <configuration>
+                    <verbose>true</verbose>
+                    <!-- environment variables supplied by Jenkins -->
+                    <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
+                    <images>
+                        <image>
+                            <!-- Specify a tag to avoid default tag "latest" -->
+                            <!-- Avoid maven artifact name here -->
+                            <name>nearric-simulator:${project.version}</name>
+                            <build>
+                                <from>openjdk:11-jre-slim</from>
+                                <tags>
+                                    <!-- Add tag with build number -->
+                                    <tag>${project.version}</tag>
+                                </tags>
+                                <assembly>
+                                    <descriptorRef>artifact</descriptorRef>
+                                </assembly>
+                                <cmd>
+                                    <!-- Include maven dir on classpath for prop files -->
+                                    <exec>
+                                        <arg>java</arg>
+                                        <arg>-Xms128m</arg>
+                                        <arg>-Xmx256m</arg>
+                                        <arg>-cp</arg>
+                                        <arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
+                                        <arg>-Dloader.main=org.onap.nearric.simulator.config.NearRicApplication</arg>
+                                        <arg>-Djava.security.egd=file:/dev/./urandom</arg>
+                                        <arg>org.springframework.boot.loader.PropertiesLauncher</arg>
+                                    </exec>
+                                </cmd>
+                            </build>
+                        </image>
+                    </images>
+                </configuration>
+                <!-- build Docker images in install phase, push in deploy phase -->
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build</goal>
+                            <goal>push</goal>
+                        </goals>
+                    </execution>
+                </executions>
                 <dependencies>
                     <dependency>
                         <groupId>javax.activation</groupId>
                         <version>1.1.1</version>
                     </dependency>
                 </dependencies>
-                       </plugin>
+            </plugin>
                </plugins>
        </build>
 </project>
diff --git a/pom.xml b/pom.xml
index c80c558..7ac3a79 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
        <name>nonrtric</name>
        <modules>
                <module>dashboard</module>
-               <module>sdnc-a1-controller</module>
                <module>near-rt-ric-simulator</module>
+               <module>sdnc-a1-controller</module>
        </modules>
 </project>
index ea1a52b..352fe17 100644 (file)
@@ -26,7 +26,7 @@
 
     <properties>
         <image.name>onap/sdnc-aaf-image</image.name>
-        <standalone.image.name>onap/sdnc-image</standalone.image.name>
+        <standalone.image.name>nonrtric-a1-controller</standalone.image.name>
         <sdnc.project.version>${project.version}</sdnc.project.version>
         <sdnc.build.timestamp>${maven.build.timestamp}</sdnc.build.timestamp>
         <sdnc.northbound.version>1.7.3-SNAPSHOT</sdnc.northbound.version>
             <plugin>
                 <groupId>io.fabric8</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
-                <version>0.28.0</version>
+                <version>0.30.0</version>
                 <inherited>false</inherited>
                 <executions>
                    <execution>
                       <goal>push</goal>
                      </goals>
                      <configuration>
+                       <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
                        <images>
                         <image>
                          <name>${standalone.image.name}</name>
index 97bca6d..15c534e 100644 (file)
@@ -22,8 +22,8 @@ services:
         max-size: "30m"
         max-file: "5"
 
-  sdnc:
-    image: onap/sdnc-image:latest
+  a1-controller:
+    image: nonrtric-a1-controller:latest
     depends_on :
       - db
     container_name: sdnc_controller_container