Added in initial make -- rpm support, tested against Fedora 16, code in for Fedora 17 but needs additional testing. Adjusted initial_data.json to align with current code base, enacted was deprecated from core.user. New scripts/opencloud for database/init/reset/syncdb/runserver commands.
diff --git a/planetstack/core/fixtures/initial_data.json b/planetstack/core/fixtures/initial_data.json
index 6650547..469bc31 100644
--- a/planetstack/core/fixtures/initial_data.json
+++ b/planetstack/core/fixtures/initial_data.json
@@ -495,8 +495,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$v5qKhIyhSQ2N$V8vh2mkqYdjQib6d2jBkpwV57eMBfhd/9eiXqaDLUWg=",
- "email": "padmin@vicci.org",
- "enacted": null
+ "email": "padmin@vicci.org"
}
},
{
@@ -520,8 +519,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "tony@onlab.us",
- "enacted": null
+ "email": "tony@onlab.us"
}
},
{
@@ -545,8 +543,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "mike@onlab.us",
- "enacted": null
+ "email": "mike@onlab.us"
}
},
{
@@ -570,8 +567,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "andy@onlab.us",
- "enacted": null
+ "email": "andy@onlab.us"
}
},
{
@@ -595,8 +591,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "sapan@onlab.us",
- "enacted": null
+ "email": "sapan@onlab.us"
}
},
{
@@ -620,8 +615,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "jcnelson@cs.princeton.edu",
- "enacted": null
+ "email": "jcnelson@cs.princeton.edu"
}
},
{
@@ -645,8 +639,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "llp@onlab.us",
- "enacted": null
+ "email": "llp@onlab.us"
}
},
{
@@ -670,8 +663,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "scott@onlab.us",
- "enacted": null
+ "email": "scott@onlab.us"
}
},
{
@@ -695,8 +687,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "ali@onlab.us",
- "enacted": null
+ "email": "ali@onlab.us"
}
},
{
@@ -720,8 +711,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "bill@onlab.us",
- "enacted": null
+ "email": "bill@onlab.us"
}
},
{
@@ -745,8 +735,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "guru@onlab.us",
- "enacted": null
+ "email": "guru@onlab.us"
}
},
{
@@ -770,8 +759,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "marc@onlab.us",
- "enacted": null
+ "email": "marc@onlab.us"
}
},
{
@@ -795,8 +783,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$dLKRXWJlkuvm$Ycamy79oT1lN0Q5R3B3nvlr70n2X50mL86yraDwzuWk=",
- "email": "siobhan@onlab.us",
- "enacted": null
+ "email": "siobhan@onlab.us"
}
},
{
@@ -820,8 +807,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "pbkdf2_sha256$10000$jaLSTW2ksHEN$HDpjDKieFDjMvtV5wbF/ow3zfq8EqcFtNXLfuo+150s=",
- "email": "demo@onlab.us",
- "enacted": null
+ "email": "demo@onlab.us"
}
},
{
@@ -845,8 +831,7 @@
"timezone": "America/New_York",
"is_admin": true,
"password": "!",
- "email": "jhh@cs.arizona.edu",
- "enacted": null
+ "email": "jhh@cs.arizona.edu"
}
},
{
diff --git a/planetstack/scripts/opencloud b/planetstack/scripts/opencloud
new file mode 100755
index 0000000..3005865
--- /dev/null
+++ b/planetstack/scripts/opencloud
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+if [ -z "$1" ]; then
+ echo usage: $0 "[initdb | resetdb ]"
+ exit
+fi
+
+cd /opt/planetstack
+
+function initdb {
+ #Figure out if the script is running on Fedora 16 or 17
+ if grep 16 /etc/fedora-release; then
+ sudo -u postgres initdb -D /var/lib/pgsql/data/
+ sudo -u postgres pg_ctl -D /var/lib/pgsql/data -l logfile start
+ else
+ #Try normal Fedora 17 commands
+ echo "Trying Fedora 17 commands" > /dev/stdout
+ /sbin/service postgresql initdb
+ /sbin/service postgresql start
+ /sbin/chkconfig postgresql on
+ fi
+}
+function createdb {
+ echo "Creating OpenCloud database..."
+ sudo -u postgres createdb planetstack
+}
+function dropdb {
+ echo "Dropping OpenCloud database..."
+ sudo -u postgres dropdb planetstack
+}
+function syncdb {
+ echo "Syncing OpenCloud services..."
+ python /opt/planetstack/manage.py syncdb --noinput
+}
+function runserver {
+# python manage.py runserver 128.95.1.128:8000
+ echo "Starting OpenCloud Service on $HOSTNAME:8000"
+ python manage.py runserver $HOSTNAME:8000&
+}
+
+COMMAND=$1
+
+if [ "$COMMAND" = "initdb" ]; then
+ initdb
+ createdb
+ syncdb
+ runserver
+fi
+if [ "$COMMAND" = "resetdb" ]; then
+ dropdb
+ createdb
+ syncdb
+ runserver
+fi
+if [ "$COMMAND" = "syncdb" ]; then
+ syncdb
+ runserver
+fi
+if [ "$COMMAND" = "runserver" ]; then
+ runserver
+fi
+