aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Galka <michal.galka@collabora.com>2019-10-22 02:38:53 +0200
committerGuillaume Tucker <guillaume.tucker@collabora.com>2019-11-01 12:15:08 +0000
commit306f08328f48de9e6eb96913ca1ba3dbf2fc6fb8 (patch)
treef8a993691d3e6307b3b41ec248c3a6a1c23af1a0
parent16bed2a7989996b2b9ac2bfdb5d6ca3ff03c153e (diff)
build.jpl: use kci_build pull_tarball in the job
Remove pipeline implementation of the kernel source tarball download and use kci_build instead. Signed-off-by: Michal Galka <michal.galka@collabora.com>
-rw-r--r--jenkins/bisect.jpl1
-rw-r--r--jenkins/build-trigger.jpl2
-rw-r--r--jenkins/build.jpl10
-rw-r--r--src/org/kernelci/build/Kernel.groovy66
4 files changed, 7 insertions, 72 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index 2c97630..1ddd1d3 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -84,7 +84,6 @@ TREES_WHITELIST
@Library('kernelci') _
-import org.kernelci.build.Kernel
import org.kernelci.util.Job
/* Working around some seemingly broken Python set-up... */
diff --git a/jenkins/build-trigger.jpl b/jenkins/build-trigger.jpl
index de1cbaf..413b323 100644
--- a/jenkins/build-trigger.jpl
+++ b/jenkins/build-trigger.jpl
@@ -47,7 +47,6 @@ ALLOW_REBUILD (false)
*/
@Library('kernelci') _
-import org.kernelci.build.Kernel
import org.kernelci.util.Job
def configAlreadyBuilt(config, kci_core) {
@@ -269,7 +268,6 @@ def buildsComplete(job, opts, arch) {
node("docker && build-trigger") {
def j = new Job()
- def k = new Kernel()
def kci_core = "${env.WORKSPACE}/kernelci-core"
def kdir = "${env.WORKSPACE}/configs/${params.BUILD_CONFIG}"
def mirror = "${env.WORKSPACE}/linux.git"
diff --git a/jenkins/build.jpl b/jenkins/build.jpl
index 0ab0fdf..05bdeeb 100644
--- a/jenkins/build.jpl
+++ b/jenkins/build.jpl
@@ -61,7 +61,6 @@ PARALLEL_BUILDS
@Library('kernelci') _
-import org.kernelci.build.Kernel
import org.kernelci.util.Job
def buildConfig(kdir, kci_core) {
@@ -120,7 +119,6 @@ publish_kernel \
node("docker" && params.NODE_LABEL) {
def j = new Job()
- def k = new Kernel()
def kci_core = "${env.WORKSPACE}/kernelci-core"
def kdir = "${env.WORKSPACE}/linux"
def docker_image = null
@@ -143,7 +141,13 @@ node("docker" && params.NODE_LABEL) {
j.dockerPullWithRetry(docker_image).inside() {
stage("Init") {
timeout(time: 30, unit: 'MINUTES') {
- k.downloadTarball(kdir, params.SRC_TARBALL)
+ dir(kci_core) {
+ sh(script: """./kci_build pull_tarball \
+ --kdir ${kdir} \
+ --url ${params.SRC_TARBALL} \
+ --retries=12 \
+ """)
+ }
}
}
diff --git a/src/org/kernelci/build/Kernel.groovy b/src/org/kernelci/build/Kernel.groovy
deleted file mode 100644
index e156546..0000000
--- a/src/org/kernelci/build/Kernel.groovy
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- Copyright (C) 2018 Collabora Limited
- Author: Guillaume Tucker <guillaume.tucker@collabora.com>
-
- This module is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the Free
- Software Foundation; either version 2.1 of the License, or (at your option)
- any later version.
-
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
-
-
-package org.kernelci.build
-
-def downloadTarball(kdir, url, filename="linux-src.tar.gz") {
- sh(script: "rm -rf ${kdir}")
- dir(kdir) {
- /* Storing the tarball is done asynchronously on the server, so it may
- * not be ready by the time we try to download it. Give it a
- * minute by retrying periodically. */
- def retry_sleep_s = 5
- def retries = 12
- def downloaded = false
-
- while (!downloaded) {
- def stat = sh(returnStatus: true,
- script: "\
-wget \
---no-hsts \
---progress=dot:giga \
---retry-connrefused \
---waitretry=5 \
---read-timeout=20 \
---timeout=15 \
---tries 20 \
---continue \
--O ${filename} \
-${url}")
-
- if (!stat) {
- downloaded = true
- } else {
- retries -= 1
-
- /* Only retry if server returned an HTTP error (status 8) */
- if (!retries || (stat != 8)) {
- throw new hudson.AbortException(
- "Failed to download tarball")
- }
-
- echo "retries: ${retries}"
- sleep(time: retry_sleep_s, unit: 'SECONDS')
- }
- }
-
- sh(script: "tar xzf ${filename}")
- }
-}