7 Star 5 Fork 4

anolis/anolis-jenkins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Anolis23-5.10-inner-nightly.jenkinsfile 3.70 KB
一键复制 编辑 原始数据 按行查看 历史
def createVersion() {
return new Date().format('yyyyMMddHHmmss') + "_${env.BUILD_ID}"
}
pipeline {
agent {
node {
label "${worknode}"
}
}
options {
timestamps()
skipDefaultCheckout(false)
}
environment {
_version = createVersion()
func_token = credentials('token_func')
perf_token = credentials('token_perf')
}
triggers {
cron 'H 21 * * *'
}
stages {
stage('sync code') {
parallel {
stage('builder') {
steps {
script{
checkout([$class: 'GitSCM', branches: [[name: "*/an23-5.10"]],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 60]],
submoduleCfg: [], userRemoteConfigs: [[credentialsId: "c4721bdc-308a-4bf5-a394-dfb964178ea6", url: "git@gitee.com:src-anolis-sig/ck-build.git"]]])
}
sh '''
rm -rf create_inner23_job
mkdir create_inner23_job
cp ../anolis-jenkins/create_inner23_job.py create_inner23_job
'''
}
}
stage('kernel') {
steps {
dir('cloud-kernel') {
checkout([$class: 'GitSCM', branches: [[name: "*/devel-5.10"]],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 60]],
submoduleCfg: [], userRemoteConfigs: [[credentialsId: "c4721bdc-308a-4bf5-a394-dfb964178ea6",url: "git@gitee.com:anolis/cloud-kernel.git"]]])
}
}
}
}
}
stage('build') {
steps {
sh '''
rm -rf rpmbuild
rm -rf outputs
yum install -y yum-utils
yum-builddep -y kernel.spec
sh build.sh
'''
}
}
stage('copy rpm') {
steps {
sh '''
rpmpath=${RPMpathpart}/${_version}
cp -r rpmbuild/RPMS/${arch} ${rpmpath}
'''
}
}
stage('create job') {
steps {
sh '''
rpmpath=${RPMpathpart}/${_version}
nginxpath=${nginxpathpart}/${_version}
job_name_func=${template_func}-${_version}
job_name_perf=${template_perf}-${_version}
rpms=$(ls ${rpmpath})
python create_inner23_job/create_inner23_job.py --username ${fun_user} --token ${func_token} --workspace ${Tone_workspace} \
--template ${template_func} --rpms "${rpms}" --name ${job_name_func} --project ${Tone_project} \
--version '5.10' --webpath "${Tone_host}${nginxpath}/"
python create_inner23_job/create_inner23_job.py --username ${perf_user} --token ${perf_token} --workspace ${Tone_workspace} \
--template ${template_perf} --rpms "${rpms}" --name ${job_name_perf} --project ${Tone_project} \
--version '5.10' --webpath "${Tone_host}${nginxpath}/"
'''
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anolis/anolis-jenkins.git
git@gitee.com:anolis/anolis-jenkins.git
anolis
anolis-jenkins
anolis-jenkins
master

搜索帮助