forked from griddynamics/openstack-rhel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trigger-swift-new
executable file
·79 lines (61 loc) · 1.91 KB
/
trigger-swift-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
73
74
75
76
77
78
#!/bin/bash
abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
dirname="$(dirname $abspath)"
cd "$dirname" || exit -1
prj="swift"
OurSpec="openstack-$prj.spec"
DevMileStone="d4"
TarballsHome="http://swift.openstack.org/tarballs"
CurTarballVer=(`curl -s $TarballsHome/?C=M\;O=D | grep -m 1 swift-[0-9] | perl -p -e 's!^.*swift-(\d+\.\d+\.\d+)~(\d+\.r*\d+)\.tar\.gz.*$!\n$1 $2 $3 $4 $5\n!i'`)
ActualVersion=${CurTarballVer[0]}
ActualRelease=$ReleasePreSymbol${CurTarballVer[1]}
ActualTarBall="$prj-$ActualVersion~${CurTarballVer[1]}.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_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 $?