Skip to content

Commit 1ec9d79

Browse files
committed
Merge pull request openstack#6 from cloudbuilders/move_files
move apts/pips to files directory
2 parents 57bca7e + bf3868d commit 1ec9d79

10 files changed

Lines changed: 25 additions & 26 deletions

File tree

‎build_lxc.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ if [ ! -d $CACHEDIR ]; then
5555
# trigger the initial debootstrap
5656
lxc-create -n $CONTAINER -t natty -f $LXC_CONF
5757
chroot $CACHEDIR apt-get update
58-
chroot $CACHEDIR apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
59-
chroot $CACHEDIR pip install `cat pips/*`
58+
chroot $CACHEDIR apt-get install -y `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
59+
chroot $CACHEDIR pip install `cat files/pips/*`
6060
git clone https://github.com/cloudbuilders/nova.git $CACHEDIR/opt/nova
6161
git clone https://github.com/cloudbuilders/openstackx.git $CACHEDIR/opt/openstackx
6262
git clone https://github.com/cloudbuilders/noVNC.git $CACHEDIR/opt/noVNC

‎build_nfs.sh‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [ ! -d proto ]; then
1313
debootstrap natty proto
1414
cp files/sources.list proto/etc/apt/sources.list
1515
chroot proto apt-get update
16-
chroot proto apt-get install -y `cat apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
17-
chroot proto pip install `cat pips/*`
16+
chroot proto apt-get install -y `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
17+
chroot proto pip install `cat files/pips/*`
1818
git clone https://github.com/cloudbuilders/nova.git proto/opt/nova
1919
git clone https://github.com/cloudbuilders/openstackx.git proto/opt/openstackx
2020
git clone https://github.com/cloudbuilders/noVNC.git proto/opt/noVNC
@@ -34,14 +34,13 @@ echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts
3434
# copy kernel modules
3535
cp -pr /lib/modules/`uname -r` $DEST/lib/modules
3636

37-
# inject stack.sh files
38-
cp -r files $DEST/opt/files
3937

4038
# copy openstack installer and requirement lists to a new directory.
4139
mkdir -p $DEST/opt
40+
41+
# inject stack.sh and dependant files
42+
cp -r files $DEST/opt/files
4243
cp stack.sh $DEST/opt/stack.sh
43-
cp -r pips $DEST/opt
44-
cp -r apts $DEST/opt
4544

4645
# injecting root's public ssh key if it exists
4746
if [ -f /root/.ssh/id_rsa.pub ]; then
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎stack.sh‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ if ! grep -q natty /etc/lsb-release; then
2121
fi
2222
fi
2323

24-
# stack.sh keeps the list of **apt** and **pip** dependencies in files.
25-
# Additionally we have a few config templates and other useful files useful
26-
# installation. They are needed to be located at ``apts``, ``files`` and
27-
# ``pips`` in the ``DEVSTACK`` directory (next to this script).
28-
DEVSTACK=`pwd`
29-
if [ ! -d $DEVSTACK/apts ] || [ ! -d $DEVSTACK/files ] || [ ! -d $DEVSTACK/pips ]; then
30-
echo "ERROR: missing devstack files - did you grab more than just stack.sh?"
24+
# stack.sh keeps the list of **apt** and **pip** dependencies in external
25+
# files, along with config templates and other useful files. You can find these
26+
# in the ``files`` directory (next to this script). We will reference this
27+
# directory using the ``FILES`` variable in this script.
28+
FILES=`pwd`/files
29+
if [ ! -d $FILES ]; then
30+
echo "ERROR: missing devstack/files - did you grab more than just stack.sh?"
3131
exit 1
3232
fi
3333

@@ -117,10 +117,10 @@ mysql-server-5.1 mysql-server/start_on_boot boolean true
117117
MYSQL_PRESEED
118118

119119
# install apt requirements
120-
sudo apt-get install -y -q `cat $DEVSTACK/apts/* | cut -d\# -f1 | grep -Ev "mysql-server|rabbitmq-server"`
120+
sudo apt-get install -y -q `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-server|rabbitmq-server"`
121121

122122
# install python requirements
123-
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $DEVSTACK/pips/*`
123+
sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
124124

125125
# git clone only if directory doesn't exist already
126126
function git_clone {
@@ -164,7 +164,7 @@ cd $DASH_DIR/openstack-dashboard; sudo python setup.py develop
164164

165165
# Add a useful screenrc. This isn't required to run openstack but is we do
166166
# it since we are going to run the services in screen for simple
167-
cp $DEVSTACK/files/screenrc ~/.screenrc
167+
cp $FILES/screenrc ~/.screenrc
168168

169169
## TODO: update current user to allow sudo for all commands in files/sudo/*
170170

@@ -208,20 +208,20 @@ if [[ "$ENABLED_SERVICES" =~ "dash" ]]; then
208208
cd $DASH_DIR/openstack-dashboard
209209

210210
# Includes settings for Nixon, to expose munin charts.
211-
sudo cp $DEVSTACK/files/dash_settings.py local/local_settings.py
211+
sudo cp $FILES/dash_settings.py local/local_settings.py
212212

213213
dashboard/manage.py syncdb
214214

215215
# create an empty directory that apache uses as docroot
216216
sudo mkdir -p $DASH_DIR/.blackhole
217217

218218
## Configure apache's 000-default to run dashboard
219-
sudo cp $DEVSTACK/files/000-default.template /etc/apache2/sites-enabled/000-default
219+
sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default
220220
sudo sed -e "s,%DASH_DIR%,$DASH_DIR,g" -i /etc/apache2/sites-enabled/000-default
221221

222-
# ``python setup.py develop`` left some files owned by root in ``DASH_DIR`` and
223-
# others by the original owner. We need to change the owner to apache so
224-
# dashboard can run
222+
# ``python setup.py develop`` left some files owned by root in ``DASH_DIR``
223+
# and others are owned by the user you are using to run this script.
224+
# We need to change the owner to apache for dashboard to run.
225225
sudo chown -R www-data:www-data $DASH_DIR
226226
fi
227227

@@ -271,7 +271,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
271271
mysql -u$MYSQL_USER -p$MYSQL_PASS -e 'CREATE DATABASE glance;'
272272
# Copy over our glance-registry.conf
273273
GLANCE_CONF=$GLANCE_DIR/etc/glance-registry.conf
274-
cp $DEVSTACK/files/glance-registry.conf $GLANCE_CONF
274+
cp $FILES/glance-registry.conf $GLANCE_CONF
275275
sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/glance,g" -i $GLANCE_CONF
276276
fi
277277

@@ -367,11 +367,11 @@ if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
367367

368368
# FIXME (anthony) keystone should use keystone.conf.example
369369
KEYSTONE_CONF=$KEYSTONE_DIR/etc/keystone.conf
370-
cp $DEVSTACK/files/keystone.conf $KEYSTONE_CONF
370+
cp $FILES/keystone.conf $KEYSTONE_CONF
371371
sudo sed -e "s,%SQL_CONN%,$BASE_SQL_CONN/keystone,g" -i $KEYSTONE_CONF
372372

373373
# initialize keystone with default users/endpoints
374-
BIN_DIR=$KEYSTONE_DIR/bin bash $DEVSTACK/files/keystone_data.sh
374+
BIN_DIR=$KEYSTONE_DIR/bin bash $FILES/keystone_data.sh
375375
fi
376376

377377

0 commit comments

Comments
 (0)