-
Notifications
You must be signed in to change notification settings - Fork 18
/
trigger-glance-new
executable file
·73 lines (58 loc) · 1.8 KB
/
trigger-glance-new
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
dirname="$(dirname $abspath)"
cd "$dirname" || exit -1
prj="glance"
OurSpec="openstack-$prj.spec"
DevMileStone="d3"
TarballsHome="http://glance.openstack.org/tarballs"
CurTarballVer=(`curl -s $TarballsHome/?C=M\;O=D| grep $DevMileStone | grep -m 1 $prj-[0-9] | perl -p -e 's!^.*$prj-(\d+\.\d+)~(\w\d)~(\d+.r*\d+)\.tar\.gz.*$!\n$1 $2 $3 $4 $5\n!i'`)
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_for_update
check_enviroment
update_spec
get_tarball
create_srpm
create_rpm && commit_spec || undo_changes
sign_rpm
update_repo
#do_mock
;;
check)
check_for_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
;;
*)
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 $?