Build 6Wind/quagga pkgs for Centos7 and Ubuntu
[releng/builder.git] / jjb / netvirt / quagga-build.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the term s of the Eclipse Public License
8 # v1.0 accompanies testing this distribution with Netvirt jobs, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> quagga-build.sh"
12
13 set -e -x
14
15 # The script builds 6wind/quagga source and binary packages from zrpcd
16 # repository for testing router functionalities with Netvirt jobs, .
17
18 pushd "$(pwd)/zrpcd"
19
20 chmod a+x "$(pwd)/pkgsrc/dev_compile_script.sh"
21 cd "$(pwd)/pkgsrc" && sudo "./dev_compile_script.sh" -p -d -b -v "$QUAGGA_VERSION"
22
23 # Move packages into a that will be uploaded to Nexus
24 UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
25 mkdir -p "$UPLOAD_FILES_PATH"
26
27 OS=$(facter operatingsystem)
28
29 case "$OS" in
30     Ubuntu)
31         mv "$WORKSPACE/zrpcd/pkgsrc/"*.deb "$UPLOAD_FILES_PATH" || true
32     ;;
33     CentOS|RedHat)
34         mv "$WORKSPACE/zrpcd/pkgsrc/"*.rpm "$UPLOAD_FILES_PATH" || true
35     ;;
36     *)
37         # nothing to do
38     ;;
39 esac
40
41 popd
42
43 # todo: remove below lines once the scripts in zrpcd repos build the
44 # source packages.
45 # Ref: https://lists.opendaylight.org/pipermail/integration-dev/2018-July/012330.html
46 tar cvzf "$WORKSPACE/upload_files/zrpcd.$(date +%F).tar.gz" "$(pwd)/zrpcd"