8 Star 5 Fork 4

anolis/anolis-jenkins

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Anolis7-4.19-nightly-x86_64.jenkinsfile 2.30 KB
一键复制 编辑 原始数据 按行查看 历史
def createVersion() {
return new Date().format('yyyyMMddHHmmss') + "_${env.BUILD_ID}"
}
pipeline {
agent {
node {
label "${worknode}"
}
}
environment {
_version = createVersion()
func_token = credentials('token_func')
}
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: 'an7-4.19', credentialsId: 'sshkey', url: 'git@gitee.com:src-anolis-sig/ck-build.git'
}
}
stage('kernel') {
steps {
dir('cloud-kernel') {
git branch: 'devel-4.19', 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
sh build.sh
'''
}
}
stage('copy rpm') {
steps {
sh '''
rpmpath=${RPMpathpart}/${_version}
cp -r rpmbuild/RPMS/x86_64 ${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}
rpms=$(ls ${rpmpath})
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 '4.19' --webpath "${Tone_host}${nginxpath}/"
'''
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/anolis/anolis-jenkins.git
git@gitee.com:anolis/anolis-jenkins.git
anolis
anolis-jenkins
anolis-jenkins
master

搜索帮助