mina-infinum 2.3.0 → 2.4.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: d0ba2dc913ff35e4416588b4f58baab6070960c1d33dc619acbda331ed46da48
4
- data.tar.gz: fc982c1d6374965b0c347fccd3f11983dcf8ccd5c94cdc48b65737fe57ce1437
3
+ metadata.gz: 7d08049d5114d7747bbad76c04cec40f51f95b55b1741b79fc57fc3fa96d7419
4
+ data.tar.gz: 25e29db32a826f58bb8fc530f8ae9fea7fbd159a0f8880dab2b02c9003365978
5
5
  SHA512:
6
- metadata.gz: 83dc2eba39533955f29e8cec5ba626626b0b52d6c3f7cc1f6df2e77891217d615f304f989f46a58ff55532cb68bd41b8ef89fca08f2148a96cd17d755079e19e
7
- data.tar.gz: a0d9cb6a87a5db0a41dbeb77fefcbbcf04d726807a986151e7eb931204fb4b55a4dc1d45a54e2a1ebd4154bbdb58c6e60b41945c72e332acc45d29c31e034b44
6
+ metadata.gz: f3b0043ceea5b17160fc4b164fad29948cb4e910d479b8e591935cf2be740545f92af8ebf1c4a94ed209fb7a92c4b830f8632b6f7bc0422397800f2cb839ec00
7
+ data.tar.gz: 488b575896cbb2d8be5efac54f71cb6bf5a639492b877bca0ca92d974f78e23d7d0001bdd9b4e838f19a06ec13ff495b1f24accd2e0e1369d22c08ba44722201
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v2.4.0](https://github.com/infinum/mina-infinum/tree/v-2.4.0) (2025-10-14)
4
+ [Full Changelog](https://github.com/infinum/mina-infinum/compare/v2.3.0...v2.4.0)
5
+
6
+ ### Enhancements
7
+
8
+ - Add `skip_profile` flag to call AWS CLI commands without a `--profile` flag [\#9](https://github.com/infinum/mina-infinum/pull/9)
9
+ - Add path param to params:pull task [\#10](https://github.com/infinum/mina-infinum/pull/10)
10
+
3
11
  ## [v2.3.0](https://github.com/infinum/mina-infinum/tree/v-2.3.0) (2025-10-02)
4
12
  [Full Changelog](https://github.com/infinum/mina-infinum/compare/v2.2.0...v2.3.0)
5
13
 
@@ -70,3 +70,7 @@ Starting session with SessionId: botocore-session-12345
70
70
  Port 9999 opened for sessionId botocore-session-12345.
71
71
  Waiting for connections...
72
72
  ```
73
+
74
+ ## Skip profile
75
+
76
+ To execute AWS CLI commands without the `--profile` flag, append `skip_profile=true` to your commands, e.g.: `bundle exec mina staging params:pull skip_profile=true`.
@@ -43,6 +43,8 @@ namespace :aws do
43
43
 
44
44
  namespace :profile do
45
45
  task :check do
46
+ next if fetch(:skip_profile)
47
+
46
48
  ensure!(:aws_profile)
47
49
 
48
50
  unless profile_exists?(fetch(:aws_profile))
@@ -92,5 +94,9 @@ def profile_exists?(profile)
92
94
  profiles.split("\n").include?(profile)
93
95
  end
94
96
 
97
+ def aws_cli_profile_flag
98
+ fetch(:aws_profile) && !fetch(:skip_profile) ? "--profile #{fetch(:aws_profile)}" : ''
99
+ end
100
+
95
101
  desc 'Alias for aws:login'
96
102
  task :login => 'aws:login'
@@ -15,7 +15,6 @@ namespace :db do
15
15
  ensure!(:aws_jump_server_id)
16
16
  ensure!(:db_host)
17
17
 
18
- profile = fetch(:aws_profile)
19
18
  jump_server_id = fetch(:aws_jump_server_id)
20
19
  host = fetch(:db_host)
21
20
  remote_port = fetch(:db_port, 5432)
@@ -26,7 +25,7 @@ namespace :db do
26
25
  --target #{jump_server_id}
27
26
  --document-name AWS-StartPortForwardingSessionToRemoteHost
28
27
  --parameters host="#{host}",portNumber="#{remote_port}",localPortNumber="#{local_port}"
29
- --profile #{profile}
28
+ #{aws_cli_profile_flag}
30
29
  #{'--debug' if debug?}
31
30
  CMD
32
31
  end
@@ -24,7 +24,7 @@ namespace :ecs do
24
24
  --task #{task_arn}
25
25
  --command \"#{command}\"
26
26
  --cluster #{fetch(:cluster)}
27
- --profile #{fetch(:aws_profile)}
27
+ #{aws_cli_profile_flag}
28
28
  --interactive
29
29
  #{'--debug' if debug?}
30
30
  CMD
@@ -48,7 +48,7 @@ def find_task_arn
48
48
  --output json
49
49
  --cluster #{fetch(:cluster)}
50
50
  --service #{fetch(:service)}
51
- --profile #{fetch(:aws_profile)}
51
+ #{aws_cli_profile_flag}
52
52
  #{'--debug' if debug?}
53
53
  CMD
54
54
 
@@ -39,7 +39,7 @@ task logs: ['aws:profile:check'] do
39
39
  raw_logs = run_cmd squish(<<~CMD)
40
40
  aws logs filter-log-events
41
41
  --log-group-name #{fetch(:log_group)}
42
- --profile #{fetch(:aws_profile)}
42
+ #{aws_cli_profile_flag}
43
43
  --start-time #{since_time.strftime('%s%L')}
44
44
  --end-time #{until_time.strftime('%s%L')}
45
45
  --output json
@@ -99,7 +99,7 @@ namespace :logs do
99
99
  puts "Tailing logs from #{fetch(:log_group)}"
100
100
  run_cmd squish(<<~CMD), exec: true
101
101
  aws logs tail #{fetch(:log_group)}
102
- --profile #{fetch(:aws_profile)}
102
+ #{aws_cli_profile_flag}
103
103
  --follow
104
104
  --format short
105
105
  #{"--since #{since_time}" if since_time}
@@ -15,13 +15,19 @@ namespace :params do
15
15
  end
16
16
 
17
17
  desc <<~TXT
18
- Save AWS Param Store params to .env file
18
+ Save AWS Param Store params to a file
19
+
20
+ Params are by default stored to .env file, you can override
21
+ the location with :path. For example:
22
+ $ mina params:pull path=.env.local
19
23
 
20
24
  See params:read documentation for details on how params
21
25
  are fetched.
22
26
  TXT
23
27
  task pull: ['aws:profile:check'] do
24
- env_file_path = File.join(Dir.pwd, '.env')
28
+ path = fetch(:path) || '.env'
29
+
30
+ env_file_path = File.join(Dir.pwd, path)
25
31
 
26
32
  File.write(env_file_path, get_params.map(&:as_env).join("\n"))
27
33
  end
@@ -55,7 +61,7 @@ def get_params_from_aws
55
61
  --path #{params_path}
56
62
  --with-decryption
57
63
  --recursive
58
- --profile #{fetch(:aws_profile)}
64
+ #{aws_cli_profile_flag}
59
65
  #{'--debug' if debug?}
60
66
  CMD
61
67
 
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Infinum
3
- VERSION = '2.3.0'.freeze
3
+ VERSION = '2.4.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-infinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic