summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Hagen <kim.sidney@gmail.com>2019-05-22 16:37:53 +0200
committerKim Hagen <kim.sidney@gmail.com>2019-05-22 16:37:53 +0200
commitd69c68c1de57e73758c8cad10f5fa253431760b6 (patch)
tree45c687b19ce1aa800802aff8275970affa688a7a
parent2185cce5a56a418728d470b05fc15d57ae06a248 (diff)
downloadipaddrcheck-d69c68c1de57e73758c8cad10f5fa253431760b6.tar.gz
ipaddrcheck-d69c68c1de57e73758c8cad10f5fa253431760b6.zip
Create Jenkinsfile current
-rw-r--r--Jenkinsfile119
1 files changed, 119 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..563ead2
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,119 @@
+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:current'
+ }
+
+ }
+ 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:current'
+ args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006 -v /tmp:/tmp'
+ }
+
+ }
+ 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:current'
+ }
+
+ }
+ 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'
+ }
+
+ }
+ 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)
+ }
+ }
+ }
+ }
+ }
+}