8 Star 5 Fork 4

anolis/anolis-jenkins

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

搜索帮助