1 Star 0 Fork 0

走进科学/c-semantics

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 3.11 KB
一键复制 编辑 原始数据 按行查看 历史
// 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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/dyb1296/c-semantics.git
[email protected]:dyb1296/c-semantics.git
dyb1296
c-semantics
c-semantics
master

搜索帮助