Skip to content

Commit

Permalink
removing db drop and create on every build
Browse files Browse the repository at this point in the history
  • Loading branch information
pungoyal committed Apr 2, 2010
1 parent cc7485c commit 558bb42
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions deploy/scripts/redeploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,28 @@ def issue_cmd(cmd, failure_msg='Failed'):
#os.chdir(DEPLOY_DIR)
#issue_cmd(['chmod', '+w', '/static/project-photos'])

print "Dumping existing db"
try:
child = pexpect.spawn ('dropdb -U %s %s' % (DB_USER, DB_NAME))
# child.logfile = sys.stdout
#child.expect_exact ('Password:')
#child.sendline (DB_PWD)
child.wait()
except:
print "Failed to drop db"
sys.exit(1)

print "Creating blank db"
try:
child = pexpect.spawn ('createdb -T template_postgis -O %(user)s -U %(user)s %(db)s' % \
{ 'user': DB_USER, 'db': DB_NAME} )
# child.logfile = sys.stdout
#child.expect_exact ('Password:')
#child.sendline (DB_PWD)
child.wait()
except:
print "Failed to create db"
sys.exit(1)
# print "Dumping existing db"
# try:
# child = pexpect.spawn ('dropdb -U %s %s' % (DB_USER, DB_NAME))
# # child.logfile = sys.stdout
# #child.expect_exact ('Password:')
# #child.sendline (DB_PWD)
# child.wait()
# except:
# print "Failed to drop db"
# sys.exit(1)
#
# print "Creating blank db"
# try:
# child = pexpect.spawn ('createdb -T template_postgis -O %(user)s -U %(user)s %(db)s' % \
# { 'user': DB_USER, 'db': DB_NAME} )
# # child.logfile = sys.stdout
# #child.expect_exact ('Password:')
# #child.sendline (DB_PWD)
# child.wait()
# except:
# print "Failed to create db"
# sys.exit(1)

print "Syncing db and loading initial data"
os.chdir(APP_DIR)
Expand Down

0 comments on commit 558bb42

Please sign in to comment.