diff --git a/lib/egads/command/extract.rb b/lib/egads/command/extract.rb index dec7acd..dcff309 100644 --- a/lib/egads/command/extract.rb +++ b/lib/egads/command/extract.rb @@ -3,6 +3,7 @@ class Extract < Group include Thor::Actions desc "[remote, plumbing] Downloads tarball for SHA from S3 and extracts it to the filesystem" + class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory' class_option :force, type: :boolean, aliases: '-f', default: false, banner: "Overwrite existing files" argument :sha, type: :string, required: true, desc: 'git SHA to download and extract' @@ -89,7 +90,8 @@ def do_extract(path) # Directory created upon successful extraction def release_dir - RemoteConfig.release_dir(sha) + suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : '' + RemoteConfig.release_dir(sha) + suffix end # Directory where in-progress extraction occurs diff --git a/lib/egads/command/release.rb b/lib/egads/command/release.rb index 03e7919..f38eab8 100644 --- a/lib/egads/command/release.rb +++ b/lib/egads/command/release.rb @@ -3,6 +3,7 @@ class Release < Group include Thor::Actions desc "[remote] Symlinks SHA to current and restarts services. If needed, stages SHA" + class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory' class_option :force, type: :boolean, default: false, banner: "Overwrite existing release" argument :sha, type: :string, required: true, desc: 'git SHA to stage' def setup_environment @@ -44,8 +45,10 @@ def trim end protected + def dir - RemoteConfig.release_dir(sha) + suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : '' + RemoteConfig.release_dir(sha) + suffix end def release_to diff --git a/lib/egads/command/stage.rb b/lib/egads/command/stage.rb index d791b5b..20a4fdb 100644 --- a/lib/egads/command/stage.rb +++ b/lib/egads/command/stage.rb @@ -2,8 +2,8 @@ module Egads class Stage < Group include Thor::Actions - desc "[remote] Readies SHA for release. If needed, generates URL for SHA and extracts" + class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory' class_option :force, type: :boolean, default: false, banner: "Overwrite existing files" argument :sha, type: :string, required: true, desc: 'git SHA to stage' @@ -57,8 +57,10 @@ def mark_as_staged end protected + def dir - RemoteConfig.release_dir(sha) + suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : '' + RemoteConfig.release_dir(sha) + suffix end def stage_flag_path diff --git a/lib/egads/version.rb b/lib/egads/version.rb index af2e40f..9fcbc6b 100644 --- a/lib/egads/version.rb +++ b/lib/egads/version.rb @@ -1,3 +1,3 @@ module Egads - VERSION = '5.1.2' + VERSION = '5.2.0' end