Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Started parameterizing scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsackett committed Jun 8, 2009
1 parent 0ee8828 commit b69cf23
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
5 changes: 5 additions & 0 deletions scripts/reset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "drop database {{ db_name }};" | mysql --user={{ db_user }} --password={{ db_password }}
rm -rf /home/websites/{{ site_directory }}/
rm -rf /home/websites/lighttpd/{{ site_directory }}
rm /etc/apache2/sites-enabled/{{ apache_conf }} && rm /etc/apache2/sites-available/{{ apache_conf }}
rm /etc/lighttpd/conf-enabled/{{ lighttpd_conf }} && rm /etc/lighttpd/conf-available/{{ lighttpd_conf }}
26 changes: 26 additions & 0 deletions scripts/setup_directories.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

echo "creating necessary folders for deployment..."
for dir in {{ site_folders }}
do
if [[ -d $dir ]]; then
echo $dir "already exists."
else
mkdir $dir
echo "created" $dir
fi
done

echo "creating necessary log files for deployment..."
for logfile in {{ log_files }}
do
if [[ -d $logfile ]]; then
echo $logfile "already exists."
else
touch $logfile
echo "created" $logfile
fi
done

echo "setting permissions where necessary..."
exit
28 changes: 28 additions & 0 deletions scripts/setup_syslinks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
cd /home/websites/lighttpd/fab/site_media/
if [[ -d /home/websites/lighttpd/site_media/css ]]; then
echo "Media links exist."
else
ln -s /home/websites/fab/fabsite/site_media/* .
ln -s /usr/lib/python2.5/site-packages/django/contrib/admin/media ./admin_media
fi

cd /home/websites/fab
if [[ -d /home/websites/fab/cache ]]; then
echo "Cache link exists."
else
ln -s /home/websites/lighttpd/fab/lighttpdcache ./cache
fi

if [[ -d /home/websites/fab/media ]]; then
echo "Second media link exists."
else
ln -s /home/websites/lighttpd/fab/site_media ./media
fi

cd /home/websites/fab/logs
if [[ -d /home/websites/fab/logs/lighttpd ]]; then
echo "Log links exist."
else
ln -s /var/log/lighttpd/fab ./lighttpd
fi
6 changes: 6 additions & 0 deletions settings.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ APACHE_USER = ('', '', '') #(STAGING, INTERNAL, PRODUCTION)

MYSQL_USER = ('', '', '')
MYSQL_PASSWORD = ('', '', '')

SERVER = ('', '', '')
USER = ('', '', '')
LIGHTTPD_PORTS = ('', '', '')
SUBDOMAIN - ('', '', '')
APACHE_PORTS = ('', '', '')
4 changes: 0 additions & 4 deletions weaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ def init(args):
os.path.join(target_dir, 'settings.py')
)

commands = {
'init':init,
}

if __name__ == '__main__':
cmd = sys.argv[1]
args = sys.argv[2:]
Expand Down

0 comments on commit b69cf23

Please sign in to comment.