diff options
-rw-r--r-- | Dockerfile | 5 | ||||
-rw-r--r-- | Jenkinsfile | 119 | ||||
-rwxr-xr-x | scripts/build-submodules | 25 |
3 files changed, 131 insertions, 18 deletions
@@ -4,8 +4,7 @@ FROM debian:jessie RUN echo 'deb http://ftp.debian.org/debian jessie-backports main' | tee -a /etc/apt/sources.list &&\ - apt-get update &&\ - apt-get install -y \ + apt-get update && apt-get install -y \ vim \ git \ make \ @@ -117,7 +116,7 @@ RUN apt-get install -y \ libelf-dev # Packages needed for vyos-accel-ppp -RUN apt-get install -y \ +RUN apt-get update && apt-get install -y \ cdbs \ cmake \ liblua5.1-dev diff --git a/Jenkinsfile b/Jenkinsfile index d46fdcbf..37bdeeee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,7 +21,7 @@ pipeline { dockerfile { filename 'Dockerfile' label 'jessie-amd64' - args '--privileged' + args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0' } } @@ -31,8 +31,124 @@ pipeline { 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 + ''' + } + ) + } + } + stage('Build Packages') { + steps { + sh 'scripts/build-submodules' + } + } stage('Build ISO') { steps { + sh 'ls -al' + sh 'ls -al packages' sh 'sudo make iso' } } @@ -44,6 +160,7 @@ pipeline { // change build dir file permissions so wen can cleanup as regular // user (jenkins) afterwards sh 'sudo chmod -R 777 .' + echo 'No cleanup for now ....' deleteDir() /* cleanup our workspace */ } } diff --git a/scripts/build-submodules b/scripts/build-submodules index 2b29907e..3a7ea3a5 100755 --- a/scripts/build-submodules +++ b/scripts/build-submodules @@ -1,5 +1,4 @@ -#!/bin/bash -#set -x +#!/bin/bash if [ ! -d "packages" ]; then echo "This script needs to be executed inside the top root of vyos-build" @@ -12,28 +11,28 @@ print_help() { echo "Execute this sctipt from the root of the vyos-build directory" echo "" echo "This script could be executed from a Debian Jessie installation with all dependencies" - echo "or from the vyos-builder docker container" - echo "docker instructions" + echo "or from the vyos-builder docker container." + echo "" echo "Build the container:" - echo " docker build -t vyos-builder ." + echo " docker build -t vyos-builder ." echo "Compile packages:" - echo " docker run --rm -it -v $(pwd):/vyos -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder scripts/build-docker-subpaclages" + echo " docker run --rm -it -v $(pwd):/vyos -w /vyos --sysctl net.ipv6.conf.lo.disable_ipv6=0 vyos-builder scripts/build-submodules" + echo "" echo "Parameters:" echo " --init-packages - Initiate all subpackages before building" } - while test $# -gt 0 do case "$1" in - -h|-?|--help) + -h|-?|--help) print_help exit 0 ;; - --init-packages) + --init-packages) INIT_PACKAGES=1 ;; - *) + *) (>&2 echo "Error: Argument $1 is not valid") echo "" print_help @@ -100,8 +99,6 @@ build_package() { status_ok } - - echo "Cleaning up buildfiles..." rm -rf $PKGDIR/*.deb rm -rf $PKGDIR/*.changes @@ -158,6 +155,7 @@ for PKG in mdns-repeater \ build_package "$PKG" done + # KERNEL build_kernel() { status_start "Building-package: vyos-kernel" @@ -185,7 +183,6 @@ build_kernel() { build_kernel - # WIREGUARD build_wireguard() { status_start "Building package: vyos-wireguard" @@ -249,7 +246,7 @@ build_accel-ppp() { PATCHLEVEL=$(grep "^PATCHLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') SUBLEVEL=$(grep "^SUBLEVEL" packages/vyos-kernel/Makefile | grep -Eo '[0-9]{1,4}') ARCH=$(dpkg --print-architecture) - + ( 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 |