def main(args): branch = args.branch if not branch: branch = args.name if args.branches: branches = dict([b.split('=') for b in args.branches]) else: branches = {} harness = get_harness(args) site = harness.new_site(args.name) try: harness.reload_server() site.realize() site.checkout_sources(branch, branches) site.setup() site.init_data() site.startup() site.run_state = site.RUNNING site.save() except: site.run_state = site.STOPPED site.status = site.BUILD_FAILED site.save() harness.reload_server() raise finally: harness.reload_server()
def main(args): harness = get_harness(args) site = harness.sites.get(args.name) if not site: args.parser.error("No such site: %s" % args.name) site.status = site.APPROVED site.save() harness.reload_server()
def adduser(args): harness = get_harness(args) htpasswdfile = harness.config["htpasswd"] passwords = PasswordFile(htpasswdfile) username = raw_input("username: "******"password: "******"verify password: ") if password1 == password2: break passwords.set_password(username, password1) passwords.save()
def main(args): harness = get_harness(args) site = harness.sites.get(args.name) if not site: args.parser.error("No such site: %s" % args.name) try: site.shutdown() site.remove_data() site.delete() except: site.status = site.REMOVAL_FAILED site.save() raise finally: harness.reload_server()
def main(args): harness = get_harness(args) sites = harness.sites for site_name in sorted(sites.keys()): site = sites[site_name] if site.run_state != site.RUNNING: log.warn("Skipping %s (%s)", site_name, site.run_state) continue rebuild_required, merged = site.update_sources() if merged: log.info("%s merged. Removing...", site_name) args.name = site_name remove(args) continue if not rebuild_required: rebuild_required = site.rebuild_required() if rebuild_required: try: log.info("Rebuilding %s", site_name) site.run_state = site.UPDATING site.save() harness.reload_server() site.pause() site.refresh() site.refresh_data() site.resume() site.run_state = site.RUNNING site.status = site.OK # Undoes approval, since code has changed except: site.run_state = site.STOPPED site.status = site.UPDATE_FAILED raise finally: site.save() harness.reload_server() else: log.info("%s is up to date", site_name)