booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'),
booleanParam(defaultValue: true, description: '', name: 'SAVE_ARTIFACTS_ON_SMOKE_SUCCESS'),
- booleanParam(defaultValue: true, description: '', name: 'DO_STAGE_4'),
booleanParam(defaultValue: true, description: '', name: 'DO_BUILD'),
booleanParam(defaultValue: true, description: '', name: 'DO_INSTALL'),
- booleanParam(defaultValue: true, description: '', name: 'DO_SMOKE'),
booleanParam(defaultValue: true, description: '', name: 'DO_DOCKERPUSH'),
booleanParam(defaultValue: false, description: '', name: 'SAVE_ARTIFACTS_OVERRIDE'),
string(defaultValue: '/home/jenkins/hive/openstack-etsi.rc', description: '', name: 'HIVE_VIM_1'),
- booleanParam(defaultValue: false, description: '', name: 'DO_ROBOT'),
- string(defaultValue: 'sanity', description: 'sanity/regression are the options', name: 'TEST_NAME'),
+ booleanParam(defaultValue: true, description: '', name: 'DO_ROBOT'),
+ string(defaultValue: 'sanity', description: 'sanity/regression/daily are the common options', name: 'ROBOT_TAG_NAME'),
string(defaultValue: '/home/jenkins/hive/robot-systest.cfg', description: '', name: 'ROBOT_VIM'),
string(defaultValue: '/home/jenkins/hive/kubeconfig.yaml', description: '', name: 'KUBECONFIG'),
string(defaultValue: '/home/jenkins/hive/clouds.yaml', description: '', name: 'CLOUDS'),
string(defaultValue: 'Default', description: '', name: 'INSTALLER'),
+ string(defaultValue: '99.0', description: '% passed Robot tests to mark the build as passed', name: 'ROBOT_PASS_THRESHOLD'),
+ string(defaultValue: '80.0', description: '% passed Robot tests to mark the build as unstable (if lower, it will be failed)', name: 'ROBOT_UNSTABLE_THRESHOLD'),
])
])
////////////////////////////////////////////////////////////////////////////////////////
// Helper Functions
////////////////////////////////////////////////////////////////////////////////////////
-def run_robot_systest(tagName,testName,osmHostname,prometheusHostname,prometheus_port=null,envfile=null,kubeconfig=null,clouds=null,hostfile=null,jujuPassword=null) {
+def run_robot_systest(tagName,testName,osmHostname,prometheusHostname,prometheus_port=null,envfile=null,kubeconfig=null,clouds=null,hostfile=null,jujuPassword=null,pass_th='0.0',unstable_th='0.0') {
tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
if ( !envfile )
{
disableArchiveOutput : false,
reportFileName : "report.html",
logFileName : "log.html",
- passThreshold : 0,
- unstableThreshold: 0,
+ passThreshold : pass_th,
+ unstableThreshold: unstable_th,
otherFiles : "*.png",
])
}
step ([$class: 'CopyArtifact',
projectName: "${params.UPSTREAM_JOB_NAME}",
- selector: [$class: 'SpecificBuildSelector', buildNumber: "${params.UPSTREAM_JOB_NUMBER}"]
+ selector: [$class: 'SpecificBuildSelector',
+ buildNumber: "${params.UPSTREAM_JOB_NUMBER}"]
])
- upstreamComponent = ci_helper.get_mdg_from_project(ci_helper.get_env_value('build.env','GERRIT_PROJECT'))
-
- // the upstream job name contains suffix with the project. Need this stripped off
- def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
- def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER,
- upstreamComponent,
- GERRIT_BRANCH,
- "${project_without_branch} :: ${GERRIT_BRANCH}",
- ci_helper.get_env_value('build.env','BUILD_NUMBER'))
-
- packageList.addAll(packages)
- println("${params.UPSTREAM_JOB_NAME}: ${packages}")
+ upstreamComponent = ci_helper.get_mdg_from_project(
+ ci_helper.get_env_value('build.env','GERRIT_PROJECT'))
+ def buildNumber = ci_helper.get_env_value('build.env','BUILD_NUMBER')
+ dir("$upstreamComponent") {
+ // the upstream job name contains suffix with the project. Need this stripped off
+ def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
+ def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER,
+ upstreamComponent,
+ GERRIT_BRANCH,
+ "${project_without_branch} :: ${GERRIT_BRANCH}",
+ buildNumber)
+
+ packageList.addAll(packages)
+ println("Fetched pre-merge ${params.UPSTREAM_JOB_NAME}: ${packages}")
+ }
}
parallelSteps = [:]
parallel parallelSteps
///////////////////////////////////////////////////////////////////////////////////////
-// Create APT repository
+// Create Devops APT repository
///////////////////////////////////////////////////////////////////////////////////////
- for ( component in [ "devops" ] ) {
- sh "mv ${component}/pool/${component} pool"
+ sh "mkdir -p pool"
+ for (component in [ "devops", "IM", "osmclient" ]) {
+ sh "ls -al ${component}/pool/"
+ sh "cp -r ${component}/pool/* pool/"
sh "dpkg-sig --sign builder -k ${GPG_KEY_NAME} pool/${component}/*"
sh "mkdir -p dists/${params.REPO_DISTRO}/${component}/binary-amd64/"
sh "apt-ftparchive packages pool/${component} > dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages"
sh "gzip -9fk dists/${params.REPO_DISTRO}/${component}/binary-amd64/Packages"
}
+
// create and sign the release file
sh "apt-ftparchive release dists/${params.REPO_DISTRO} > dists/${params.REPO_DISTRO}/Release"
sh "gpg --yes -abs -u ${GPG_KEY_NAME} -o dists/${params.REPO_DISTRO}/Release.gpg dists/${params.REPO_DISTRO}/Release"
${release} -r unstable \
-d ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \
-p ${INTERNAL_DOCKER_PROXY} \
- -t ${container_name}
+ -t ${container_name} \
+ --nocachelxdimages
"""
}
prometheusHostname = IP_ADDRESS
osmHostname = IP_ADDRESS
}
} // stage("Install")
- } // if ( params.DO_INSTALL )
-
///////////////////////////////////////////////////////////////////////////////////////
// Health check of installed OSM in remote vm
///////////////////////////////////////////////////////////////////////////////////////
- if ( params.DO_SMOKE ) {
stage("OSM Health") {
stackName = "osm"
sshCommand remote: remote, command: """
/usr/share/osm-devops/installers/osm_health.sh -k -s ${stackName}
"""
- }
- }
+ } // stage("OSM Health")
+ } // if ( params.DO_INSTALL )
+
///////////////////////////////////////////////////////////////////////////////////////
// Execute Robot tests
///////////////////////////////////////////////////////////////////////////////////////
stage_archive = false
- if ( params.DO_STAGE_4 ) {
+ if ( params.DO_ROBOT ) {
try {
stage("System Integration Test") {
- if ( params.DO_ROBOT ) {
- if( useCharmedInstaller ) {
- tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
- sh(script: "touch ${tempdir}/hosts")
- hostfile="${tempdir}/hosts"
- sh """cat << EOF > ${hostfile}
+ 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}.xip.io nbi.${remote.host}.xip.io
EOF"""
- } else {
- hostfile=null
- }
-
- jujuPassword=sshCommand remote: remote, command: """
- echo `juju gui 2>&1 | grep password | cut -d: -f2`
- """
-
- run_robot_systest(
- container_name,
- params.TEST_NAME,
- osmHostname,
- prometheusHostname,
- prometheusPort,
- params.ROBOT_VIM,
- params.KUBECONFIG,
- params.CLOUDS,
- hostfile,
- jujuPassword)
+ } else {
+ hostfile=null
}
+
+ jujuPassword=sshCommand remote: remote, command: """
+ echo `juju gui 2>&1 | grep password | cut -d: -f2`
+ """
+
+ run_robot_systest(
+ container_name,
+ params.ROBOT_TAG_NAME,
+ osmHostname,
+ prometheusHostname,
+ prometheusPort,
+ params.ROBOT_VIM,
+ params.KUBECONFIG,
+ params.CLOUDS,
+ hostfile,
+ jujuPassword)
} // stage("System Integration Test")
} finally {
stage("Archive Container Logs") {
}
}
}
- } // if ( params.DO_STAGE_4 )
+ } // if ( params.DO_ROBOT )
if ( params.SAVE_ARTIFACTS_OVERRIDE || stage_archive ) {
stage("Archive") {
for (buildStep in containerList) {
def module = buildStep
def moduleName = buildStep.toLowerCase()
- def moduleTag = params.DOCKER_TAG
+ def dockerTag = params.DOCKER_TAG
+ def moduleTag = container_name
+
parallelSteps[module] = {
dir("$module") {
- sh "docker tag opensourcemano/${moduleName}:${moduleTag} opensourcemano/${moduleName}:${moduleTag}"
- sh "docker push opensourcemano/${moduleName}:${moduleTag}"
+ sh "docker tag opensourcemano/${moduleName}:${moduleTag} opensourcemano/${moduleName}:${dockerTag}"
+ sh "docker push opensourcemano/${moduleName}:${dockerTag}"
}
}
}