Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layered config support #111

Merged
merged 7 commits into from
May 8, 2019
Merged

Layered config support #111

merged 7 commits into from
May 8, 2019

Conversation

epage
Copy link
Collaborator

@epage epage commented May 8, 2019

Includes loading a workspace-wide config. To make hooks still work, this also adds environment variables to access the workspace and crate paths.

Fixes #93

epage added 4 commits May 7, 2019 21:25
Now we'll load from all config sources, merging the result.

Fixes crate-ci#93
Not supporting `workspace_root/Cargo.toml` since a comment states it is
deprecated.
OsStr::new("NEW_VERSION") => new_version_string.as_ref(),
OsStr::new("DRY_RUN") => OsStr::new(if dry_run { "true" } else { "false" }),
OsStr::new("WORKSPACE_ROOT") => ws_meta.workspace_root.as_os_str(),
OsStr::new("CRATE_ROOT") => manifest_path.parent().unwrap_or_else(|| Path::new(".")).as_os_str(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to add some tests to make sure this actually is useful for the various use cases.

I suspect it won't be and that we'll need to do replacements on the hook to allow it to be shared.

I decided against tracking the directory that defines the hook and setting the CWD to simplify the merging process.

src/main.rs Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
@sunng87 sunng87 merged commit a38063c into crate-ci:master May 8, 2019
@epage epage deleted the config branch May 8, 2019 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for cascading configurations
2 participants