Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2f0d691ab8
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (34 sloc) 1.933 kB
Debug="1"
jenkins="localhost:8080"
# Name of our project. Taken from spec by default
[ $prj ] || prj=$(grep '^Name:' $OurSpec | sed 's/^Name:\s\+//')
# Storage for our specs
[ $GithubUserProject ] || GithubUserProject="griddynamics/openstack-rhel"
# Source taken from here
[ $GithubSource ] || GithubSource=$GithubUserProject
## Where is tarballs?
[ $TarballsHome ] || TarballsHome="http://$prj.openstack.org/tarballs"
## Where is SPEC?
[ $OurSpec ] || OurSpec="openstack-$prj.spec"
# Added behind release.
ReleasePreSymbol="0."
## Get version of latest TarBall. Returns 2 value: Version and Release. You need to construct your own regexp for your source.
[ $CurTarballVer ] || CurTarballVer=(`curl -s $TarballsHome/?C=M\;O=D| grep -m 1 $prj-[0-9] | perl -p -e 's!^.*$prj-(\d+\.\d+)~(\w\d)~(\d+.\d+)\.tar\.gz.*$!\n$1 $2 $3 $4 $5\n!i'`)
[ $ActualVersion ] || ActualVersion=${CurTarballVer[0]}
[ $ActualRelease ] || ActualRelease=$ReleasePreSymbol${CurTarballVer[2]}
[ $DevMileStone ] || DevMileStone=${CurTarballVer[1]}
[ $ActualTarBall ] || ActualTarBall="$prj-$ActualVersion~$DevMileStone~${CurTarballVer[2]}.tar.gz"
SpecVersion=$(grep '^Version:' $OurSpec | sed 's/^Version:\s\+//')
SpecRelease=$(grep '^Release:' $OurSpec | sed 's/^Release:\s\+//' | sed 's/%{?dist}$//')
# Obtaining current branch name from our local git repo
[ $GitCurBranch ] || GitCurBranch="$(git branch|grep '*'|cut -f2 -d' ')"
[ $Debug ] && echo "Current branch $GitCurBranch"
[ $GitDevBranchName ] || GitDevBranchName="master"
abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
dirname="$(dirname $abspath)"
cd "$dirname" || exit -1
RpmTree=`grep topdir $HOME/.rpmmacros 2>/dev/null | awk '{print ($2)}'`
[ "$RpmTree" == "" ] && RpmTree="$HOME/rpmbuild/"
RepoPath="/home/build/repo/$GitCurBranch/openstack"
LocalSourcePath="/home/build/local-source"
JobName="$(echo $dirname | sed 's/^.*\/jobs\/\([^/]\+\)\/workspace$/\1/')"
Jump to Line
Something went wrong with that request. Please try again.