diff --git a/components/hab/src/cli/hab.rs b/components/hab/src/cli/hab.rs index 5a485f6ae5..fa775d8898 100644 --- a/components/hab/src/cli/hab.rs +++ b/components/hab/src/cli/hab.rs @@ -142,8 +142,6 @@ pub enum Hab { pub enum Bldr { #[structopt(no_version)] Channel(Channel), - #[structopt(no_version)] - Job(Job), } #[derive(ConfigOpt, StructOpt)] @@ -160,22 +158,6 @@ pub enum Channel { Promote(ChannelPromote), } -#[derive(ConfigOpt, StructOpt)] -#[structopt(no_version, aliases = &["j", "jo"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])] -/// Commands relating to Habitat Builder jobs -pub enum Job { - #[structopt(no_version, aliases = &["c", "ca", "can", "cance"])] - Cancel(JobCancel), - #[structopt(no_version, aliases = &["d", "de", "dem", "demo", "demot"])] - Demote(JobDemote), - #[structopt(no_version, aliases = &["p", "pr", "pro", "prom", "promo", "promot"])] - Promote(JobPromote), - #[structopt(no_version, aliases = &["s", "st", "sta", "star"])] - Start(JobStart), - #[structopt(no_version, aliases = &["stat", "statu"])] - Status(JobStatus), -} - #[derive(ConfigOpt, StructOpt)] #[structopt(no_version, aliases = &["cl"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])] /// Commands relating to Habitat runtime config diff --git a/components/hab/src/cli/hab/bldr.rs b/components/hab/src/cli/hab/bldr.rs index 6fa090df66..bd936ac198 100644 --- a/components/hab/src/cli/hab/bldr.rs +++ b/components/hab/src/cli/hab/bldr.rs @@ -1,16 +1,10 @@ use super::util::{AuthToken, BldrUrl, ConfigOptAuthToken, - ConfigOptBldrUrl, - ConfigOptPkgIdent, - PkgIdent}; + ConfigOptBldrUrl}; use crate::cli::valid_origin; use configopt::ConfigOpt; -use habitat_common::cli::PACKAGE_TARGET_ENVVAR; -use habitat_core::package::PackageTarget; -use serde::Serialize; -use structopt::{clap::ArgGroup, - StructOpt}; +use structopt::StructOpt; #[derive(ConfigOpt, StructOpt)] #[structopt(no_version)] @@ -18,8 +12,6 @@ use structopt::{clap::ArgGroup, pub enum Bldr { #[structopt(no_version)] Channel(Channel), - #[structopt(no_version)] - Job(Job), } #[derive(ConfigOpt, StructOpt)] @@ -33,133 +25,6 @@ pub enum Channel { Promote(ChannelPromote), } -#[derive(ConfigOpt, StructOpt, Debug)] -#[configopt(derive(Serialize))] -#[structopt(group = ArgGroup::with_name("status").required(true), no_version)] -pub struct BldrJobStatusSourceGroup { - /// The job group id that was returned from "hab bldr job start" (ex: 771100000000000000) - #[structopt(name = "GROUP_ID", group = "status")] - group_id: Option, - /// Show the status of recent job groups created in this origin (default: 10 most recent) - #[structopt(name = "ORIGIN", - short = "o", - long = "origin", - validator = valid_origin, - group = "status")] - origin: Option, -} - -#[derive(ConfigOpt, StructOpt)] -#[structopt(no_version)] -/// Commands relating to Habitat Builder jobs -pub enum Job { - Cancel(JobCancel), - Demote(JobDemote), - Promote(JobPromote), - Start(JobStart), - Status(JobStatus), -} - -/// Get the status of one or more job groups -#[derive(ConfigOpt, StructOpt)] -#[structopt(name = "status", no_version)] -pub struct JobStatus { - #[structopt(flatten)] - source: BldrJobStatusSourceGroup, - /// Limit how many job groups to retrieve, ordered by most recent (default: 10) - #[structopt(name = "LIMIT", short = "l", long = "limit")] - limit: Option, - /// Show the status of all build jobs for a retrieved job group - #[structopt(name = "SHOW_JOBS", short = "s", long = "showjobs")] - show_jobs: bool, - #[structopt(flatten)] - bldr_url: BldrUrl, -} - -/// Cancel a build job group and any in-progress builds -#[derive(ConfigOpt, StructOpt)] -#[structopt(name = "cancel", no_version)] -pub struct JobCancel { - /// The job group id that was returned from "hab bldr job start" (ex: 771100000000000000) - #[structopt(name = "GROUP_ID")] - group_id: String, - #[structopt(flatten)] - bldr_url: BldrUrl, - /// Don't prompt for confirmation - #[structopt(name = "FORCE", short = "f", long = "force")] - force: bool, - #[structopt(flatten)] - auth_token: AuthToken, -} - -/// Demote packages from a completed build job from a specified channel -#[derive(ConfigOpt, StructOpt)] -#[structopt(name = "demote", no_version)] -pub struct JobDemote { - /// The job group id that was returned from "hab bldr job start" (ex: 771100000000000000) - #[structopt(name = "GROUP_ID")] - group_id: String, - /// The name of the channel to demote from - #[structopt(name = "CHANNEL")] - channel: String, - /// Limit the demotable packages to the specified origin - #[structopt(name = "ORIGIN", - short = "o", - long = "origin", - validator = valid_origin)] - origin: Option, - /// Allow editing the list of demotable packages - #[structopt(name = "INTERACTIVE", short = "i", long = "interactive")] - interactive: bool, - #[structopt(flatten)] - bldr_url: BldrUrl, - #[structopt(flatten)] - auth_token: AuthToken, -} - -/// Promote packages from a completed build job to a specified channel -#[derive(ConfigOpt, StructOpt)] -#[structopt(name = "promote", no_version)] -pub struct JobPromote { - /// The job group id that was returned from "hab bldr job start" (ex: 771100000000000000) - #[structopt(name = "GROUP_ID")] - group_id: String, - /// The target channel name - #[structopt(name = "CHANNEL")] - channel: String, - /// Limit the promotable packages to the specified origin - #[structopt(name = "ORIGIN", - short = "o", - long = "origin", - validator = valid_origin)] - origin: Option, - /// Allow editing the list of promotable packages - #[structopt(name = "INTERACTIVE", short = "i", long = "interactive")] - interactive: bool, - #[structopt(flatten)] - bldr_url: BldrUrl, - #[structopt(flatten)] - auth_token: AuthToken, -} - -/// Schedule a build job or group of jobs -#[derive(ConfigOpt, StructOpt)] -#[structopt(name = "start", no_version)] -pub struct JobStart { - #[structopt(flatten)] - pkg_ident: PkgIdent, - /// A package target (ex: x86_64-windows) (default: system appropriate target) - #[structopt(name = "PKG_TARGET", env = PACKAGE_TARGET_ENVVAR)] - pkg_target: Option, - #[structopt(flatten)] - bldr_url: BldrUrl, - #[structopt(flatten)] - auth_token: AuthToken, - /// Schedule jobs for this package and all of its reverse dependencies - #[structopt(name = "GROUP", short = "g", long = "group")] - group: bool, -} - /// Creates a new channel #[derive(ConfigOpt, StructOpt)] #[structopt(name = "create", no_version)]