### Added - add docker setup - refactor frontend configuration - with all the way through - with create pull request and release - with gitea - with prepend as well - add cliff - remove tokio - with doctor - with git client - with fixes - with conventional parse - with tags command - add semver - can get commit chain - with start of environment engine - with gitea client - fmt - add gitea client stub - add tests for git setup - split headings into local and global - rename to cuddle_please - add config parsing - with basic get dir - add mkdocs - add base ### Other - remove old changelog - *(deps)* update all dependencies (#2) - *(release)* 0.0.1 (#4) - release command - add cuddle.release to this repository - add granular docker setup - fix checks - chck refactor commands - move doctor command - fmt - rename release command - move gitea command into its own file - move config list - move gitea out of the way - move config building out of main execution loop - move commands and misc out of main binary package - fmt - check hide commands - move cuddle-please to cuddle-please release - remove no-vcs option (moved to a later stage if github is someday adopted - fix clippy warnings - clippy fix - fix - cleanup Reviewed-on: https://git.front.kjuulh.io/kjuulh/cuddle-please/pulls/6 Co-authored-by: kjuulh <contact@kjuulh.io> Co-committed-by: kjuulh <contact@kjuulh.io>
92 lines
2.3 KiB
Rust
92 lines
2.3 KiB
Rust
use std::path::PathBuf;
|
|
|
|
use clap::Args;
|
|
|
|
use crate::stage0_config::{
|
|
PleaseConfigBuilder, PleaseProjectConfigBuilder, PleaseSettingsConfigBuilder,
|
|
};
|
|
|
|
#[derive(Args, Debug, Clone)]
|
|
pub struct ConfigArgs {
|
|
/// Which repository to publish against. If not supplied remote url will be inferred from environment or fail if not present.
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_API_URL",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub api_url: Option<String>,
|
|
|
|
/// repo is the name of repository you want to release for
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_REPO",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub repo: Option<String>,
|
|
|
|
/// owner is the name of user from which the repository belongs <user>/<repo>
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_OWNER",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub owner: Option<String>,
|
|
|
|
/// which source directory to use, if not set `std::env::current_dir` is used instead.
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_SOURCE",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub source: Option<PathBuf>,
|
|
|
|
/// which branch is being run from
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_BRANCH",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub branch: Option<String>,
|
|
|
|
/// which git username to use for commits
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_GIT_USERNAME",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub git_username: Option<String>,
|
|
|
|
/// which git email to use for commits
|
|
#[arg(
|
|
env = "CUDDLE_PLEASE_GIT_EMAIL",
|
|
long,
|
|
global = true,
|
|
help_heading = "Config"
|
|
)]
|
|
pub git_email: Option<String>,
|
|
}
|
|
|
|
impl From<ConfigArgs> for PleaseConfigBuilder {
|
|
fn from(value: ConfigArgs) -> Self {
|
|
Self {
|
|
project: Some(PleaseProjectConfigBuilder {
|
|
owner: value.owner,
|
|
repository: value.repo,
|
|
source: value.source,
|
|
branch: value.branch,
|
|
}),
|
|
settings: Some(PleaseSettingsConfigBuilder {
|
|
api_url: value.api_url,
|
|
git_username: value.git_username,
|
|
git_email: value.git_email,
|
|
}),
|
|
}
|
|
}
|
|
}
|