-
Notifications
You must be signed in to change notification settings - Fork 315
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
Re-organize Habitat filesystem paths, environment variables, Plan variables, and runtime templating data #374
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a1e64d2
[core] Fix unintended doc unit test which needed a text escape.
fnichol 31c3cbc
Reduce the number of `/opt/bldr` path occurences.
fnichol 1dd7758
Use `HAB_ROOT_PATH` for root of Habitat file system.
fnichol c35c753
Use `HAB_CACHE_SRC_PATH` for default src download, extract, & compile.
fnichol fe1688f
Use `HAB_CACHE_ARTIFACT_PATH` for download path of package artifacts.
fnichol f59622f
Use `HAB_PKG_PATH` for the root path containing all locally installed…
fnichol cae7ceb
Use `HAB_CACHE_KEY_PATH` for the default path where keys are stored.
fnichol f9f05ed
Use `HAB_CACHE_GPG_PATH` for the default path where gpg keys are stored.
fnichol d5abf73
Use `SVC_PATH`/`pkg_svc_path` for the root path with runtime data.
fnichol 10c80e2
SERVICE_PATH -> SVC_PATH
fnichol af49ff9
Use `pkg_svc_config_path` for the path to the service config.
fnichol 8b60806
Add `{{pkg.svc_config_path}}` to `ServiceConfig`.
fnichol c8921df
Use `pkg_svc_data_path` for the path to the service data.
fnichol abac38a
Use `pkg_svc_files_path` for the path to the gossiped config files.
fnichol e73b574
Use `pkg_svc_hooks_path` for the path to the service hooks.
fnichol 93eb72d
Use `pkg_svc_static_path` for the path to the service static content.
fnichol 168b134
Use `pkg_svc_var_path` for the path to the service variable state.
fnichol 052ec51
Remove public `hcore::fs::SVC_PATH` in favor of `*_path()` functions.
fnichol 307d049
Remove unneeded imports.
fnichol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,21 +5,21 @@ | |
// the Software until such time that the Software is made available under an | ||
// open source license such as the Apache 2.0 License. | ||
|
||
//! Installs a bldr package from a [depot](../depot). | ||
//! Installs a Habitat package from a [depot](../depot). | ||
//! | ||
//! # Examples | ||
//! | ||
//! ```bash | ||
//! $ bldr install chef/redis | ||
//! $ hab pkg install chef/redis | ||
//! ``` | ||
//! | ||
//! Will install `chef/redis` package from the package depot at `http://bldr.co:9633`. | ||
//! Will install `chef/redis` package from a custom depot: | ||
//! | ||
//! ```bash | ||
//! $ bldr install chef/redis/3.0.1 redis -u http://bldr.co:9633 | ||
//! $ hab pkg install chef/redis/3.0.1 redis -u http://depot.co:9633 | ||
//! ``` | ||
//! | ||
//! Will install the `3.0.1` version of redis. | ||
//! This would install the `3.0.1` version of redis. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
//! | ||
//! # Internals | ||
//! | ||
|
@@ -32,7 +32,7 @@ use std::fs; | |
use std::path::{Path, PathBuf}; | ||
use std::str::FromStr; | ||
|
||
use hcore::fs::PACKAGE_CACHE; | ||
use hcore::fs::CACHE_ARTIFACT_PATH; | ||
use hcore::package::{PackageArchive, PackageIdent, PackageInstall}; | ||
use depot_core::data_object; | ||
use depot_client; | ||
|
@@ -50,16 +50,16 @@ pub fn start(url: &str, ident_or_archive: &str) -> Result<()> { | |
} | ||
|
||
/// Given a package name and a base url, downloads the package | ||
/// to `/opt/bldr/cache/pkgs`. Returns the filename in the cache as a String | ||
/// to the `CACHE_ARTIFACT_PATH`. Returns the filename in the cache as a String | ||
/// | ||
/// # Failures | ||
/// | ||
/// * Fails if it cannot create `/opt/bldr/cache/pkgs` | ||
/// * Fails if it cannot create the `CACHE_ARTIFACT_PATH` | ||
/// * Fails if it cannot download the package from the upstream | ||
pub fn from_url<P: AsRef<PackageIdent>>(url: &str, ident: &P) -> Result<data_object::Package> { | ||
println!("Installing {}", ident.as_ref()); | ||
let pkg_data = try!(depot_client::show_package(url, ident.as_ref())); | ||
try!(fs::create_dir_all(PACKAGE_CACHE)); | ||
try!(fs::create_dir_all(CACHE_ARTIFACT_PATH)); | ||
for dep in &pkg_data.tdeps { | ||
try!(install_from_depot(url, &dep, dep.as_ref())); | ||
} | ||
|
@@ -71,7 +71,7 @@ pub fn from_archive<P: AsRef<Path>>(url: &str, path: &P) -> Result<()> { | |
println!("Installing from {}", path.as_ref().display()); | ||
let mut archive = PackageArchive::new(PathBuf::from(path.as_ref())); | ||
let ident = try!(archive.ident()); | ||
try!(fs::create_dir_all(PACKAGE_CACHE)); | ||
try!(fs::create_dir_all(CACHE_ARTIFACT_PATH)); | ||
for dep in try!(archive.tdeps()) { | ||
try!(install_from_depot(url, &dep, dep.as_ref())); | ||
} | ||
|
@@ -94,7 +94,9 @@ fn install_from_depot<P: AsRef<PackageIdent>>(url: &str, | |
} | ||
} | ||
Err(_) => { | ||
let mut archive = try!(depot_client::fetch_package(url, ident.as_ref(), PACKAGE_CACHE)); | ||
let mut archive = try!(depot_client::fetch_package(url, | ||
ident.as_ref(), | ||
CACHE_ARTIFACT_PATH)); | ||
let ident = try!(archive.ident()); | ||
try!(archive.unpack()); | ||
println!("Installed {}", ident); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of
BLDR_REPO
, perhaps we shoulds/BLDR_REPO/HAB_REPO/
while we're in here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll deal with this one in another PR. I wanted to make sure that "repo" is no longer the correct word.