Skip to content

Commit

Permalink
update stage, release, extract
Browse files Browse the repository at this point in the history
  • Loading branch information
katjacresanti committed Sep 5, 2024
1 parent 6938126 commit cef6f03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
8 changes: 3 additions & 5 deletions lib/egads/command/extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Extract < Group

desc "[remote, plumbing] Downloads tarball for SHA from S3 and extracts it to the filesystem"
class_option :force, type: :boolean, aliases: '-f', default: false, banner: "Overwrite existing files"
class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory'
argument :sha, type: :string, required: true, desc: 'git SHA to download and extract'

attr_accessor :seed_sha, :seed_path
Expand Down Expand Up @@ -89,11 +90,8 @@ def do_extract(path)

# Directory created upon successful extraction
def release_dir
base_dir = RemoteConfig.release_dir(sha)
if options[:deployment_id]
return "#{base_dir}_TEST"
end
base_dir
suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : ''
dir(sha) + suffix
end

# Directory where in-progress extraction occurs
Expand Down
9 changes: 3 additions & 6 deletions lib/egads/command/release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Release < Group

desc '[remote] Symlinks SHA to current and restarts services. If needed, stages SHA'
class_option :force, type: :boolean, default: false, banner: 'Overwrite existing release'
class_option :deployment_id, type: :boolean, default: false, banner: 'Include deployment ID in release directory'
class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory'
argument :sha, type: :string, required: true, desc: 'git SHA to stage'

def setup_environment
Expand Down Expand Up @@ -56,11 +56,8 @@ def trim
protected

def dir
base_dir = RemoteConfig.release_dir(sha)
if options[:deployment_id]
return "#{base_dir}_TEST"
end
base_dir
suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : ''
RemoteConfig.release_dir(sha) + suffix
end

def release_to
Expand Down
9 changes: 3 additions & 6 deletions lib/egads/command/stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Stage < Group

desc '[remote] Readies SHA for release. If needed, generates URL for SHA and extracts'
class_option :force, type: :boolean, default: false, banner: 'Overwrite existing files'
class_option :deployment_id, type: :boolean, default: false, banner: 'Include deployment ID in release directory'
class_option :deployment_id, type: :string, default: nil, banner: 'Append suffix to release directory'
argument :sha, type: :string, required: true, desc: 'git SHA to stage'

def setup_environment
Expand Down Expand Up @@ -68,11 +68,8 @@ def mark_as_staged
protected

def dir
base_dir = RemoteConfig.release_dir(sha)
if options[:deployment_id]
return "#{base_dir}_TEST"
end
base_dir
suffix = options[:deployment_id] ? "_#{options[:deployment_id]}" : ''
RemoteConfig.release_dir(sha) + suffix
end

def stage_flag_path
Expand Down

0 comments on commit cef6f03

Please sign in to comment.