kea-lifecycle 0.1.0

buildpack lifecycle
Documentation
pub mod args;
pub mod error;
// pub mod launch;
pub mod metadata;
pub mod verify;

use clap::Parser;

use crate::buildpack::APIs;

pub fn exec() -> error::Result<()> {
    let args = args::LauncherArgs::parse();

    let md = metadata::Metadata::from_layers_dir(&args.cnb.layers_dir)?;

    verify::verify_platform_api(
        args.cnb.platform_api,
        &APIs::PLATFORM,
        args.cnb.depreciation_mode,
    )?;
    verify::verify_buildpack_apis(&md, &APIs::BUILDPACK, args.cnb.depreciation_mode)?;

    if let Some(proc_type) = &args.cnb.process_type {
        log::warn!(
            "CNB_PROCESS_TYPE is not supported in Platform API {}.",
            args.cnb.platform_api
        );
        log::warn!(
            "Run with ENTRYPOINT '{}' to invoke the '{}' process type",
            proc_type,
            proc_type
        );
    }

    //let launcher = Launcher::from_executing_path(&md, &args.cnb)?;

    Ok(())
}