forked from griddynamics/openstack-rhel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebuild_config_rpms.sh
executable file
·42 lines (33 loc) · 1.02 KB
/
rebuild_config_rpms.sh
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
#!/bin/sh
if [ ! -d ".git" ]; then
echo "Need to run from Git repo openstack-rhel !"
exit -1
fi
sources='/home/build/rpmbuild/SOURCES'
sandbox='/home/build/rpmbuild/RPMS/noarch'
branch=$(git branch|grep '*'|cut -f2 -d' ')
repo="/home/build/repo/$branch/openstack/"
host=`hostname -s`
if [[ "$host" != "je-cssn" ]]; then
echo "That script should be run only on Jenkins host!"
fi
cp SOURCES/* $sources
rpmbuild -ba openstack-repo.spec
if [ "$?" != "0" ]; then
exit -1
fi
rpmbuild -ba openstack-nova-cc-config.spec
if [ "$?" != "0" ]; then
exit -1
fi
rpmbuild -ba openstack-nova-compute-config.spec
if [ "$?" != "0" ]; then
exit -1
fi
./sign_rpm $sandbox/openstack-repo-*.rpm
./sign_rpm $sandbox/openstack-nova-cc-config-*.rpm
./sign_rpm $sandbox/openstack-nova-compute-config-*.rpm
rm -f $repo/openstack-repo-*.rpm
rm -f $repo/openstack-nova-cc-config-*.rpm
rm -f $repo/openstack-nova-compute-config-*.rpm
mv $sandbox/openstack-repo-*.rpm $sandbox/openstack-nova-cc-config-*.rpm $sandbox/openstack-nova-compute-config-*.rpm $repo