diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-26 17:22:14 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-26 17:48:54 +0200 |
commit | e68de0e41fe7bfdee4fddf5f42e3404da09f2bf6 (patch) | |
tree | 8b09cb915b33dd088edf198e16232032e0d49c90 | |
parent | 8cf9ac3269ca906a921ba613ee5de2b36c516ba1 (diff) | |
download | vyos-build-e68de0e41fe7bfdee4fddf5f42e3404da09f2bf6.tar.gz vyos-build-e68de0e41fe7bfdee4fddf5f42e3404da09f2bf6.zip |
packages: linux-kernel: only build if required
-rw-r--r-- | packages/linux-kernel/Jenkinsfile | 109 |
1 files changed, 99 insertions, 10 deletions
diff --git a/packages/linux-kernel/Jenkinsfile b/packages/linux-kernel/Jenkinsfile index 2608111..c53ac3e 100644 --- a/packages/linux-kernel/Jenkinsfile +++ b/packages/linux-kernel/Jenkinsfile @@ -62,21 +62,30 @@ pipeline { } environment { DEBIAN_ARCH = sh(returnStdout: true, script: 'dpkg --print-architecture').trim() - BASE_DIR = 'packages/linux-kernel' + BASE_DIR = getJenkinsfilePath() + CHANGESET_DIR = getChangeSetPath() } stages { stage('Fetch') { steps { script { - dir('build') { - checkout scm - } + checkout scm + echo env.CHANGESET_DIR } } } stage('Git Clone - Components') { parallel { stage('Kernel') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR + '/linux') { checkout([$class: 'GitSCM', @@ -84,12 +93,20 @@ pipeline { extensions: [[$class: 'CleanCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]], branches: [[name: 'v4.19.128' ]], - userRemoteConfigs: [[url: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git']]]) + userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git']]]) } - sh "pwd; ls -al" } } stage('Kernel Firmware') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR + '/linux-firmware') { checkout([$class: 'GitSCM', @@ -97,42 +114,69 @@ pipeline { extensions: [[$class: 'CleanCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]], branches: [[name: '20191022' ]], - userRemoteConfigs: [[url: 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git']]]) + userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git']]]) } } } stage('WireGuard') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR + '/wireguard') { checkout([$class: 'GitSCM', doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout']], branches: [[name: 'debian/1.0.20200319-1_bpo10+1' ]], - userRemoteConfigs: [[url: 'https://salsa.debian.org/debian/wireguard.git']]]) + userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://salsa.debian.org/debian/wireguard.git']]]) } dir(env.BASE_DIR + '/wireguard-linux-compat') { checkout([$class: 'GitSCM', doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout']], branches: [[name: 'debian/1.0.20200429-2_bpo10+1' ]], - userRemoteConfigs: [[url: 'https://salsa.debian.org/debian/wireguard-linux-compat.git']]]) + userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://salsa.debian.org/debian/wireguard-linux-compat.git']]]) } } } stage('Accel-PPP') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR + '/accel-ppp') { checkout([$class: 'GitSCM', doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout']], branches: [[name: 'ed7b28722ec85' ]], - userRemoteConfigs: [[url: 'https://github.com/accel-ppp/accel-ppp.git']]]) + userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://github.com/accel-ppp/accel-ppp.git']]]) } } } } } stage('Compile Kernel') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { sh "./build-kernel.sh" @@ -143,6 +187,15 @@ pipeline { stage('Kernel Module(s)') { parallel { stage('WireGuard') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { // In Debian wireguard repo commit edb7124c866ea0e506278c311fc82dfde1f957be @@ -155,6 +208,15 @@ pipeline { } } stage('Accel-PPP') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { sh "./build-accel-ppp.sh" @@ -162,6 +224,15 @@ pipeline { } } stage('Intel Driver(s)') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { sh "./build-intel-drivers.sh" @@ -169,6 +240,15 @@ pipeline { } } stage('Intel QuickAssist Technology') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { sh "./build-intel-qat.sh" @@ -181,6 +261,15 @@ pipeline { // again on the kernel source and this could confuse other build systems // like generating Intel or Accel-PPP drivers. Better safe then sorry! stage('Linux Firmware') { + when { + beforeOptions true + beforeAgent true + anyOf { + changeset pattern: "${env.CHANGESET_DIR}" + triggeredBy 'TimerTrigger' + triggeredBy cause: "UserIdCause" + } + } steps { dir(env.BASE_DIR) { sh "./build-linux-firmware.sh" |