Exemple #1
0
def deploy_war(headless="0"):
    """Deploy locally built war-file to tomcat and restart"""
    #with _managed_tomcat_restart(5, headless):
    if exists(env.deploydir+"ROOT"):
        stop_tomcat()
        sudo("rm -rf %s " % (env.deploydir+"ROOT"))
        put(env.localwar, env.deploydir + "ROOT.war")
        start_tomcat()
        return
    put(env.localwar, env.deploydir + "ROOT.war")
    run("touch "+env.deploydir + "ROOT.war")
Exemple #2
0
def clean():
    stop_tomcat()
    sudo("rm -rf %(deploydir)s/ROOT" % env)
    sudo("rm -rf %(deploydir)s/ROOT.war" % env)
    start_tomcat()
    try:
        sudo("mysqladmin -u root --force drop lagrummet")  # needs priviliges to be pre-configured
    except:
        e = sys.exc_info()[0]
        print "Ignored! Failed to drop database because %s" % e
    try:
        with lcd(env.projectroot):
            put("manage/sysconf/%(target)s/mysql/drop_user.sql" % env, "/tmp")
            sudo("mysql -u root < /tmp/drop_user.sql")
    except:
        e = sys.exc_info()[0]
        print "Ignored! Failed to drop user because %s" % e