Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 72 lines (63 sloc) 1.78 KB
#!/bin/bash
abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
dirname="$(dirname $abspath)"
cd "$dirname" || exit -1
OurSpec="openstack-dashboard.spec"
GithubUserProject="griddynamics/openstack-rhel"
GithubSource="griddynamics/openstack-dashboard"
ActualVersion="$(grep '^Version:' $OurSpec | sed 's/^Version:\s\+//')"
ActualRelease="0.`date +%Y%m%d.%H%M`"
ActualTarBall=%{name}-%{version}.tar.gz
source trigger.conf
source build_helpers
# If you need to build a specific version - specify it as ./build release_num (digits only).
# If build # is not specified, latest available tarball will be built
case "$1" in
build)
check_enviroment
check_spec_update
check_git_update
get_git
update_spec
create_srpm
create_rpm && commit_spec || undo_changes
sign_rpm
update_repo
exit 0
#do_mock
;;
check)
check_git_update
check_spec_update
[[ $FireNewBuild == "1" ]] || exit 0
curl -s "http://$jenkins/job/$JobName/build"
[ $Debug ] && echo "Fire jenkins to build $JobName"
exit 0
;;
build_ver)
ActualRelease=$2
build
;;
release_check)
check_spec_update
[[ $FireNewBuild == "1" ]] || exit 0
curl -s "http://$jenkins/job/$JobName/build"
[ $Debug ] && echo "Fire jenkins to build $JobName"
exit 0
;;
release_build)
create_rpm # && commit_spec || undo_changes
sign_rpm
update_repo
exit 0
;;
*)
echo $"Usage: $0 {build|check|build_ver|release}"
echo "build - build rpms"
echo "check - check for updates and trigger jenkins"
echo "build_ver NUM - build specified release"
echo "release_check - check release if spec update"
echo "release_build - build release"
exit 2
esac
exit $?