Example #1
0
def undeploy_main(argv):
    '''
    Undeploy a webapp
    '''
    usage = 'usage: %prog undeploy [options] CONTEXT..'
    parser = create_option_parser(usage)
    (opts, args) = parser.parse_args(argv)
    d = ClusterDeployer(**extract_options(conn_options, opts))
    d.undeploy(args)
Example #2
0
def restart_main(argv):
    '''
    Restart Tomcat on specified hosts
    For a cluster, the restart is performed in a rolling fashion
    '''
    usage = 'usage: %prog restart [options] [HOST..]'
    parser = create_option_parser(usage)
    restart_options = add_restart_options(parser)
    (opts, args) = parser.parse_args(argv)
    d = ClusterDeployer(**extract_options(conn_options + restart_options, opts))
    d.restart(args)
Example #3
0
def rollback_main(argv):
    """
    Rollback web app to previously deployed build with checks to ensure each cluster member will have a build to run
      after the rollback. After the rollback is performed, there should be no users with active sessions on the build
      that was rolled back.
    """
    usage = 'usage: %prog rollback [options] CTX..'
    parser = create_option_parser(usage)
    (opts, args) = parser.parse_args(argv)
    d = ClusterDeployer(**extract_options(conn_options, opts))
    d.rollback(args)
Example #4
0
def rollback_main(argv):
    """
    Rollback web app to previously deployed build with checks to ensure each cluster member will have a build to run
      after the rollback. After the rollback is performed, there should be no users with active sessions on the build
      that was rolled back.
    """
    usage = 'usage: %prog rollback [options] CTX..'
    parser = create_option_parser(usage)
    (opts, args) = parser.parse_args(argv)
    d = ClusterDeployer(**extract_options(conn_options, opts))
    # TODO: Report results
    d.rollback(args)
Example #5
0
def deploy_main(argv):
    '''
    Deploy a webapp
    '''
    usage = 'usage: %prog deploy [options] WARFILE..'
    parser = create_option_parser(usage)
    parser.add_option("--kill-sessions", action="store_true", dest="kill_sessions",
                      help="Kill sessions before undeploying old versions")
    parser.add_option("--no-check-memory", action="store_false", dest="check_memory",
                      default=True, help="Do not check available memory on server(s)")
    parser.add_option("--required-memory", default=50, type="int", dest="required_memory",
                      help="Percentage of free memory required (e.g. 50)")
    parser.add_option("--no-auto-gc", action="store_false", dest="auto_gc", default=True,
                      help="Do not trigger GC on server(s) to reclaim memory")
    parser.add_option("--auto-restart", action="store_true", dest="auto_restart",
                      help="Automatically restart application server(s) on low memory")
    restart_options = add_restart_options(parser)
    deployer_options = restart_options + [
        'kill_sessions', 'check_memory', 'required_memory', 'auto_gc',
        'auto_restart' ]

    (opts, args) = parser.parse_args(argv)
    d = ClusterDeployer(**extract_options(conn_options + deployer_options, opts))
    d.deploy(parse_warfiles(args))