Ejemplo n.º 1
0
    if '-rc' in version:
        CURRENT_IMAGE_VERSION = version
    else:
        CURRENT_IMAGE_VERSION = version + '-rc1'
    return CURRENT_IMAGE_VERSION


def get_next_rc_version(current_rc_version):
    '''
    After finding the current rc tag of the image, adds one to it
    e.g: 0.10.0-rc1 will returned as 0.10.0-rc2
    :param current_rc_version: takes the current rc version of the image as input
    :return: returns the next rc version of the image
    '''
    return (current_rc_version.split("rc")[0] + "rc" +
            str(int(current_rc_version.split("rc")[1]) + 1))


if __name__ == "__main__":
    if 'QUAY_TOKEN' not in os.environ:
        print("Env QUAY_TOKEN not found, aborting...")
        os._exit(1)
    version = get_next_rc_version(find_current_rc_version())
    common.update_image_version(version)
    common.update_image_stream(version)
    common.update_modules_version(version)
    common.update_kogito_version_env_in_modules(version)

    find_next_tag()
    tag_and_push_images()
Ejemplo n.º 2
0
            if args.examples_ref is not None:
                examples_ref = args.examples_ref
            if 'rc' in args.bump_to:
                examples_ref = 'master'
            
            artifacts_version = args.bump_to
            if args.artifacts_version:
                artifacts_version = args.artifacts_version

            print("Images version will be updated to {0}".format(args.bump_to))
            print("Artifacts version will be updated to {0}".format(artifacts_version))
            print("Examples ref will be updated to {}".format(examples_ref))

            if not args.confirm:
                input("Is the information correct? If so press any key to continue...")

            # modules
            common.update_image_version(args.bump_to)
            common.update_image_stream(args.bump_to)
            common.update_modules_version(args.bump_to)
            common.update_artifacts_version_env_in_image(artifacts_version)

            # tests default values
            common.update_examples_ref_in_behave_tests(examples_ref)
            common.update_examples_ref_in_clone_repo(examples_ref)
            common.update_artifacts_version_in_behave_tests(artifacts_version)
        else:
            print("Provided version {0} does not match the expected regex - {1}".format(args.bump_to, pattern))
    else:
        print(parser.print_usage())