Add Airship-in-a-Bottle cicd gate jobs

Change-Id: I367cae5bae964c7ce0f0427c8bff0d9694e46db7
This commit is contained in:
Evgeny L 2019-05-22 19:34:32 +00:00
parent 8cf3062dcd
commit f9077a20d5
2 changed files with 106 additions and 0 deletions

54
tools/gate/aiab/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,54 @@
// pipeline for treasuremap installation of airship-in-a-bottle,
// more info at http://www.airshipit.org/
ARTF_BASE = "cicd/logs/${JOB_NAME}/${BUILD_ID}"
REPO_URL = 'https://review.opendev.org/airship/treasuremap'
REPO_HOME = '/root/deploy/treasuremap'
publicNet = 'public'
if (env.AIRSHIP_VM_PUBLIC_NET) {
publicNet = env.AIRSHIP_VM_PUBLIC_NET
}
vm(flavor: 'm1.xxlarge', artifactoryLogs: true, publicNet: publicNet) {
stage('Checkout'){
sh 'sudo mkdir /root/deploy'
sh 'sudo setfacl -m u:ubuntu:rwx /root/deploy'
sh 'sudo setfacl -m u:ubuntu:rwx /root'
gerrit.cloneToBranch(REPO_URL, GERRIT_PATCHSET_REVISION, REPO_HOME)
if(GERRIT_EVENT_TYPE != 'change-merged') {
dir(REPO_HOME) {
gerrit.rebase()
}
}
currentBuild.displayName = "#${BUILD_NUMBER} ${GERRIT_EVENT_TYPE}"
}
stage('Run Airship') {
dir("${REPO_HOME}/tools/deployment/aiab/dev_single_node"){
try {
timeout(120){
sh 'sudo TERM_OPTS=-i ./airship-in-a-bottle.sh -y'
}
} catch (err) {
try {
sh 'sudo debug-report.sh'
def hostname = sh (script: 'hostname', returnStdout: true).trim()
artifactory.upload("debug-${hostname}.tgz",
"${ARTF_BASE}/debug-${hostname}.tgz")
} catch (lerr){
// pipeline may not yet deployed basic k8s
// cause of the issue will be found in Jenkins console log
print "Failed to publish debug report: ${lerr}"
}
error(err)
}
}
}
}

View File

@ -0,0 +1,52 @@
JOB_BASE = 'tools/gate/aiab'
pipelineJob("treasuremap-aiab") {
logRotator{
daysToKeep(90)
}
configure {
node -> node / 'properties' / 'jenkins.branch.RateLimitBranchProperty_-JobPropertyImpl'{
durationName 'hour'
count '3'
}
}
triggers {
gerritTrigger {
serverName('ATT-airship-CI')
gerritProjects {
gerritProject {
compareType('PLAIN')
pattern("airship/treasuremap")
branches {
branch {
compareType("ANT")
pattern("**")
}
}
disableStrictForbiddenFileVerification(false)
}
}
triggerOnEvents {
patchsetCreated {
excludeDrafts(false)
excludeTrivialRebase(false)
excludeNoCodeChange(false)
}
changeMerged()
commentAddedContains {
commentAddedCommentContains('^recheck\$')
}
}
}
definition {
cps {
script(readFileFromWorkspace("${JOB_BASE}/Jenkinsfile"))
sandbox(false)
}
}
}
}