appydave-tools 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f804cce4dd83a357489fe3163e014593fc173888c8c5acb2f64c766b01030203
|
|
4
|
+
data.tar.gz: d1b0edb7dc10a3968fb803eb1a7584459d9d51dc64754e1b8cc7f1901a1c6793
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd87280b7574f1a40690e48c5480c70db7f9aa8349b11d08b2e3977f46694eb285749b1e91ace744592f7a9f984545101577f0f39a43b96bca75c08e6c967840
|
|
7
|
+
data.tar.gz: d33a2f223ebc839a4b9d4a08ce93678e22e3383133db01802018bda97a1e26299965bfb2a0a6e2e315f2accd83c10e953b61ad8ed5d2d1062f4dc288d2a9d5c0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# [0.23.0](https://github.com/appydave/appydave-tools/compare/v0.22.0...v0.23.0) (2025-11-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* use current user's AWS profile for S3 operations ([3029aff](https://github.com/appydave/appydave-tools/commit/3029aff202ac8ee4a79e335ea7f3cbc246c7dd54))
|
|
7
|
+
* use current user's AWS profile for S3 operations instead of brand-specific profiles ([8eea669](https://github.com/appydave/appydave-tools/commit/8eea669b43f6017470edfcac4632c8cc4cca408d))
|
|
8
|
+
|
|
9
|
+
# [0.22.0](https://github.com/appydave/appydave-tools/compare/v0.21.2...v0.22.0) (2025-11-19)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* fix remaining rubocop string literal issue ([a28b9be](https://github.com/appydave/appydave-tools/commit/a28b9bedc31777bf382ebdc54b0abd4e27b7609a))
|
|
15
|
+
* fix rubocop issues in S3 scanner implementation ([20e9d48](https://github.com/appydave/appydave-tools/commit/20e9d481843aa4ab622a3ce6e56ff1183e3bad27))
|
|
16
|
+
* implement S3 scanning to query AWS for actual file data ([f452f95](https://github.com/appydave/appydave-tools/commit/f452f9587ed94f25f100ff36682f9b9c4312b975))
|
|
17
|
+
|
|
1
18
|
## [0.21.2](https://github.com/appydave/appydave-tools/compare/v0.21.1...v0.21.2) (2025-11-17)
|
|
2
19
|
|
|
3
20
|
|
|
@@ -50,9 +50,31 @@ module Appydave
|
|
|
50
50
|
Appydave::Tools::Configuration::Config.brands.get_brand(brand)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
# Determine which AWS profile to use based on current user
|
|
54
|
+
# Priority: current user's default_aws_profile > brand's aws.profile
|
|
55
|
+
def determine_aws_profile(brand_info)
|
|
56
|
+
# Get current user from settings (if available)
|
|
57
|
+
begin
|
|
58
|
+
current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
|
|
59
|
+
|
|
60
|
+
if current_user_key
|
|
61
|
+
# Look up current user's default AWS profile
|
|
62
|
+
users = Appydave::Tools::Configuration::Config.brands.data['users']
|
|
63
|
+
user_info = users[current_user_key]
|
|
64
|
+
|
|
65
|
+
return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
|
|
66
|
+
end
|
|
67
|
+
rescue Appydave::Tools::Error
|
|
68
|
+
# Config not available (e.g., in test environment) - fall through to brand profile
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Fallback to brand's AWS profile
|
|
72
|
+
brand_info.aws.profile
|
|
73
|
+
end
|
|
74
|
+
|
|
53
75
|
def create_s3_client(brand_info)
|
|
54
|
-
profile_name = brand_info
|
|
55
|
-
raise "AWS profile not configured for brand '#{brand}'" if profile_name.nil? || profile_name.empty?
|
|
76
|
+
profile_name = determine_aws_profile(brand_info)
|
|
77
|
+
raise "AWS profile not configured for current user or brand '#{brand}'" if profile_name.nil? || profile_name.empty?
|
|
56
78
|
|
|
57
79
|
credentials = Aws::SharedCredentials.new(profile_name: profile_name)
|
|
58
80
|
|
|
@@ -136,6 +158,12 @@ module Appydave
|
|
|
136
158
|
project_dir = File.join(brand_path, project_id)
|
|
137
159
|
staging_dir = File.join(project_dir, 's3-staging')
|
|
138
160
|
|
|
161
|
+
# Ensure project directory exists before download
|
|
162
|
+
unless Dir.exist?(project_dir)
|
|
163
|
+
puts "📁 Creating project directory: #{project_id}"
|
|
164
|
+
FileUtils.mkdir_p(project_dir) unless dry_run
|
|
165
|
+
end
|
|
166
|
+
|
|
139
167
|
s3_files = list_s3_files
|
|
140
168
|
|
|
141
169
|
if s3_files.empty?
|
|
@@ -84,9 +84,31 @@ module Appydave
|
|
|
84
84
|
Appydave::Tools::Configuration::Config.brands.get_brand(brand)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
+
# Determine which AWS profile to use based on current user
|
|
88
|
+
# Priority: current user's default_aws_profile > brand's aws.profile
|
|
89
|
+
def determine_aws_profile(brand_info)
|
|
90
|
+
# Get current user from settings (if available)
|
|
91
|
+
begin
|
|
92
|
+
current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
|
|
93
|
+
|
|
94
|
+
if current_user_key
|
|
95
|
+
# Look up current user's default AWS profile
|
|
96
|
+
users = Appydave::Tools::Configuration::Config.brands.data['users']
|
|
97
|
+
user_info = users[current_user_key]
|
|
98
|
+
|
|
99
|
+
return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
|
|
100
|
+
end
|
|
101
|
+
rescue Appydave::Tools::Error
|
|
102
|
+
# Config not available (e.g., in test environment) - fall through to brand profile
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Fallback to brand's AWS profile
|
|
106
|
+
brand_info.aws.profile
|
|
107
|
+
end
|
|
108
|
+
|
|
87
109
|
def create_s3_client(brand_info)
|
|
88
|
-
profile_name = brand_info
|
|
89
|
-
raise "AWS profile not configured for brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
|
|
110
|
+
profile_name = determine_aws_profile(brand_info)
|
|
111
|
+
raise "AWS profile not configured for current user or brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
|
|
90
112
|
|
|
91
113
|
credentials = Aws::SharedCredentials.new(profile_name: profile_name)
|
|
92
114
|
|
data/package.json
CHANGED