TODO NOW:
- Add support for mypristine workflow
-- Make a nicer backtrace if not in a Git working copy directory
- Wordpress needs to get rid of the siteurl hack, so that it actually
has a fully-qualified URL http://foo.scripts.mit.edu/blah. This will
also fix Wordpress's cron functionality. We should be careful not
import os
-from wizard import command, shell, util
+from wizard import command, deploy, shell, util
def main(argv, baton):
options, args = parse_args(argv, baton)
reason = args[0]
- # XXX: this should be abstracted away!
- if os.path.exists(".git/WIZARD_REPO"):
- util.chdir(shell.eval('git', 'config', 'remote.origin.url'))
# Directory information not transferred via command line, so this
# will not error due to the changed directory.
shell.drop_priviledges(".", options.log_file)
+ # XXX: this should be abstracted away!
+ if os.path.exists(".git/WIZARD_REPO"):
+ util.chdir(shell.eval('git', 'config', 'remote.origin.url'))
+ production = deploy.ProductionCopy(".")
+ production.verify()
open('.scripts/blacklisted', 'w').write(reason + "\n")
def parse_args(argv, baton):
dir = os.path.abspath(args[0]) if args else os.getcwd()
shell.drop_priviledges(dir, options.log_file)
deployment = deploy.ProductionCopy(dir)
+ deployment.verify()
+ deployment.verifyConfigured()
print deployment.dsn.database
def parse_args(argv, baton):
import os
+import os.path
from wizard import command
def main(argv, baton):
options, args = parse_args(argv, baton)
+ if not os.path.exists(",git"):
+ raise Exception("Not in root directory of Git working copy")
os.mkdir(".scripts")
open(".scripts/.htaccess", "w").write("Deny from all\n")
import urllib
import shutil
import os
+import os.path
from wizard import app, command, shell
return options, args
def check_directory(options):
+ if not os.path.exists(".git"):
+ raise Exception("Not in root directory of Git repository")
files = shell.eval("git", "ls-files", "-o")
if files:
raise Exception("Unversioned files exist, refusing to remove (override with --force)")
def main(argv, baton):
options, args = parse_args(argv, baton)
+ d = deploy.ProductionCopy(".")
+ d.verify()
backups = ".scripts/backups"
if not args:
if not os.path.exists(backups):
options = self.options
while True:
self.prod = deploy.ProductionCopy(".")
+ self.prod.verify()
self.repo = self.prod.application.repository(options.srv_path)
# XXX: put this in Application
self.version = shell.eval("git", "--git-dir="+self.repo, "describe", "--tags", "master")
self.preflightBlacklist()
- self.prod.verify()
self.prod.verifyTag(options.srv_path)
self.prod.verifyGit(options.srv_path)
self.prod.verifyConfigured()
elif not has_git and not has_scripts:
if os.path.isfile(".scripts-version"):
raise NotMigratedError(self.location)
+ else:
+ raise NotAutoinstallError(self.location)
def verifyTag(self, srv_path):
"""
but not a .git directory."""
class NotAutoinstallError(Error):
- """The directory was not an autoinstall, due to missing .scripts-version file."""
- #: Directory in question
+ """Application is not an autoinstall."""
+ #: Directory of the not autoinstall
dir = None
def __init__(self, dir):
self.dir = dir
def __str__(self):
return """
-ERROR: Could not find .scripts-version file. Are you sure
-this is an autoinstalled application?
-"""
+ERROR: The directory
+
+ %s
+
+does not appear to be an autoinstall. If you are in a
+subdirectory of an autoinstall, you need to use the root
+directory for the autoinstall.""" % self.dir
class NoTagError(Error):
"""Deployment has a tag that does not have an equivalent in upstream repository."""
on the application. You can specify this manually using
the WIZARD_WEB_HOST and WIZARD_WEB_PATH environment
variables."""
-