Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
fix(source): Subdirectories on S3 are now properly handled
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Mar 16, 2018
1 parent 2bc89df commit 9373173
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions libraries/drivers_source_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def fetch(deploy_context)

def prepare_archive_directories
context.directory(archive_file_dir) do
mode '0700'
mode '0755'
end

context.directory(dummy_repository_dir) do
mode '0700'
mode '0755'
end
end

Expand All @@ -46,7 +46,7 @@ def fetch_archive_from_s3 # rubocop:disable Metrics/MethodLength
base_url = @base_url
output = out

context.s3_file File.join(archive_file_dir, s3_key) do
context.s3_file File.join(archive_file_dir, File.basename(s3_key)) do
bucket s3_bucket
remote_path s3_key
aws_access_key_id output[:user]
Expand All @@ -62,11 +62,11 @@ def fetch_archive_from_s3 # rubocop:disable Metrics/MethodLength
def prepare_dummy_git_repository
chef_archive_file_dir = archive_file_dir
chef_dummy_repository_dir = dummy_repository_dir
s3_key = @s3_key
file_name = File.basename(@s3_key)

context.ruby_block 'extract' do
block do
OpsworksRuby::Archive.new(File.join(chef_archive_file_dir, s3_key)).uncompress(chef_dummy_repository_dir)
OpsworksRuby::Archive.new(File.join(chef_archive_file_dir, file_name)).uncompress(chef_dummy_repository_dir)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"password": "xhFwHAMEr51z1+eKylU0zLZEzxwgleiaMcFikGW7",
"ssh_key_comment": "Don't get cocky, this is are dummy AWS credentials only for this purpose",
"type": "s3",
"url": "https://s3.eu-west-2.amazonaws.com/opsworks-ruby-dummy-app/s3_thin_nginx_padrino_delayed_job.tar.gz",
"url": "https://s3.eu-west-2.amazonaws.com/opsworks-ruby-dummy-app/test/s3_thin_nginx_padrino_delayed_job.tar.gz",
"user": "AKIAJLVMILCB53T2UMQA"
},
"attributes": {
Expand Down

0 comments on commit 9373173

Please sign in to comment.