Esempio n. 1
0
def get_service_info(service):
    service_configuration = read_service_configuration(service)
    description = service_configuration.get('description', NO_DESCRIPTION_MESSAGE)
    external_link = service_configuration.get('external_link', NO_EXTERNAL_LINK_MESSAGE)
    pipeline_url = get_pipeline_url(service)
    smartstack_endpoints = get_smartstack_endpoints(service)
    git_url = get_git_url(service)

    output = []
    output.append('Service Name: %s' % service)
    output.append('Description: %s' % description)
    output.append('External Link: %s' % PaastaColors.cyan(external_link))
    output.append('Monitored By: team %s' % get_team(service=service, overrides={}))
    output.append('Runbook: %s' % PaastaColors.cyan(get_runbook(service=service, overrides={})))
    output.append('Git Repo: %s' % git_url)
    output.append('Jenkins Pipeline: %s' % pipeline_url)
    output.append('Deployed to the following clusters:')
    output.extend(get_deployments_strings(service))
    if smartstack_endpoints:
        output.append('Smartstack endpoint(s):')
        for endpoint in smartstack_endpoints:
            output.append(' - %s' % endpoint)
    output.append('Dashboard(s):')
    output.extend(get_dashboard_urls(service))

    return '\n'.join(output)
Esempio n. 2
0
def get_service_info(service):
    service_configuration = read_service_configuration(service)
    description = service_configuration.get('description',
                                            NO_DESCRIPTION_MESSAGE)
    external_link = service_configuration.get('external_link',
                                              NO_EXTERNAL_LINK_MESSAGE)
    pipeline_url = get_pipeline_url(service)
    smartstack_endpoints = get_smartstack_endpoints(service)
    git_url = get_git_url(service)

    output = []
    output.append('Service Name: %s' % service)
    output.append('Description: %s' % description)
    output.append('External Link: %s' % PaastaColors.cyan(external_link))
    output.append('Monitored By: team %s' %
                  get_team(service=service, overrides={}))
    output.append(
        'Runbook: %s' %
        PaastaColors.cyan(get_runbook(service=service, overrides={})))
    output.append('Git Repo: %s' % git_url)
    output.append('Jenkins Pipeline: %s' % pipeline_url)
    output.append('Deployed to the following clusters:')
    output.extend(get_deployments_strings(service))
    if smartstack_endpoints:
        output.append('Smartstack endpoint(s):')
        for endpoint in smartstack_endpoints:
            output.append(' - %s' % endpoint)
    output.append('Dashboard(s):')
    output.extend(get_dashboard_urls(service))

    return '\n'.join(output)
Esempio n. 3
0
def report_status(service, deploy_pipeline, actual_deployments, cluster_filter, verbose=False):
    pipeline_url = get_pipeline_url(service)
    print "Pipeline: %s" % pipeline_url

    deployed_clusters = list_deployed_clusters(deploy_pipeline, actual_deployments)
    for cluster in deployed_clusters:
        if cluster_filter is None or cluster in cluster_filter:
            report_status_for_cluster(service, cluster, deploy_pipeline, actual_deployments, verbose)

    print report_bogus_filters(cluster_filter, deployed_clusters)
Esempio n. 4
0
def report_status(service, deploy_pipeline, actual_deployments, cluster_whitelist, instance_whitelist, verbose=False):
    pipeline_url = get_pipeline_url(service)
    print "Pipeline: %s" % pipeline_url

    deployed_clusters = list_deployed_clusters(deploy_pipeline, actual_deployments)
    for cluster in deployed_clusters:
        if not cluster_whitelist or cluster in cluster_whitelist:
            report_status_for_cluster(
                service=service,
                cluster=cluster,
                deploy_pipeline=deploy_pipeline,
                actual_deployments=actual_deployments,
                instance_whitelist=instance_whitelist,
                verbose=verbose,
            )

    print report_invalid_whitelist_values(cluster_whitelist, deployed_clusters, 'cluster')
Esempio n. 5
0
def report_status(service,
                  deploy_pipeline,
                  actual_deployments,
                  cluster_whitelist,
                  instance_whitelist,
                  verbose=False):
    pipeline_url = get_pipeline_url(service)
    print "Pipeline: %s" % pipeline_url

    deployed_clusters = list_deployed_clusters(deploy_pipeline,
                                               actual_deployments)
    for cluster in deployed_clusters:
        if not cluster_whitelist or cluster in cluster_whitelist:
            report_status_for_cluster(
                service=service,
                cluster=cluster,
                deploy_pipeline=deploy_pipeline,
                actual_deployments=actual_deployments,
                instance_whitelist=instance_whitelist,
                verbose=verbose,
            )

    print report_invalid_whitelist_values(cluster_whitelist, deployed_clusters,
                                          'cluster')