代码拉取完成,页面将自动刷新
def createVersion() {
return new Date().format('yyyyMMddHHmmss') + "_${env.BUILD_ID}"
}
pipeline {
agent {
node {
label "${worknode}"
}
}
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 {
sh '''
rm -rf create_job
mkdir create_job
cp create_job.py create_job
'''
git branch: 'an8-5.10', credentialsId: 'sshkey', url: 'git@gitee.com:src-anolis-sig/ck-build.git'
}
}
stage('kernel') {
steps {
dir('cloud-kernel') {
deleteDir()
}
dir('cloud-kernel') {
checkout([$class: 'GitSCM', branches: [[name: "*/devel-5.10"]],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout'],
[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 60]],
submoduleCfg: [], userRemoteConfigs: [[credentialsId: "sshkey", url:
"git@gitee.com:anolis/cloud-kernel.git"]]])
}
}
}
}
}
stage('build') {
steps {
sh '''
rm -rf rpmbuild
sed -i 's/-bb/-ba/g' ./build.sh
export BUILD_MODE="nightly"
sh build.sh
'''
}
}
stage('copy rpm') {
steps {
sh '''
rpmpath=${RPMpathpart}/${_version}
cp -r rpmbuild/RPMS/aarch64 ${rpmpath}
cp -r rpmbuild/SRPMS/*.src.rpm ${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})
if [[ -n "$rpmpath" && -d "${rpmpath}/../last" ]]; then
cd ${rpmpath}/../
rm -rf last
mkdir last
cp "$rpmpath"/kernel-5.10*.rpm ./last
cp "$rpmpath"/kernel-devel-5.10*.rpm ./last
cp "$rpmpath"/kernel-headers-5.10*.rpm ./last
cp "$rpmpath"/kernel-modules-5.10*.rpm ./last
cp "$rpmpath"/kernel-core-5.10*.rpm ./last
cd -
else
rm -rf "${rpmpath}/../last"
mkdir -p "${rpmpath}/../last"
fi
python create_job/create_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_job/create_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}/"
'''
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。