summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jenkinsfile136
1 files changed, 21 insertions, 115 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 0319b92..ef78968 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,119 +1,25 @@
-pipeline {
- agent none
- stages {
- stage('build-package') {
- parallel {
- stage('Build package amd64') {
- agent {
- docker {
- label 'jessie-amd64'
- args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006 -v /tmp:/tmp'
- image 'higebu/vyos-build:crux'
- }
+// Copyright (C) 2020-2021 VyOS maintainers and contributors
+//
+// This program is free software; you can redistribute it and/or modify
+// in order to easy exprort images built to "external" world
+// it under the terms of the GNU General Public License version 2 or later as
+// published by the Free Software Foundation.
+//
+// This program 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 General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
- }
- steps {
- sh '''#!/bin/bash
-git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
-cd $BUILD_NUMBER
-sudo apt-get -o Acquire::Check-Valid-Until=false update
-sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
-dpkg-buildpackage -b -us -uc -tc
-mkdir -p /tmp/$GIT_BRANCH/packages/script
-mv ../*.deb /tmp/$GIT_BRANCH/packages/'''
- }
- }
- stage('Build package armhf') {
- agent {
- docker {
- label 'jessie-amd64'
- image 'vyos-build-armhf:crux'
- args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006 -v /tmp:/tmp'
- }
+@NonCPS
- }
- steps {
- sh '''#!/bin/bash
-git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
-cd $BUILD_NUMBER
-sudo apt-get -o Acquire::Check-Valid-Until=false update
-sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
-dpkg-buildpackage -b -us -uc -tc
-mkdir -p /tmp/$GIT_BRANCH/packages/script
-mv ../*.deb /tmp/$GIT_BRANCH/packages/'''
- }
- }
- stage('Build package arm64') {
- agent {
- docker {
- label 'jessie-amd64'
- args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006 -v /tmp:/tmp'
- image 'vyos-build-arm64:crux'
- }
+// Using a version specifier library, use 'current' branch. The underscore (_)
+// is not a typo! You need this underscore if the line immediately after the
+// @Library annotation is not an import statement!
+@Library('vyos-build@crux')_
- }
- steps {
- sh '''#!/bin/bash
-git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
-cd $BUILD_NUMBER
-sudo apt-get -o Acquire::Check-Valid-Until=false update
-sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
-dpkg-buildpackage -b -us -uc -tc
-mkdir -p /tmp/$GIT_BRANCH/packages/script
-mv ../*.deb /tmp/$GIT_BRANCH/packages/'''
- }
- }
- }
- }
- stage('Deploy packages') {
- agent {
- node {
- label 'jessie-amd64'
- }
+// Start package build using library function from https://github.com/vyos/vyos-build
+buildPackage()
- }
- steps {
- sh '''#!/bin/bash
-cd /tmp/$GIT_BRANCH/packages/script
-/var/lib/vyos-build/pkg-build.sh $GIT_BRANCH'''
- }
- }
- stage('Cleanup') {
- parallel {
- stage('Cleanup amd64') {
- agent {
- node {
- label 'jessie-amd64'
- }
-
- }
- steps {
- cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, cleanupMatrixParent: true, deleteDirs: true, disableDeferredWipeout: true)
- }
- }
- stage('Cleanup armhf') {
- agent {
- node {
- label 'jessie-amd64'
- }
-
- }
- steps {
- cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, cleanupMatrixParent: true, deleteDirs: true, disableDeferredWipeout: true)
- }
- }
- stage('Cleanup arm64') {
- agent {
- node {
- label 'jessie-amd64'
- }
-
- }
- steps {
- cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, cleanupMatrixParent: true, deleteDirs: true, disableDeferredWipeout: true)
- }
- }
- }
- }
- }
-}