Build 6Wind/quagga pkgs for Centos7 and Ubuntu 19/63519/24
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 26 Sep 2017 05:27:49 +0000 (15:27 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 25 Oct 2018 00:07:48 +0000 (10:07 +1000)
Build source and binary packages for CentOS7 and Ubuntu 16.04.
The packages are pushed into the Nexus thirdparty repo which can
be later pulled in and used by netvirt CSIT jobs for testing.

JIRA: https://jira.linuxfoundation.org/browse/RELENG-1383
Change-Id: I16377e5092f065148e47e3a406c7f84d509547f6
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
jjb/netvirt/netvirt-dependencies.yaml [new file with mode: 0644]
jjb/netvirt/quagga-build.sh [new file with mode: 0644]

diff --git a/jjb/netvirt/netvirt-dependencies.yaml b/jjb/netvirt/netvirt-dependencies.yaml
new file mode 100644 (file)
index 0000000..db1b70c
--- /dev/null
@@ -0,0 +1,93 @@
+---
+- project:
+    name: netvirt-thirdparty-quagga-dependencies
+    project: 'netvirt'
+    project-name: 'netvirt'
+    jobs:
+      - 'netvirt-thirdparty-quagga-{platform}'
+
+    quagga-version: '5'
+    mvn-opts: ''
+    mvn-params: ''
+    mvn-version: mvn35
+
+    # common parameters required for 'lf-infra-deploy-maven-file' builder
+    repo-id: 'thirdparty'
+    upload-files-dir: '$WORKSPACE/upload_files'
+    group-id: 'quagga$QUAGGA_VERSION'
+
+    # Used by the release job
+    staging-profile-id: a67da0ffbb1ba
+
+    platform:
+      - centos7:
+          build-node: centos7-builder-2c-8g
+      - ubuntu1604:
+          build-node: ubuntu1604-mininet-ovs-25-1c-4g
+
+- job-template:
+    name: 'netvirt-thirdparty-quagga-{platform}'
+    project-type: freestyle
+    node: '{build-node}'
+    concurrent: true
+
+    properties:
+      - opendaylight-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+
+    parameters:
+      - opendaylight-infra-parameters:
+          os-cloud: '{os-cloud}'
+          project: '{project}'
+          branch: '{branch}'
+          refspec: 'refs/heads/{branch}'
+          artifacts: '{archive-artifacts}'
+      - lf-infra-maven-parameters:
+          mvn-opts: '{mvn-opts}'
+          mvn-params: '{mvn-params}'
+          mvn-version: '{mvn-version}'
+          staging-profile-id: '{staging-profile-id}'
+      - string:
+          name: QUAGGA_VERSION
+          default: '{quagga-version}'
+          description: 'quagga version'
+
+    scm:
+      - git-netvirt-quagga
+
+    wrappers:
+      - opendaylight-infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - lf-infra-pre-build
+      - netvirt-build-quagga
+      - lf-infra-deploy-maven-file:
+          global-settings-file: 'global-settings'
+          settings-file: 'netvirt-settings'
+          mvn-version: '{mvn-version}'
+          repo-id: '{repo-id}'
+          group-id: '{group-id}'
+          upload-files-dir: '{upload-files-dir}'
+          maven-repo-url: '$NEXUS_URL/content/repositories/thirdparty'
+
+    publishers:
+      - email-notification:
+          email-recipients: '{email-recipients}'
+          email-prefix: '[netvirt]'
+      - lf-infra-publish
+
+- builder:
+    name: 'netvirt-build-quagga'
+    builders:
+      - shell: !include-raw-escape: quagga-build.sh
+
+- scm:
+    name: 'git-netvirt-quagga'
+    scm:
+      - git:
+          url: https://github.com/6WIND/zrpcd.git
+          basedir: 'zrpcd'
+          branches:
+            - 'issue_32_bis'
+          wipe-workspace: true
diff --git a/jjb/netvirt/quagga-build.sh b/jjb/netvirt/quagga-build.sh
new file mode 100644 (file)
index 0000000..ca46597
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the term s of the Eclipse Public License
+# v1.0 accompanies testing this distribution with Netvirt jobs, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> quagga-build.sh"
+
+set -e -x
+
+# The script builds 6wind/quagga source and binary packages from zrpcd
+# repository for testing router functionalities with Netvirt jobs, .
+
+pushd "$(pwd)/zrpcd"
+
+chmod a+x "$(pwd)/pkgsrc/dev_compile_script.sh"
+cd "$(pwd)/pkgsrc" && sudo "./dev_compile_script.sh" -p -d -b -v "$QUAGGA_VERSION"
+
+# Move packages into a that will be uploaded to Nexus
+UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+mkdir -p "$UPLOAD_FILES_PATH"
+
+OS=$(facter operatingsystem)
+
+case "$OS" in
+    Ubuntu)
+        mv "$WORKSPACE/zrpcd/pkgsrc/"*.deb "$UPLOAD_FILES_PATH" || true
+    ;;
+    CentOS|RedHat)
+        mv "$WORKSPACE/zrpcd/pkgsrc/"*.rpm "$UPLOAD_FILES_PATH" || true
+    ;;
+    *)
+        # nothing to do
+    ;;
+esac
+
+popd
+
+# todo: remove below lines once the scripts in zrpcd repos build the
+# source packages.
+# Ref: https://lists.opendaylight.org/pipermail/integration-dev/2018-July/012330.html
+tar cvzf "$WORKSPACE/upload_files/zrpcd.$(date +%F).tar.gz" "$(pwd)/zrpcd"