Update installation to handle case /etc/ssl/certs not found 07/115107/1
authorDan Timoney <dtimoney@att.com>
Thu, 19 Nov 2020 15:09:21 +0000 (10:09 -0500)
committerDan Timoney <dtimoney@att.com>
Thu, 19 Nov 2020 15:09:27 +0000 (10:09 -0500)
Updated ca cert installation to handle case correctly where /etc/ssl/certs
directory is not found. Alsp, added integration testing of
standalone sdnc container.

Change-Id: Iabb3b6f921f52e533f1a920c3afa68a024788667
Issue-ID: SDNC-1419
Signed-off-by: Dan Timoney <dtimoney@att.com>
Former-commit-id: 3ee44123de572df9ff2990ef2aedc0891b658285

installation/sdnc/pom.xml
installation/sdnc/src/main/docker/Dockerfile
installation/sdnc/src/main/docker/standalone.Dockerfile

index a0c42a4..ae7c9dd 100644 (file)
@@ -31,7 +31,8 @@
         <sdnc.secureport>8443</sdnc.secureport>
         <docker.buildArg.https_proxy>${https_proxy}</docker.buildArg.https_proxy>
         <docker.push.phase>deploy</docker.push.phase>
-        <docker.verbose>true</docker.verbose>
+        <docker.verbose>true</docker.verbose> 
+        <docker.autoCreateCustomNetworks>true</docker.autoCreateCustomNetworks>
         <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
     </properties>
 
                            </images>
                           </configuration>
                     </execution>
+                    <execution>
+                        <id>start-it-instance</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                        <configuration>
+                            <images>
+                                <image>
+                                    <name>mariadb:10.5</name>
+                                    <alias>sdnc-db</alias>
+                                    <run>
+                                        <env>
+                                            <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
+                                            <MYSQL_USER>sdnctl</MYSQL_USER>
+                                            <MYSQL_PASSWORD>gamma</MYSQL_PASSWORD>
+                                            <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
+                                        </env>
+                                        <network>
+                                            <mode>custom</mode>
+                                            <name>sdnc</name>
+                                            <alias>dbhost</alias>
+                                            <alias>sdnctldb01</alias>
+                                            <alias>sdnctldb02</alias>
+                                        </network>
+                                        <ports>
+                                            <port>sdncdb.port:3306</port>
+                                        </ports>
+                                        <log>
+                                            <enabled>true</enabled>
+                                        </log>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>${image.name}:${project.docker.latesttagtimestamp.version}</name>
+                                    <alias>sdnc-container</alias>
+                                    <run>
+                                        <env>
+                                            <MYSQL_ROOT_PASSWORD>itsASecret</MYSQL_ROOT_PASSWORD>
+                                            <MYSQL_USER>sdnctl</MYSQL_USER>
+                                            <MYSQL_PASSWORD>gamma</MYSQL_PASSWORD>
+                                            <MYSQL_DATABASE>sdnctl</MYSQL_DATABASE>
+                                            <SDNC_CONFIG_DIR>/opt/onap/sdnc/data/properties</SDNC_CONFIG_DIR>
+                                            <KARAF_CONSOLE_LOG_LEVEL>INFO</KARAF_CONSOLE_LOG_LEVEL>
+                                        </env>
+                                        <dependsOn>
+                                            <container>sdnc-db</container>
+                                        </dependsOn>
+                                        <network>
+                                            <mode>custom</mode>
+                                            <name>sdnc</name>
+                                            <alias>sdnc</alias>
+                                        </network>>
+                                        <ports>
+                                            <port>sdnc.port:8181</port>
+                                        </ports>
+                                        <wait>
+                                            <log>all warp coils are now operating at peak efficiency</log>
+                                            <time>120000</time>
+                                        </wait>
+                                        <log>
+                                            <enabled>true</enabled>
+                                        </log>
+                                    </run>
+                                </image>
+                            </images>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>stop-it-instance</id>
+                        <phase>post-integration-test</phase>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
                     <execution>
                       <id>push-images</id>
                       <phase>${docker.push.phase}</phase>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <executions>
+                  <execution>
+                    <goals>
+                      <goal>integration-test</goal>
+                      <goal>verify</goal>
+                    </goals>
+                  </execution>
+                </executions>
+                <configuration>
+                  <skipITs>false</skipITs>
+                  <environmentVariables>
+                    <SDNC_PORT>${sdnc.port}</SDNC_PORT>
+                  </environmentVariables>
+                </configuration>
+              </plugin>
         </plugins>
     </build>
 </project>
index a4768ba..4ff33ac 100755 (executable)
@@ -46,10 +46,9 @@ COPY aaa-app-config.xml $ODL_HOME/etc/opendaylight/datastore/initial/config/
 RUN echo "cadi_prop_files=$SDNC_CONFIG_DIR/org.onap.sdnc.props" >> $ODL_HOME/etc/system.properties
 
 # Install ssl and java certificates
-COPY truststoreONAPall.jks $JAVA_SECURITY_DIR
 COPY truststoreONAPall.jks $SDNC_STORE_DIR
-RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts  -deststorepass changeit -noprompt
-RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts  -deststorepass changeit -noprompt
+RUN if [ -f $JAVA_SECURITY_DIR}/cacerts ] ; then keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts  -deststorepass changeit -noprompt ; fi
+RUN keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts  -deststorepass changeit -noprompt
 
 # Secure with TLS
 RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties
index 58907dc..5f0f825 100755 (executable)
@@ -44,10 +44,9 @@ RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all, sdnr-northbound
 RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g"  $ODL_HOME/etc/org.apache.karaf.features.cfg
 
 # Install ssl and java certificates
-COPY truststoreONAPall.jks $JAVA_SECURITY_DIR
 COPY truststoreONAPall.jks $SDNC_STORE_DIR
-RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts  -deststorepass changeit -noprompt
-RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts  -deststorepass changeit -noprompt
+RUN if [ -f $JAVA_SECURITY_DIR}/cacerts ] ; then keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts  -deststorepass changeit -noprompt ; fi
+RUN keytool -importkeystore -srckeystore $SDNC_STORE_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore /opt/java/openjdk/lib/security/cacerts  -deststorepass changeit -noprompt
 
 
 # Secure with TLS