def control_latest_release():
    host = get_host()
    api_token = get_api_token()
    artifact_sha = get_artifact_sha()
    project_config_file = parse_cmd_line()

    with open(project_config_file) as json_data_file:
        project_data = load_project_configuration(json_data_file)
        url = ApiSchema.url_for_release(host, project_data, "latest")
        release = http_get_json(url, api_token)

        if release["target_artifact"] != artifact_sha:
            print(f"INCOMPLIANT: latest release {release['release_number']}")
            print(f"    released sha: {release['target_artifact']} ")
            print(f"    expected sha: {artifact_sha} ")
            sys.exit(1)
        else:
            print(f"COMPLIANT: latest release {release['release_number']}")
            print(f"    released sha: {release['target_artifact']} ")
            print(f"    expected sha: {artifact_sha} ")
#!/usr/bin/env python
import os

from cdb.cdb_utils import parse_cmd_line, env_is_compliant, load_user_data, build_evidence_dict, send_evidence


def put_evidence(project_file):
    print("Publish evidence to ComplianceDB")

    is_compliant = env_is_compliant()
    evidence_type = os.getenv('CDB_EVIDENCE_TYPE', "EVIDENCE_TYPE_UNDEFINED")
    description = os.getenv('CDB_DESCRIPTION', "UNDEFINED")
    build_url = os.getenv('CDB_CI_BUILD_URL', "URL_UNDEFINED")
    user_data = load_user_data()

    evidence = build_evidence_dict(is_compliant, evidence_type, description, build_url, user_data)
    send_evidence(project_file, evidence)


if __name__ == '__main__':
    project_file = parse_cmd_line()
    put_evidence(project_file)
def main():
    return exception_handling_main(lambda: put_artifact(parse_cmd_line()))
示例#4
0
from cdb.bitbucket import put_bitbucket_pull_request
from cdb.cdb_utils import parse_cmd_line

if __name__ == '__main__':
    project_config_file = parse_cmd_line()
    put_bitbucket_pull_request(project_config_file)
示例#5
0
def main():
    return exception_handling_main(lambda: put_pipeline(parse_cmd_line()))
示例#6
0
def main():
    """
    project.json
    """
    project_file = parse_cmd_line()
    put_pipeline(project_file)
示例#7
0
def main():
    project_file = parse_cmd_line()
    put_artifact_image(project_file)