Esempio n. 1
0
def plugins(format, count):
    """
    List all installed plugins from jenkins
    """
    if count:
        JxCore().list_all_plugins(format, count=True)
    else:
        JxCore().list_all_plugins(format)
Esempio n. 2
0
def node(node_name, make_offline, make_online, message, format):
    """
    Get node info and operation
    """
    if make_offline and not make_online:
        JxCore().node_action(node_name, "offline", message)
    elif not make_offline and make_online:
        JxCore().node_action(node_name, "online")
    else:
        JxCore().node_info(node_name, format)
Esempio n. 3
0
def jobs(ctx, count, all, option, format):
    """
    Get list of job from jenkins
    """
    job_options = [
        "pipeline", "multi-branch", "maven", "freestyle", "matrix", "org"
    ]
    if all:
        JxCore().list_all_jobs(format, count)
    elif option and __builtins__.all(item in job_options for item in option):
        JxCore().list_jobs(list(option), format, count)
    else:
        click.echo("Invalid Option....")
        click.echo(ctx.get_help())
Esempio n. 4
0
def job(job_name, build, params, abort, buildinfo, delete, format):
    """
    Job info and operation
    """
    if buildinfo:
        JxCore().build_info(job_name, buildinfo, format)
    elif build:
        JxCore().trigger_job(job_name, params)
    elif delete:
        if click.confirm("Are you sure want to delete '{0}'".format(
                "y" if delete else "N")):
            click.echo("Existing without deleting - {0}.".format(job_name))
            sys.exit(1)
        else:
            JxCore().delete_job(job_name)
    elif abort:
        JxCore()
    else:
        JxCore().job_info(job_name, format)
Esempio n. 5
0
def plugin(plugin_name):
    """
    Get plugin information
    """
    JxCore().get_plugin_info(plugin_name)
Esempio n. 6
0
def nodes(format):
    """
    Get list of nodes from jenkins
    """
    JxCore().list_nodes(format)
Esempio n. 7
0
def folders(format, count):
    """
    Get all folders from jenkins
    """
    JxCore().list_all_folders(format, count)
Esempio n. 8
0
def info():
    """
    Show the infomation about jenkins
    """
    click.echo(BANNER)
    JxCore().info()