-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate.sh
executable file
·85 lines (72 loc) · 2.13 KB
/
update.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
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
79
80
81
82
83
84
85
#!/bin/bash
# packages:
# git libmysqlclient-dev python-tox libpq-dev python-dev
# libxml2-dev libxslt-dev libffi-dev python-libvirt pkg-config
# libvirt-dev
GEN_SERVICES="nova cinder glance ceilometer heat"
PREBUILT_SERVICES="keystone designate neutron swift"
BRANCH="master"
set -x
setup()
{
SERVICE=$1
mkdir ~/openstack || true
cd ~/openstack
rm -rf ${SERVICE}
git clone https://github.com/openstack/${SERVICE}.git
cd ${SERVICE}
echo "Generating ${BRANCH} for ${SERVICE}"
}
commit()
{
SERVICE=$1
cd ~/ossc
git add samples
git commit -a -m "${SERVICE}: ${LOG_SUFFIX}"
}
for SERVICE in ""${PREBUILT_SERVICES}""
do
setup ${SERVICE}
RELEASE=`basename ${BRANCH}`
LOG_SUFFIX=`git log -n1 --oneline`
echo "Last commit for ${SERVICE} is ${LOG_SUFFIX}"
if [ "${SERVICE}" == "neutron" ]; then
cp etc/${SERVICE}.conf ~/ossc/samples/
cp etc/l3_agent.ini ~/ossc/samples/
cp etc/metadata_agent.ini ~/ossc/samples/
cp etc/dhcp_agent.ini ~/ossc/samples/
elif [ "${SERVICE}" == "keystone" ]; then
cp etc/${SERVICE}*conf.sample ~/ossc/samples/
elif [ "${SERVICE}" == "swift" ]; then
cp etc/${SERVICE}*.conf-sample ~/ossc/samples/swift
else
cp etc/${SERVICE}/${SERVICE}.conf.sample ~/ossc/samples/
fi
commit ${SERVICE}
done
for SERVICE in ""${GEN_SERVICES}""
do
setup ${SERVICE}
rm -rf .venv
tox -egenconfig
if [ $? -ne 0 ]; then
echo "tox failed for ${SERVICE}, cowardly refusing to check in the result"
continue
fi
RELEASE=`basename ${BRANCH}`
LOG_SUFFIX=`git log -n1 --oneline`
echo "Last commit for ${SERVICE} is ${LOG_SUFFIX}"
cp etc/${SERVICE}/${SERVICE}*conf.sample ~/ossc/samples/
# glance is special for some annoying reason
if [ "${SERVICE}" == "glance" ]; then
cp etc/${SERVICE}*conf.sample ~/ossc/samples/
fi
# ceilometer is also a snowflake, lots of snowflakes...
if [ "${SERVICE}" == "ceilometer" ]; then
cp etc/${SERVICE}/${SERVICE}.conf ~/ossc/samples/
fi
commit ${SERVICE}
done
echo "Pushing"
cd ~/ossc
git push -u origin master