diff --git a/autogen.sh b/autogen.sh index 94f1b017..98700836 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,14 +1,9 @@ -#!/bin/sh +#!/bin/bash -if [ ! -z ${TRAVIS_TAG} ]; -then - ZFS_BUILD_BRANCH=${TRAVIS_TAG} -else - . ./fetch-zfs-branch.sh -fi +source ./fetch-libcstor-branch.sh -echo "Using zfs branch - ${ZFS_BUILD_BRANCH}" -echo $(wget -O /tmp/zrepl_prot.h https://raw.githubusercontent.com/openebs/libcstor/${ZFS_BUILD_BRANCH}/include/zrepl_prot.h) +echo "Using libcstor branch - ${LIBCSTOR_BUILD_BRANCH}" +echo $(wget -O /tmp/zrepl_prot.h https://raw.githubusercontent.com/openebs/libcstor/${LIBCSTOR_BUILD_BRANCH}/include/zrepl_prot.h) autoreconf -fiv rm -Rf autom4te.cache diff --git a/build_image.sh b/build_image.sh index d9b4dd28..1211c7eb 100755 --- a/build_image.sh +++ b/build_image.sh @@ -3,7 +3,7 @@ set -e pwd make clean -sh autogen.sh +bash autogen.sh ./configure --enable-replication make clean make diff --git a/fetch-libcstor-branch.sh b/fetch-libcstor-branch.sh new file mode 100755 index 00000000..58e8de9d --- /dev/null +++ b/fetch-libcstor-branch.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -e + +#This file is used to specify the LibCStor branch from +# where to fetch the zrepl header files. Depending +# on the release - the header file should be fetched +# from different location. +# +# For example: +# master -> master +# v0.7.x -> v0.7.x +# +# The above 1:1 mapping can't always be guaranteed when +# working in forked repos with branch names like: +# fix-ta123 +# +# Now, `fix-ta123` could be a created either from master or +# v0.7.x. This file needs to determine the correct libcstor branch +# by finding the parent of `fix-ta123` and checking if the +# correpsonding branch exists on openebs/libcstor. +# +#For the moment, we will go with making sure the correct +# branch name is provided as part of the release process. +if [ -z ${TRAVIS_BRANCH} ] || + [ ${TRAVIS_BRANCH} == "replication" ]; then + LIBCSTOR_BUILD_BRANCH="master" +else + LIBCSTOR_BUILD_BRANCH=${TRAVIS_BRANCH} +fi + +export LIBCSTOR_BUILD_BRANCH + diff --git a/fetch-zfs-branch.sh b/fetch-zfs-branch.sh deleted file mode 100755 index 0f1f2203..00000000 --- a/fetch-zfs-branch.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -e - -#This file is used to specify the ZFS branch from -# where to fetch the zfs header files. Depending -# on the release - the header file should be fetched -# from different location. -# -# For example: -# master -> master -# v0.7.x -> v0.7.x -# -# The above 1:1 mapping can't always be guaranteed when -# working in forked repos with branch names like: -# fix-ta123 -# -# Now, `fix-ta123` could be a created either from master or -# v0.7.x. This file needs to determine the correct zfs branch -# by finding the parent of `fix-ta123` and checking if the -# correpsonding branch exists on openebs/zfs. -# -#For the moment, we will go with making sure the correct -# branch name is provided as part of the release process. -ZFS_BUILD_BRANCH="master" -export ZFS_BUILD_BRANCH -