summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-03 19:01:21 +0100
committerGitHub <noreply@github.com>2020-01-03 19:01:21 +0100
commitff9d967f8c0afb842c6aa881562e225372606565 (patch)
tree87171acad14205d8c1345796ccb31d74198a86b3 /Jenkinsfile
parentf9337815a248368a5588b725283e29d0235068a0 (diff)
parenta7bb0a8021366b5883b947157e9989cf356d9d36 (diff)
downloadvyos-build-ff9d967f8c0afb842c6aa881562e225372606565.tar.gz
vyos-build-ff9d967f8c0afb842c6aa881562e225372606565.zip
Merge pull request #77 from runborg/arm-build
T1927: Extend main docker container to support arm builds
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile72
1 files changed, 60 insertions, 12 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 40729a58..b726df6e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -73,18 +73,66 @@ 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}"
+ stage('Fetch') {
+ git branch: getGitBranchName(),
+ url: getGitRepoURL()
+ }
+ stage('Build Docker container') {
+ parallel (
+ 'x86-64': {
+ script {
+ // create container name on demand
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName()
+ sh "docker build -t ${env.DOCKER_IMAGE} docker"
+ if ( ! isCustomBuild()) {
+ withDockerRegistry([credentialsId: "DockerHub"]) {
+ sh "docker push ${env.DOCKER_IMAGE}"
+ }
+ }
+ }
+ },
+ 'armhf': {
+ script {
+ // create container name on demand
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName() + "-armhf"
+
+ dir('docker') {
+ sh """
+ cp Dockerfile armhf/Dockerfile
+ cp entrypoint.sh armhf/entrypoint.sh
+ sed -i 's#^FROM.*#FROM multiarch/debian-debootstrap:armhf-buster-slim#' armhf/Dockerfile
+ docker build -t ${env.DOCKER_IMAGE} armhf
+ """
+ if ( ! isCustomBuild()) {
+ withDockerRegistry([credentialsId: "DockerHub"]) {
+ sh "docker push ${env.DOCKER_IMAGE}"
+ }
+ }
+ }
+ }
+ },
+ 'arm64': {
+ script {
+ // create container name on demand
+ env.DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName() + "-arm64"
+
+ dir('docker') {
+ sh """
+ cp Dockerfile arm64/Dockerfile
+ cp entrypoint.sh arm64/entrypoint.sh
+ sed -i 's#^FROM.*#FROM multiarch/debian-debootstrap:arm64-buster-slim#' arm64/Dockerfile
+ docker build -t ${env.DOCKER_IMAGE} arm64
+ """
+
+ if ( ! isCustomBuild()) {
+ withDockerRegistry([credentialsId: "DockerHub"]) {
+ sh "docker push ${env.DOCKER_IMAGE}"
+ }
+ }
+ }
+ }
}
- }
+ )
}
}
@@ -92,7 +140,7 @@ pipeline {
options {
skipDefaultCheckout()
disableConcurrentBuilds()
- timeout(time: 90, unit: 'MINUTES')
+ timeout(time: 120, unit: 'MINUTES')
parallelsAlwaysFailFast()
timestamps()
}