代码拉取完成,页面将自动刷新
// Object holding the docker image.
def img
// Our internal registry.
def PRIVATE_REGISTRY = "https://10.0.0.21:5201"
pipeline {
agent none
options {
ansiColor('xterm')
}
stages {
stage ( 'Pull Request' ) {
agent any
when {
changeRequest()
beforeAgent true
}
stages {
stage ( 'Set title' ) { steps {
script {
currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}"
}
} }
stage ( 'Build docker image' ) { steps {
script {
img = docker.build "c-semantics:${env.CHANGE_ID}"
}
} }
stage ( 'Push to private registry' ) { steps {
script {
docker.withRegistry ( "${PRIVATE_REGISTRY}", 'rvdockerhub' ) {
img.push()
}
}
} }
stage ( 'Compile' ) {
options {
timeout(time: 70, unit: 'MINUTES')
}
steps {
script { img.inside {
sh '''
eval $(opam config env)
eval $(perl -I "~/perl5/lib/perl5" -Mlocal::lib)
export KOMPILE_FLAGS=-O2
make -j4 profile-rule-parsing --output-sync=line
'''
} }
}
post { success {
archiveArtifacts 'dist/timelogs.d/timelogs.csv'
} }
}
stage ( 'Re-compile w/ timeout' ) { steps {
timeout(time: 8, unit: 'SECONDS' ) {
script { img.inside {
sh '''
eval $(opam config env)
eval $(perl -I "~/perl5/lib/perl5" -Mlocal::lib)
make
'''
} }
}
} }
stage ( 'Test' ) {
options {
timeout(time: 300, unit: 'MINUTES')
}
steps {
script { img.inside {
sh '''
eval $(opam config env)
eval $(perl -I "~/perl5/lib/perl5" -Mlocal::lib)
${K_BIN}/spawn-kserver
make -C tests/unit-pass -j$(nproc) os-comparison
'''
} }
}
post { always {
archiveArtifacts artifacts: 'tests/unit-pass/*config', allowEmptyArchive: true
} }
}
stage ( 'Test clean target' ) { steps {
script { img.inside {
sh 'make clean'
sh '[ $(git clean -xfd 2>&1 | wc -l) -eq 0 ]'
} }
} }
} // stages of 'Pull Request'
} // Pull Request
stage ( 'Merged to master' ) {
when {
branch 'master'
beforeAgent true
}
agent any
stages {
stage ( 'Build docker image' ) { steps {
script {
img = docker.build 'runtimeverificationinc/c-semantics:latest'
}
} }
stage ( 'Push to dockerhub' ) { steps {
script {
docker.withRegistry ( '', 'rvdockerhub' ) {
img.push()
}
}
} }
} // stages of 'Merged to master'
} // 'Merged to master'
} // pipeline stages
} // pipeline
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。