-
Notifications
You must be signed in to change notification settings - Fork 34
/
glance.sh
executable file
·41 lines (27 loc) · 1.16 KB
/
glance.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
#!/bin/bash
# Settings
. settings
apt-get install -y glance python-mysqldb mysql-client curl python-httplib2
# Glance Setup
mysql -h $MYSQL_HOST -u root -p$MYSQL_ROOT_PASS -e 'DROP DATABASE IF EXISTS glance;'
mysql -h $MYSQL_HOST -u root -p$MYSQL_ROOT_PASS -e 'CREATE DATABASE glance;'
echo "GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY '$MYSQL_GLANCE_PASS'; FLUSH PRIVILEGES;" | mysql -h $MYSQL_HOST -u root -p$MYSQL_ROOT_PASS
sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" glance-registry.conf.tmpl > glance-registry.conf
sed -e "s,%MYSQL_HOST%,$MYSQL_HOST,g" -i glance-registry.conf
sed -e "s,%MYSQL_GLANCE_PASS%,$MYSQL_GLANCE_PASS,g" -i glance-registry.conf
sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" glance-api.conf.tmpl > glance-api.conf
service glance-api stop
service glance-registry stop
sleep 2
cp glance-registry.conf glance-api.conf /etc/glance/
chown glance:glance /etc/glance/glance-registry.conf
chown glance:glance /etc/glance/glance-api.conf
glance-manage db_sync
service glance-api start
sleep 2
service glance-registry start
sleep 2
./glance-upload-ttylinux.sh
./glance-upload-oneiric.sh
./glance-upload-loader.sh
./glance-upload-lucid-loader.sh