Updated jenkins build methode
Switched to 'custom-checkbox-parameter' for selecting wanted variants/CT's Also added "parameterized-scheduler" to be able to autobuild images on schedule
This commit is contained in:
@@ -1,14 +1,13 @@
|
|||||||
String[] ImgVariantList = ['minimal', 'default' , 'gitea' , 'nginx' , 'ddns' , 'transfersh' , 'iscsi' , 'z2mqtt' , 'nodered' , 'nodejs' , 'nextcloud' , 'mqtt' , 'hass' , 'mailbackup', 'elkarbackupALP', 'heimdall' , 'vouchproxy' ]
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'LXCBuilder' }
|
agent { label 'LXCBuilder' }
|
||||||
parameters {
|
parameters {
|
||||||
booleanParam description: 'Enable muticore support for ZX compression ', name: 'ZX_Multicore'
|
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: '0', description: 'Set amount of core\'s ZX is allowed when compressing (use 0 for all cores)', name: 'ZX_Cores'
|
||||||
booleanParam description: 'Only build specified variant', name: 'OneRun'
|
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer'
|
||||||
string defaultValue: 'VariantName', description: 'Variant for OneBuild', name: 'OneRunVariant'
|
booleanParam description: 'will disable use of proxy server', name: 'DisProxy'
|
||||||
booleanParam description: 'Disable of Proxy server for package repos ', name: 'DisProxy'
|
checkboxParameter(name: 'ImgVariantList', format: 'JSON', displayNodePath: "//Variants/Variant", valueNodePath: "//Variants/Variant", description: 'Select the variant(s) that should be build',
|
||||||
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, (when enabled) ', name: 'ProxyServer'
|
pipelineSubmitContent: '{"Variants": [{"Variant": "minimal"},{"Variant": "default"},{"Variant": "gitea"},{"Variant": "nginx"},{"Variant": "ddns"},{"Variant": "transfersh"},{"Variant": "iscsi"},{"Variant": "z2mqtt"},{"Variant": "nodered"},{"Variant": "nodejs"},{"Variant": "nextcloud"},{"Variant": "mqtt"},{"Variant": "hass"},{"Variant": "mailbackup"},{"Variant": "elkarbackupALP"},{"Variant": "heimdall"},{"Variant": "vouchproxy"}]}')
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
skipDefaultCheckout()
|
skipDefaultCheckout()
|
||||||
@@ -35,18 +34,15 @@ pipeline {
|
|||||||
env.ProxyServer = ProxyServer
|
env.ProxyServer = ProxyServer
|
||||||
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -e $ProxyServer'''
|
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -e $ProxyServer'''
|
||||||
}
|
}
|
||||||
|
if (env.OnlyUpdatePipeline == 'true') {
|
||||||
|
error 'Build ended early, only updated jenkins file'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Image Configs'){
|
stage('Image Configs'){
|
||||||
steps{
|
steps{
|
||||||
script{
|
script{
|
||||||
|
|
||||||
//Set Variantlist to one if single build if requested
|
|
||||||
if (env.OneRun == 'true') {
|
|
||||||
ImgVariantList = [env.OneRunVariant]
|
|
||||||
}
|
|
||||||
|
|
||||||
//Run build for requested variants
|
//Run build for requested variants
|
||||||
for(ImgVariant in ImgVariantList){
|
for(ImgVariant in ImgVariantList){
|
||||||
env.ZX_Multicore = ZX_Multicore
|
env.ZX_Multicore = ZX_Multicore
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
String[] ImgVariantList = ['minimal', 'default', 'jenkinsbuilder', 'imgbuilder', 'jenkins', 'mysql' , 'pihole' , 'collabora' , 'jellyfin' , 'domoticz' , 'omadaV3' , 'docker' , 'smb' , 'tvheadend' , 'x2go' , 'aptcacherng' , 'nfs' , 'fileshelter' ]
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'LXCBuilder' }
|
agent { label 'LXCBuilder' }
|
||||||
parameters {
|
parameters {
|
||||||
booleanParam description: 'Enable muticore support for ZX compression ', name: 'ZX_Multicore'
|
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: '0', description: 'Set amount of core\'s ZX is allowed when compressing (use 0 for all cores)', name: 'ZX_Cores'
|
||||||
booleanParam description: 'Only build specified variant', name: 'OneRun'
|
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, when enabled', name: 'ProxyServer'
|
||||||
string defaultValue: 'VariantName', description: 'Variant for OneBuild', name: 'OneRunVariant'
|
booleanParam description: 'will disable use of proxy server', name: 'DisProxy'
|
||||||
booleanParam description: 'Disable of Proxy server for package repos ', name: 'DisProxy'
|
checkboxParameter(name: 'ImgVariantList', format: 'JSON', displayNodePath: "//Variants/Variant", valueNodePath: "//Variants/Variant", description: 'Select the variant(s) that should be build',
|
||||||
string defaultValue: '192.168.200.11', description: 'Proxy server for packages, (when enabled) ', name: 'ProxyServer'
|
pipelineSubmitContent: '{"Variants": [{"Variant'": "minimal"},{"Variant'": "default"},{"Variant'": "jenkinsbuilder"},{"Variant'": "imgbuilder"},{"Variant'": "jenkins"},{"Variant'": "mysql"},{"Variant'": "pihole"},{"Variant'": "collabora"},{"Variant'": "jellyfin"},{"Variant'": "domoticz"},{"Variant'": "omadaV3"},{"Variant'": "docker"},{"Variant'": "smb"},{"Variant'": "tvheadend"},{"Variant'": "x2go"},{"Variant'": "aptcacherng"},{"Variant'": "nfs"},{"Variant'": "fileshelter"}]}')
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
skipDefaultCheckout()
|
skipDefaultCheckout()
|
||||||
@@ -35,18 +34,15 @@ pipeline {
|
|||||||
env.ProxyServer = ProxyServer
|
env.ProxyServer = ProxyServer
|
||||||
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -e $ProxyServer'''
|
sh '''bash Scripts/UpdateIMGBuildFile-CacheAndRepo.sh -e $ProxyServer'''
|
||||||
}
|
}
|
||||||
|
if (env.OnlyUpdatePipeline == 'true') {
|
||||||
|
error 'Build ended early, only updated jenkins file'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Image Configs'){
|
stage('Image Configs'){
|
||||||
steps{
|
steps{
|
||||||
script{
|
script{
|
||||||
|
|
||||||
//Set Variantlist to one if single build if requested
|
|
||||||
if (env.OneRun == 'true') {
|
|
||||||
ImgVariantList = [env.OneRunVariant]
|
|
||||||
}
|
|
||||||
|
|
||||||
//Run build for requested variants
|
//Run build for requested variants
|
||||||
for(ImgVariant in ImgVariantList){
|
for(ImgVariant in ImgVariantList){
|
||||||
env.ZX_Multicore = ZX_Multicore
|
env.ZX_Multicore = ZX_Multicore
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ LXCBuilderIP=<ip.of.the.BuilderCT>
|
|||||||
|
|
||||||
#StaticVars
|
#StaticVars
|
||||||
AdminPassword=$(cat /var/lib/jenkins/secrets/initialAdminPassword)
|
AdminPassword=$(cat /var/lib/jenkins/secrets/initialAdminPassword)
|
||||||
JeninsPlugins="dark-theme ssh-slaves workflow-aggregator locale golang git dark-theme copyartifact ws-cleanup pipeline-stage-view"
|
JeninsPlugins="dark-theme ssh-slaves workflow-aggregator locale golang git dark-theme copyartifact ws-cleanup pipeline-stage-view custom-checkbox-parameter parameterized-scheduler"
|
||||||
|
|
||||||
#Check if script is configured
|
#Check if script is configured
|
||||||
if [ $ThisScriptConfigured = no ]; then
|
if [ $ThisScriptConfigured = no ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user