summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jenkinsfile129
-rwxr-xr-xscripts/build-submodules27
2 files changed, 32 insertions, 124 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 6151fb7..611777c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -26,131 +26,28 @@ pipeline {
}
stages {
- stage('Configure') {
+ stage('Submodule Init') {
steps {
- sh './configure --build-by="autobuild@vyos.net" --debian-mirror="http://ftp.us.debian.org/debian/"'
- }
- }
- stage('Init Submodules') {
- environment {
- // there values are exportesd to all commands in this stage
- GIT_BRANCH_PACKAGE = "current"
- GIT_BRANCH_KERNEL = "linux-vyos-4.19.y"
- }
- steps {
- parallel (
- "mdns-repeater": {
- sh '''
- git submodule update --init packages/mdns-repeater
- cd packages/mdns-repeater
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "pmacct": {
- sh '''
- git submodule update --init packages/pmacct
- cd packages/pmacct
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "udp-broadcast-relay": {
- sh '''
- git submodule update --init packages/udp-broadcast-relay
- cd packages/udp-broadcast-relay
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-bash": {
- sh '''
- git submodule update --init packages/vyatta-bash
- cd packages/vyatta-bash
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg": {
- sh '''
- git submodule update --init packages/vyatta-cfg
- cd packages/vyatta-cfg
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-firewall": {
- sh '''
- git submodule update --init packages/vyatta-cfg-firewall
- cd packages/vyatta-cfg-firewall
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-op-pppoe": {
- sh '''
- git submodule update --init packages/vyatta-cfg-op-pppoe
- cd packages/vyatta-cfg-op-pppoe
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-qos": {
- sh '''
- git submodule update --init packages/vyatta-cfg-qos
- cd packages/vyatta-cfg-qos
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-quagga": {
- sh '''
- git submodule update --init packages/vyatta-cfg-quagga
- cd packages/vyatta-cfg-quagga
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-system": {
- sh '''
- git submodule update --init packages/vyatta-cfg-system
- cd packages/vyatta-cfg-system
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyatta-cfg-vpn": {
- sh '''
- git submodule update --init packages/vyatta-cfg-vpn
- cd packages/vyatta-cfg-vpn
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyos-kernel": {
- sh '''
- git submodule update --init packages/vyos-kernel
- cd packages/vyos-kernel
- git checkout $GIT_BRANCH_KERNEL
- '''
- },
- "vyos-wireguard": {
- sh '''
- git submodule update --init packages/vyos-wireguard
- cd packages/vyos-wireguard
- git checkout $GIT_BRANCH_PACKAGE
- '''
- },
- "vyos-accel-ppp": {
- sh '''
- git submodule update --init packages/vyos-accel-ppp
- cd packages/vyos-accel-ppp
- git checkout $GIT_BRANCH_PACKAGE
- '''
- }
- )
+ sh '''
+ git submodule update --init --recursive
+ git submodule update --remote
+ '''
}
}
stage('Build Packages') {
steps {
- sh 'git submodule update --remote'
- sh 'scripts/build-submodules'
+ sh 'scripts/build-submodules --verbose'
}
}
stage('Build ISO') {
steps {
- sh 'ls -al'
- sh 'ls -al packages'
- sh 'sudo make iso'
+ sh '''
+ #!/bin/sh
+ ./configure --build-by="autobuild@vyos.net" --debian-mirror="http://ftp.us.debian.org/debian/"
+ ls -al
+ ls -al packages
+ sudo make iso
+ '''
}
}
}
diff --git a/scripts/build-submodules b/scripts/build-submodules
index 3a7ea3a..ae9d131 100755
--- a/scripts/build-submodules
+++ b/scripts/build-submodules
@@ -5,7 +5,6 @@ if [ ! -d "packages" ]; then
exit 1
fi
-
print_help() {
echo "Script for building all subpackages to vyos"
echo "Execute this sctipt from the root of the vyos-build directory"
@@ -20,6 +19,7 @@ print_help() {
echo ""
echo "Parameters:"
echo " --init-packages - Initiate all subpackages before building"
+ echo " --verbose|-v - Enable verbose output"
}
while test $# -gt 0
@@ -32,6 +32,9 @@ do
--init-packages)
INIT_PACKAGES=1
;;
+ --verbose|-v)
+ VERBOSE=1
+ ;;
*)
(>&2 echo "Error: Argument $1 is not valid")
echo ""
@@ -42,24 +45,23 @@ do
shift
done
-
status_start() {
-echo -ne "[ ] $1"
+ echo -ne "[ ] $1"
}
status_ok() {
-echo -ne "\r[\e[32m OK \e[39m]\n"
+ echo -ne "\r[\e[32m OK \e[39m]\n"
}
status_fail() {
-echo -ne "\r[\e[31mFAIL\e[39m]\n"
+ echo -ne "\r[\e[31mFAIL\e[39m]\n"
}
status_skip() {
-echo -ne "\r[SKIP] $1\n"
+ echo -ne "\r[SKIP] $1\n"
}
error_msg() {
-echo -ne " $1\n"
+ echo -ne " $1\n"
}
ROOTDIR="$(pwd)"
PKGDIR="$(pwd)/packages"
@@ -170,9 +172,13 @@ build_kernel() {
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-kernel.buildlog
+ fi
error_msg "Failed to build package vyos-kernel, look in vyos-kernel.buildlog to examine the fault\n"
return 1
fi
+
VERSION=$(grep "^VERSION" Makefile | grep -Eo '[0-9]{1,4}')
PATCHLEVEL=$(grep "^PATCHLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
SUBLEVEL=$(grep "^SUBLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
@@ -216,6 +222,9 @@ build_wireguard() {
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-wireguard.buildlog
+ fi
error_msg "Failed to build package vyos-wireguard, look in vyos-wireguard.buildlog to examine the fault\n"
return 2
fi
@@ -249,13 +258,15 @@ build_accel-ppp() {
( set -e
pushd packages/vyos-accel-ppp > /dev/null
- #echo "src/wireguard.ko /lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra" > debian/wireguard-modules.install
echo "lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos/extra/*.ko" > debian/vyos-accel-ppp-ipoe-kmod.install
sed -i "s#[0-9].[0-9][0-9].[0-9]-amd64-vyos#$VERSION.$PATCHLEVEL.$SUBLEVEL-$ARCH-vyos#g" debian/rules
KERNELDIR=$PKGDIR/vyos-kernel dpkg-buildpackage -uc -us -tc -b >$PKGDIR/vyos-accel-ppp.buildlog 2>&1
)
if [ $? -ne 0 ]; then
status_fail
+ if [ $VERBOSE ]; then
+ cat $PKGDIR/vyos-accel-ppp.buildlog
+ fi
error_msg "Failed to build package vyos-accel-ppp, look in vyos-accel-ppp.buildlog to examine the fault\n"
return 1
fi