aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotgne22020-11-22 18:32:04 -0700
committernotgne22020-11-22 18:32:04 -0700
commitcb50d98884f786a3e2aa40befa6ebf1ef2be90da (patch)
tree35a68003919592e4fb00519123b7e0aae3f75bbb
parent08c6bd8b73489d50a99129a22f559e6197892c23 (diff)
Use `/tmp` as temp directory, not `/tmp/deploy-rs` (resolves #8 by deprecation)
-rw-r--r--README.md4
-rw-r--r--src/activate.rs2
-rw-r--r--src/utils/deploy.rs8
3 files changed, 7 insertions, 7 deletions
diff --git a/README.md b/README.md
index 7fc9484..bffa3de 100644
--- a/README.md
+++ b/README.md
@@ -163,8 +163,8 @@ This is a set of options that can be put in any of the above definitions, with t
# This defaults to `true`
magicRollback = true;
- # The path which deploy-rs will use for temporary files, this is currently only used by `magicRollback` to create an inotify watcher in
- # If not specified, this will default to `/tmp/deploy-rs`
+ # The path which deploy-rs will use for temporary files, this is currently only used by `magicRollback` to create an inotify watcher in for confirmations
+ # If not specified, this will default to `/tmp`
# (if `magicRollback` is in use, this _must_ be writable by `user`)
tempPath = "/home/someuser/.deploy-rs";
}
diff --git a/src/activate.rs b/src/activate.rs
index f9c7e22..193f617 100644
--- a/src/activate.rs
+++ b/src/activate.rs
@@ -204,7 +204,7 @@ pub async fn activation_confirmation(
closure: String,
) -> Result<(), ActivationConfirmationError> {
let lock_hash = &closure["/nix/store/".len()..];
- let lock_path = format!("{}/activating-{}", temp_path, lock_hash);
+ let lock_path = format!("{}/deploy-rs-canary-{}", temp_path, lock_hash);
if let Some(parent) = Path::new(&lock_path).parent() {
fs::create_dir_all(parent)
diff --git a/src/utils/deploy.rs b/src/utils/deploy.rs
index f88a115..adcde64 100644
--- a/src/utils/deploy.rs
+++ b/src/utils/deploy.rs
@@ -44,7 +44,7 @@ fn test_activation_command_builder() {
let profile_path = "/blah/profiles/test";
let closure = "/blah/etc";
let auto_rollback = true;
- let temp_path = &"/tmp/deploy-rs".into();
+ let temp_path = &"/tmp".into();
let confirm_timeout = 30;
let magic_rollback = true;
@@ -59,7 +59,7 @@ fn test_activation_command_builder() {
confirm_timeout,
magic_rollback
),
- "sudo -u test /blah/bin/activate '/blah/profiles/test' '/blah/etc' --temp-path /tmp/deploy-rs --confirm-timeout 30 --magic-rollback --auto-rollback"
+ "sudo -u test /blah/bin/activate '/blah/profiles/test' '/blah/etc' --temp-path /tmp --confirm-timeout 30 --magic-rollback --auto-rollback"
.to_string(),
);
}
@@ -93,7 +93,7 @@ pub async fn deploy_profile(
let temp_path: Cow<str> = match &deploy_data.merged_settings.temp_path {
Some(x) => x.into(),
- None => "/tmp/deploy-rs".into(),
+ None => "/tmp".into(),
};
let confirm_timeout = deploy_data.merged_settings.confirm_timeout.unwrap_or(30);
@@ -153,7 +153,7 @@ pub async fn deploy_profile(
}
let lock_hash = &deploy_data.profile.profile_settings.path["/nix/store/".len()..];
- let lock_path = format!("{}/activating-{}", temp_path, lock_hash);
+ let lock_path = format!("{}/deploy-rs-canary-{}", temp_path, lock_hash);
let mut confirm_command = format!("rm {}", lock_path);
if let Some(sudo_cmd) = &deploy_defs.sudo {