- error = new Exception("Smoke test failed")
- currentBuild.result = 'FAILURE'
- }
- }
- }
-
- if ( params.DO_STAGE_4 ) {
- // override stage_archive to only archive on stable
- stage_archive = false
- stage("System Integration Test") {
- if ( params.DO_ROBOT ) {
- if (params.DO_RBAC) {
- sh "docker service update ${container_name}_nbi --force --env-add OSMNBI_AUTHENTICATION_BACKEND=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_URL=keystone --env-add OSMNBI_AUTHENTICATION_AUTH_PORT=5000 --env-add OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME=default --env-add OSMNBI_AUTHENTICATION_SERVICE_USERNAME=nbi --env-add OSMNBI_AUTHENTICATION_SERVICE_PROJECT=service"
- sh "installers/osm_health.sh -w 30 -s ${container_name}"
+ // Run -k8s installer here specifying internal docker registry and docker proxy
+ withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'gitlab-registry',
+ usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
+ sshCommand remote: remote, command: """
+ ./install_osm.sh -y \
+ ${repo_base_url} \
+ ${repo_key_name} \
+ ${release} -r unstable \
+ -d ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \
+ -p ${INTERNAL_DOCKER_PROXY} \
+ -t ${container_name} \
+ --nocachelxdimages
+ """
+ }
+ prometheusHostname = IP_ADDRESS
+ prometheusPort = 9091
+ osmHostname = IP_ADDRESS
+ }
+ } // stage("Install")
+///////////////////////////////////////////////////////////////////////////////////////
+// Health check of installed OSM in remote vm
+///////////////////////////////////////////////////////////////////////////////////////
+ stage("OSM Health") {
+ stackName = "osm"
+ sshCommand remote: remote, command: """
+ /usr/share/osm-devops/installers/osm_health.sh -k -s ${stackName}
+ """
+ } // stage("OSM Health")
+///////////////////////////////////////////////////////////////////////////////////////
+// Get juju data from installed OSM in remote vm
+///////////////////////////////////////////////////////////////////////////////////////
+ jujutempdir = sh(returnStdout: true, script: "mktemp -d").trim()
+ jujudatafolder = jujutempdir + '/juju'
+ homefolder = sshCommand remote: remote, command: 'echo ${HOME}'
+ sshGet remote: remote, from: homefolder + '/.local/share/juju', into: jujutempdir, override: true
+ } // if ( params.DO_INSTALL )
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Execute Robot tests
+///////////////////////////////////////////////////////////////////////////////////////
+ stage_archive = false
+ if ( params.DO_ROBOT ) {
+ try {
+ stage("System Integration Test") {
+ if ( useCharmedInstaller ) {
+ tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
+ sh(script: "touch ${tempdir}/hosts")
+ hostfile="${tempdir}/hosts"
+ sh """cat << EOF > ${hostfile}
+127.0.0.1 localhost
+${remote.host} prometheus.${remote.host}.nip.io nbi.${remote.host}.nip.io
+EOF"""
+ } else {
+ hostfile=null