diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-07-22 11:08:08 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-07-22 11:08:08 +0200 |
commit | 6af7b74e2b80b014a80c0c8531b7e219194a9d92 (patch) | |
tree | 2fc50e087eb759ecc9a73dbc486d537d651c200c /Jenkinsfile | |
parent | b050fe61956f710e61d8e3a8139c971a23e702f9 (diff) | |
parent | d99bf6a3a623433e743bb2d1d72e2ef3e0ab5057 (diff) | |
download | vyos-1x-6af7b74e2b80b014a80c0c8531b7e219194a9d92.tar.gz vyos-1x-6af7b74e2b80b014a80c0c8531b7e219194a9d92.zip |
Merge branch 'current' into equuleus
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..aac051799 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,131 @@ +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 pip3 uninstall vyos -y || true +sudo pip3 install -r test-requirements.txt +python3 -m "pylint" src -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint-report.txt || true +make test +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 pip3 uninstall vyos -y || true +sudo pip3 install -r test-requirements.txt +python3 -m "pylint" src -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint-report.txt || true +make test +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 pip3 uninstall vyos -y || true +sudo pip3 install -r test-requirements.txt +python3 -m "pylint" src -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint-report.txt || true +make test +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) + } + } + } + } + } +} |