Enable Zuul v3 CI

I'm also proactively disabling the top-level parallel build again
because the code has not been merged upstream, and because there are
already some conflicts (see the ML thread for details).

Also update the internal projects (so that the shared depndencies are
used, and bring in netconf-cli.

(And try to fix a random rauc error, yay.)

Change-Id: I81f2f3195aa1dbe4527135861cd486eb559d65ed
See-also: http://lists.busybox.net/pipermail/buildroot/2019-February/243811.html
diff --git a/.gitmodules b/.gitmodules
index 71ebf8a..6c1729d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -6,3 +6,6 @@
 	path = submodules/cla-sysrepo
 	url = ../../CzechLight/cla-sysrepo
 	branch = master
+[submodule "submodules/netconf-cli"]
+	path = submodules/netconf-cli
+	url = ../netconf-cli
diff --git a/.zuul.yaml b/.zuul.yaml
new file mode 100644
index 0000000..5283b5e
--- /dev/null
+++ b/.zuul.yaml
@@ -0,0 +1,26 @@
+- job:
+    name: czechlight-clearfog
+    parent: run-ci-build-sh
+    timeout: 5400
+    vars:
+      prepare_git_submodules: true
+    required-projects: &projects
+      - github/buildroot/buildroot
+      - CzechLight/dependencies
+      - CzechLight/cla-sysrepo
+      - CzechLight/netconf-cli
+      - github/CESNET/libyang
+      - github/sysrepo/libredblack
+      - github/sysrepo/sysrepo
+      - github/CESNET/libnetconf2
+      - github/CESNET/Netopeer2
+      - github/philsquared/Catch
+      - github/docopt/docopt.cpp
+      - github/gabime/spdlog
+      - github/rollbear/trompeloeil
+      - github/AmokHuginnsson/replxx
+
+- project:
+    check:
+      jobs:
+        - czechlight-clearfog
diff --git a/ci/build.sh b/ci/build.sh
new file mode 100755
index 0000000..17d075b
--- /dev/null
+++ b/ci/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -eux -o pipefail
+shopt -s failglob
+
+ZUUL_JOB_NAME=$(jq < ~/zuul-env.json -r '.job')
+ZUUL_PROJECT_SRC_DIR=$HOME/$(jq < ~/zuul-env.json -r '.project.src_dir')
+ZUUL_PROJECT_SHORT_NAME=$(jq < ~/zuul-env.json -r '.project.short_name')
+
+BUILD_DIR=~/build
+mkdir ${BUILD_DIR}
+cd ${BUILD_DIR}
+
+${ZUUL_PROJECT_SRC_DIR}/dev-setup-git.sh
+
+if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then
+    make czechlight_clearfog_defconfig
+else
+    echo "Unrecognized job name, cannot determine defconfig target"
+    exit 1
+fi
+
+echo BR2_PRIMARY_SITE=\"https://ci-logs.gerrit.cesnet.cz/t/public/mirror/buildroot\" >> .config
+make source
+
+make
+mv images/update.raucb ~/zuul-output/artifacts/
+
+if [[ "${ZUUL_JOB_NAME}" =~ clearfog ]]; then
+    mv images/u-boot-spl.kwb ~/zuul-output/artifacts/
+fi
+
+# TODO: USB image as well? (`fallocate -d` to make it sparse)
+# TODO: make legal-info
diff --git a/configs/czechlight_clearfog_defconfig b/configs/czechlight_clearfog_defconfig
index 2c39159..bdffe5a 100644
--- a/configs/czechlight_clearfog_defconfig
+++ b/configs/czechlight_clearfog_defconfig
@@ -7,7 +7,6 @@
 BR2_STRIP_EXCLUDE_FILES="cla-* netopeer2* sysrepo* libsysrepo* libSysrepo* libnetconf2* libyang* netconf-cli"
 BR2_STRIP_EXCLUDE_DIRS="/usr/lib/libyang /usr/lib/sysrepo"
 BR2_REPRODUCIBLE=y
-BR2_PER_PACKAGE_DIRECTORIES=y
 BR2_SSP_STRONG=y
 BR2_TOOLCHAIN_EXTERNAL=y
 BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y
diff --git a/dev-setup-git.sh b/dev-setup-git.sh
index c03ee69..9563e1d 100755
--- a/dev-setup-git.sh
+++ b/dev-setup-git.sh
@@ -8,15 +8,17 @@
 # Configure the local.mk with path to the individual repositories
 CZECHLIGHT_BR2_EXT_LOC="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 cat > local.mk <<EOF
-DOCOPT_CPP_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/docopt.cpp
-SPDLOG_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/spdlog
-LIBYANG_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/libyang
-SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/sysrepo
-LIBNETCONF2_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/libnetconf2
-NETOPEER2_KEYSTORED_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/Netopeer2
-NETOPEER2_SERVER_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/Netopeer2
-NETOPEER2_CLI_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/Netopeer2
+DOCOPT_CPP_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/docopt.cpp
+SPDLOG_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/spdlog
+REPLXX_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/replxx
+LIBYANG_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/libyang
+SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/sysrepo
+LIBNETCONF2_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/libnetconf2
+NETOPEER2_KEYSTORED_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/Netopeer2
+NETOPEER2_SERVER_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/Netopeer2
+NETOPEER2_CLI_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo/submodules/dependencies/Netopeer2
 CLA_SYSREPO_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/cla-sysrepo
+NETCONF_CLI_OVERRIDE_SRCDIR = ${CZECHLIGHT_BR2_EXT_LOC}/submodules/netconf-cli
 EOF
 
 # We have to run make first so that the proxy Makefile is created and the BR2_EXTERNAL is remembered
diff --git a/submodules/buildroot b/submodules/buildroot
index 31ff9ee..28a0da1 160000
--- a/submodules/buildroot
+++ b/submodules/buildroot
@@ -1 +1 @@
-Subproject commit 31ff9ee20c6a034f896282b5bb3276da6f3fc1bd
+Subproject commit 28a0da1a09c3b92807a0b8b9ee84c9c7a7cf7f5d
diff --git a/submodules/cla-sysrepo b/submodules/cla-sysrepo
index 7a74633..b3e9ed2 160000
--- a/submodules/cla-sysrepo
+++ b/submodules/cla-sysrepo
@@ -1 +1 @@
-Subproject commit 7a74633e360b5186ee6291b20c23a6ed4e2b9d3d
+Subproject commit b3e9ed24898467020de00c0fdac4f0c6819b48d6
diff --git a/submodules/netconf-cli b/submodules/netconf-cli
new file mode 160000
index 0000000..8a91466
--- /dev/null
+++ b/submodules/netconf-cli
@@ -0,0 +1 @@
+Subproject commit 8a91466f38ea4bfa0b80ba96879dc3c3e26719b5