def preflight_check():
    logging.debug("pre-flight-check")
    if not check_database_environment():
        raise Exception("Missing environment variables")

    mx_version_str = runtime.get_version(BUILD_DIR)
    logging.info("Preflight check on version %s", mx_version_str)
    mx_version = MXVersion(str(mx_version_str))
    if not runtime.check_deprecation(mx_version):
        raise Exception("Version {} is deprecated.".format(mx_version_str))
Exemple #2
0
def preflight_check(runtime_version):
    if not check_database_environment():
        raise ValueError("Missing environment variables")

    stack = os.getenv("CF_STACK")
    logging.info(
        "Preflight check on Mendix runtime version [%s] and stack [%s]...",
        runtime_version,
        stack,
    )

    if not stack in SUPPORTED_STACKS:
        raise NotImplementedError("Stack [{}] is not supported".format(stack))
    if not runtime.check_deprecation(runtime_version):
        raise NotImplementedError(
            "Mendix runtime version [{}] is not supported".format(
                runtime_version))
    logging.info("Preflight check completed")