From: Ali Maredia Date: Tue, 21 Feb 2017 19:35:13 +0000 (-0500) Subject: nfs-ganesha: add validate scripts for each distro X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=054e1d9abe94870236a9feb11aefb11214947265;p=ceph-build.git nfs-ganesha: add validate scripts for each distro Signed-off-by: Ali Maredia --- diff --git a/nfs-ganesha/build/setup b/nfs-ganesha/build/setup new file mode 100644 index 00000000..78c61c20 --- /dev/null +++ b/nfs-ganesha/build/setup @@ -0,0 +1,53 @@ +#! /usr/bin/bash +# +# Ceph distributed storage system +# +# Copyright (C) 2016 Red Hat +# +# Author: Boris Ranto +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# + +set -ex + +# Make sure we execute at the top level directory before we do anything +cd $WORKSPACE + +# This will set the DISTRO and MOCK_TARGET variables +get_distro_and_target + +# Perform a clean-up +cd $WORKSPACE/nfs-ganesha +git clean -fxd + +cd $WORKSPACE/nfs-ganesha-debian +git clean -fxd + +# Make sure the dist directory is clean +cd $WORKSPACE +rm -rf dist +mkdir -p dist + +# Print some basic system info +HOST=$(hostname --short) +echo "Building on $(hostname) with the following env" +echo "*****" +env +echo "*****" + +export LC_ALL=C # the following is vulnerable to i18n + +pkgs=( "chacractl>=0.0.4" ) +install_python_packages "pkgs[@]" + +NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH` +CEPH_BRANCH=`branch_slash_filter $CEPH_BRANCH` + +# ask shaman which chacra instance to use +chacra_url=`curl -f -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/` +# create the .chacractl config file using global variables +make_chacractl_config $chacra_url diff --git a/nfs-ganesha/build/setup_deb b/nfs-ganesha/build/setup_deb deleted file mode 100644 index 160c8a37..00000000 --- a/nfs-ganesha/build/setup_deb +++ /dev/null @@ -1,58 +0,0 @@ -#! /usr/bin/bash -# -# Ceph distributed storage system -# -# Copyright (C) 2016 Red Hat -# -# Author: Boris Ranto -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# - -set -ex - -# Only do actual work when we are a DEB distro -if test "$DISTRO" != "debian" -a "$DISTRO" != "ubuntu"; then - exit 0 -fi - -# Make sure we execute at the top level directory before we do anything -cd $WORKSPACE - -# This will set the DISTRO and MOCK_TARGET variables -get_distro_and_target - -# Perform a clean-up -cd $WORKSPACE/nfs-ganesha -git clean -fxd - -cd $WORKSPACE/nfs-ganesha-debian -git clean -fxd - -# Make sure the dist directory is clean -cd $WORKSPACE -rm -rf dist -mkdir -p dist - -# Print some basic system info -HOST=$(hostname --short) -echo "Building on $(hostname) with the following env" -echo "*****" -env -echo "*****" - -export LC_ALL=C # the following is vulnerable to i18n - -pkgs=( "chacractl>=0.0.4" ) -install_python_packages "pkgs[@]" - -NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH` -CEPH_BRANCH=`branch_slash_filter $CEPH_BRANCH` - -# ask shaman which chacra instance to use -chacra_url=`curl -f -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/` -# create the .chacractl config file using global variables -make_chacractl_config $chacra_url diff --git a/nfs-ganesha/build/setup_rpm b/nfs-ganesha/build/setup_rpm deleted file mode 100644 index ef217fae..00000000 --- a/nfs-ganesha/build/setup_rpm +++ /dev/null @@ -1,58 +0,0 @@ -#! /usr/bin/bash -# -# Ceph distributed storage system -# -# Copyright (C) 2016 Red Hat -# -# Author: Boris Ranto -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# - -set -ex - -# Only do actual work when we are an RPM distro -if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; then - exit 0 -fi - -# Make sure we execute at the top level directory before we do anything -cd $WORKSPACE - -# This will set the DISTRO and MOCK_TARGET variables -get_distro_and_target - -# Perform a clean-up -cd $WORKSPACE/nfs-ganesha -git clean -fxd - -cd $WORKSPACE/nfs-ganesha-debian -git clean -fxd - -# Make sure the dist directory is clean -cd $WORKSPACE -rm -rf dist -mkdir -p dist - -# Print some basic system info -HOST=$(hostname --short) -echo "Building on $(hostname) with the following env" -echo "*****" -env -echo "*****" - -export LC_ALL=C # the following is vulnerable to i18n - -pkgs=( "chacractl>=0.0.4" ) -install_python_packages "pkgs[@]" - -NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH` -CEPH_BRANCH=`branch_slash_filter $CEPH_BRANCH` - -# ask shaman which chacra instance to use -chacra_url=`curl -f -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/` -# create the .chacractl config file using global variables -make_chacractl_config $chacra_url diff --git a/nfs-ganesha/build/validate_deb b/nfs-ganesha/build/validate_deb new file mode 100644 index 00000000..0322b47a --- /dev/null +++ b/nfs-ganesha/build/validate_deb @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# Only do actual work when we are a DEB distro +if test -f /etc/redhat-release ; then + exit 0 +fi diff --git a/nfs-ganesha/build/validate_rpm b/nfs-ganesha/build/validate_rpm new file mode 100644 index 00000000..17b41482 --- /dev/null +++ b/nfs-ganesha/build/validate_rpm @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +# only do work if we are a RPM distro +if [[ ! -f /etc/redhat-release && ! -f /usr/bin/zypper ]] ; then + exit 0 +fi diff --git a/nfs-ganesha/config/definitions/nfs-ganesha.yml b/nfs-ganesha/config/definitions/nfs-ganesha.yml index d7de8e49..9aba05c5 100644 --- a/nfs-ganesha/config/definitions/nfs-ganesha.yml +++ b/nfs-ganesha/config/definitions/nfs-ganesha.yml @@ -119,14 +119,16 @@ If this is checked, then the binaries will be built and pushed to chacra even if # debian build scripts - shell: !include-raw: + - ../../build/validate_deb - ../../../scripts/build_utils.sh - - ../../build/setup_deb + - ../../build/setup - ../../build/build_deb # rpm build scripts - shell: !include-raw: + - ../../build/validate_rpm - ../../../scripts/build_utils.sh - - ../../build/setup_rpm + - ../../build/setup - ../../build/build_rpm publishers: