Added Fedora, fixed cache script and did some cleanup
* Added Alpine 3.21 to the jenkinsfile * Added Debian Trixe(13) to the jenkinsfile * Fixed broken cache script Alpine edge builds * Added Fedora (41) distro * Cleaned-up Debian.yaml
This commit is contained in:
81
CT-Build/Fedora.Jenkinsfile
Normal file
81
CT-Build/Fedora.Jenkinsfile
Normal file
@@ -0,0 +1,81 @@
|
||||
pipeline {
|
||||
agent { label 'LXCBuilder' }
|
||||
parameters {
|
||||
booleanParam description: 'Will only update Jenkins piplinefile (jenkinsfile)', name: 'OnlyUpdatePipeline'
|
||||
booleanParam defaultValue: true, description: 'Enable muticore support for ZX compression', name: 'ZX_Multicore'
|
||||
string defaultValue: '0', description: 'Set amount of core\'s ZX is allowed when compressing (use 0 for all cores)', name: 'ZX_Cores'
|
||||
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer'
|
||||
booleanParam description: 'will disable use of proxy server', name: 'DisProxy'
|
||||
checkboxParameter(name: 'ImgVersionList', format: 'JSON', displayNodePath: "//Versions/Version", valueNodePath: "//Versions/Version", description: 'Select the vesions(s) that should be build',
|
||||
pipelineSubmitContent: '{"Versions": [{"Version": "41"},{"Version": "Rawhide"}]}')
|
||||
}
|
||||
options {
|
||||
skipDefaultCheckout()
|
||||
buildDiscarder(logRotator(numToKeepStr: '2', artifactNumToKeepStr: '1'))
|
||||
}
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
// Cleanup before starting
|
||||
cleanWs()
|
||||
// Checkout the repository
|
||||
checkout scm
|
||||
// Get distrobuilder
|
||||
copyArtifacts filter: 'distrobuilder-BrampCustom', fingerprintArtifacts: true, flatten: true, projectName: 'LXC-ImgBuilder/DistroBuilder', selector: lastSuccessful()
|
||||
// Setup Env
|
||||
sh '''mkdir $WORKSPACE/REL
|
||||
mv distrobuilder-* distrobuilder
|
||||
'''
|
||||
//Check if Proxy is disabled
|
||||
script{
|
||||
if (env.DisProxy == 'true') {
|
||||
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -d'''
|
||||
} else {
|
||||
env.ProxyServer = ProxyServer
|
||||
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -e $ProxyServer'''
|
||||
}
|
||||
if (env.OnlyUpdatePipeline == 'true') {
|
||||
error 'Build ended early, only updated jenkins file'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Image Configs'){
|
||||
steps{
|
||||
script{
|
||||
//Run build for requested Versions
|
||||
for(ImgVersion in ImgVersionList.split(',')){
|
||||
env.ZX_Multicore = ZX_Multicore
|
||||
env.ZX_Cores = ZX_Cores
|
||||
env.ImgVersion = ImgVersion
|
||||
stage("Build ${ImgVersion}") {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh '''
|
||||
if $ZX_Multicore; then
|
||||
export XZ_DEFAULTS="-T $ZX_Cores"
|
||||
fi
|
||||
sudo $WORKSPACE/distrobuilder build-lxc CT-Build/Fedora.yaml $WORKSPACE/REL/$ImgVersion/ -o image.release=$ImgVersion
|
||||
sudo chown jenkins:jenkins -R $WORKSPACE/REL
|
||||
mv $WORKSPACE/REL/$ImgVersion/rootfs.tar.xz Fedora-$ImgVersion.tar.xz
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Finish') {
|
||||
steps {
|
||||
// Save generated files
|
||||
archiveArtifacts artifacts: '*.tar.xz', followSymlinks: false
|
||||
// Copy artifacts to /LXCBuild folder
|
||||
sh '''
|
||||
mkdir -p /LXCBuild/template/cache
|
||||
cp -f *.tar.xz /LXCBuild/template/cache
|
||||
'''
|
||||
// Cleaning WorkSpace when build successfully
|
||||
cleanWs cleanWhenAborted: false, cleanWhenFailure: false, cleanWhenNotBuilt: false, cleanWhenUnstable: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user