summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-12-28 21:38:37 +0100
committerDaniil Baturin <daniil@baturin.org>2019-12-28 21:38:37 +0100
commitad5bbcbe4bf82be79d200f6ac5f52407483c5d0f (patch)
treedf1c23fd39b1ece2ab777d092a725bcffbcba40d /Jenkinsfile
parent28684c3679b919936dbe3cf92e0a8b844e87e31c (diff)
parent3f02f19aecf74db682eebe290badada4de78bb06 (diff)
downloadvyos-build-ad5bbcbe4bf82be79d200f6ac5f52407483c5d0f.tar.gz
vyos-build-ad5bbcbe4bf82be79d200f6ac5f52407483c5d0f.zip
Merge branch 'crux' of https://github.com/vyos/vyos-build into crux
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile32
1 files changed, 24 insertions, 8 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 2abfa282..6f4190ee 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -62,19 +62,39 @@ def setDescription() {
item.save()
}
-/* Only keep the 10 most recent builds. */
+// Only keep the 10 most recent builds
def projectProperties = [
- [$class: 'BuildDiscarderProperty',strategy: [$class: 'LogRotator', numToKeepStr: '1']],
+ [$class: 'BuildDiscarderProperty',strategy: [$class: 'LogRotator', numToKeepStr: '10']],
]
properties(projectProperties)
setDescription()
+// Due to long build times on DockerHub we rather build the container by ourself
+// and publish it later on.
+node('Docker') {
+ stage('Build Container') {
+ script {
+ git branch: getGitBranchName(),
+ url: getGitRepoURL()
+
+ // create container name on demand
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName()
+ sh "docker build -t ${env.DOCKER_IMAGE} docker"
+ withDockerRegistry([credentialsId: "DockerHub"]) {
+ sh "docker push ${env.DOCKER_IMAGE}"
+ }
+ }
+ }
+}
+
pipeline {
options {
+ skipDefaultCheckout()
disableConcurrentBuilds()
timeout(time: 90, unit: 'MINUTES')
parallelsAlwaysFailFast()
+ timestamps()
}
triggers {
cron('H 2 * * *')
@@ -87,21 +107,17 @@ pipeline {
}
}
stages {
- stage('Configure') {
+ stage('Build ISO') {
steps {
script {
def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim()
currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1])
sh './configure --build-by autobuild@vyos.net --debian-mirror http://ftp.us.debian.org/debian/'
+ sh 'sudo make iso'
}
}
}
- stage('Build') {
- steps {
- sh 'sudo make iso'
- }
- }
}
post {
cleanup {