smdev 1.2.2 → 1.2.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smdev/ecs_exec.rb +4 -0
  3. data/lib/smdev.rb +45 -15
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3944688b5f28438bdb286304bbdc06115afbe3d7e1548aaa37e933fbaa0a2ddf
4
- data.tar.gz: a1be710fc98a0add8e63dcca21a3a5d59a429e5a50fea27e13365060cbb9ef2c
3
+ metadata.gz: 5e909132c39c708105b6e5bf18a547053454c0176d952b35ff733a272c57e5d0
4
+ data.tar.gz: 770284517bb5c2d91913fa45572faa7785730d4943abc7bc1d0ad479df5a4049
5
5
  SHA512:
6
- metadata.gz: d45c90193af9f78347a13f05d44cb86d91f1b50bbf06c81882680a5df24a31ff62753774f0d16107918120dda7929f2a40fd514bee3e0b9daa4bb10703439b1c
7
- data.tar.gz: f0cd7a754c05b6f96783e73e3addb3e43de06fa335abf36cf8cc9b7f98a695d7b6310ac8e72157713d8b89944eb60bb428ffa6e377c4d683eecf62f3f71dc6e1
6
+ metadata.gz: 102e1e2d2a2f807c97c16c0d67444ffd7576204b1c315a9c34811d02fe948387f4d869cf2a0b37abb53a2c015b6e531474fbd6ae16112dcdda5a2698b25fac87
7
+ data.tar.gz: 4f0af0c3eb067a8bf8fe0df0a28eafa4b3a3e1e71cd80b85091167040a809b3211d4d89c9c80c2e3cc1d484afcc24f7ca88c87512cb98cfb60cafb2c24640fe2
@@ -11,11 +11,15 @@ module Smdev
11
11
 
12
12
  task_arn = self.task_arn(cluster_name, service_name)
13
13
  command = options[:command]
14
+
15
+ # Container name defaults to the service name (for multi-container tasks)
16
+ container_name = options[:container] || service_name
14
17
 
15
18
  execute_command_cmd = %W[
16
19
  aws ecs execute-command
17
20
  --cluster #{cluster_name}
18
21
  --task #{task_arn}
22
+ --container #{container_name}
19
23
  --interactive
20
24
  --command \"#{command}\"
21
25
  ].join(' ')
data/lib/smdev.rb CHANGED
@@ -29,6 +29,8 @@ module Smdev
29
29
  execute_console(options)
30
30
  when 'ssh'
31
31
  execute_ssh(options)
32
+ when 'pr_critic'
33
+ handle_pr_critic(options)
32
34
  when 'update'
33
35
  handle_update_command(subcommand)
34
36
  when 'help'
@@ -71,27 +73,54 @@ module Smdev
71
73
  parser.on("--service SERVICE", "Specify ECS service for console/ssh commands") do |service|
72
74
  options[:service] = service
73
75
  end
76
+ parser.on("--container CONTAINER", "Specify container name for multi-container tasks (defaults to service name)") do |container|
77
+ options[:container] = container
78
+ end
74
79
  end.parse!
75
80
  options
76
81
  end
77
82
 
78
83
  def display_help
79
84
  puts "Usage: smdev COMMAND [options]"
80
- puts "\nCommands:"
81
- puts " local_app_setup - Set up local development environment"
82
- puts " system_install - Install system dependencies"
83
- puts " clone_repos - Clone repositories"
84
- puts " update_repos - Update repositories"
85
- puts " console - Open Rails console"
86
- puts " ssh - SSH into ECS container"
87
- puts " update cursor - Install or update cursor rules"
88
- puts " help - Show this help message"
89
- puts "\nOptions:"
90
- puts " -h, --help - Show this help message"
91
- puts " -s, --https - Use HTTPS instead of SSH for git operations"
92
- puts " -t, --team - Specify team name for repository operations"
93
- puts " --cluster - Specify ECS cluster for console/ssh commands"
94
- puts " --service - Specify ECS service for console/ssh commands"
85
+ puts ""
86
+ puts "DEVELOPMENT ENVIRONMENT COMMANDS:"
87
+ puts " local_app_setup - Set up local development environment (bundle install, copy .env, create/migrate DB)"
88
+ puts " system_install - Install system dependencies (Homebrew, PostgreSQL, AWS CLI, RBenv, Ruby, Rails)"
89
+ puts ""
90
+ puts "REPOSITORY MANAGEMENT COMMANDS:"
91
+ puts " clone_repos - Clone repositories from StrongMind organization"
92
+ puts " update_repos - Update existing local repositories (git pull)"
93
+ puts ""
94
+ puts "AWS/ECS COMMANDS:"
95
+ puts " console - Open Rails console in ECS container"
96
+ puts " ssh - SSH into ECS container"
97
+ puts ""
98
+ puts "DEVELOPMENT TOOLS:"
99
+ puts " pr_critic - Analyze pull requests and copy details to clipboard for review"
100
+ puts ""
101
+ puts "UPDATE COMMANDS:"
102
+ puts " update cursor - Install or update cursor rules"
103
+ puts ""
104
+ puts "HELP:"
105
+ puts " help - Show this help message"
106
+ puts ""
107
+ puts "OPTIONS:"
108
+ puts " -h, --help - Show this help message"
109
+ puts " -s, --https - Use HTTPS instead of SSH for git operations"
110
+ puts " -t, --team TEAM - Specify team name for repository operations"
111
+ puts " --cluster CLUSTER - Specify ECS cluster for console/ssh commands"
112
+ puts " --service SERVICE - Specify ECS service for console/ssh commands (default: prod-worker)"
113
+ puts " --container CONTAINER - Specify container name for multi-container tasks (defaults to service name)"
114
+ puts ""
115
+ puts "EXAMPLES:"
116
+ puts " smdev local_app_setup # Set up local development environment"
117
+ puts " smdev clone_repos --team \"Backend Team\" # Clone repos for specific team"
118
+ puts " smdev update_repos --https # Update repos using HTTPS"
119
+ puts " smdev console --cluster my-cluster # Open Rails console in specific cluster"
120
+ puts " smdev console --cluster central-stage --service central-stage-worker # Open Rails console in central stage worker"
121
+ puts " smdev ssh --service worker --cluster prod # SSH into worker service in prod cluster"
122
+ puts " smdev pr_critic # Analyze pull requests"
123
+ puts " smdev update cursor # Update cursor rules"
95
124
  end
96
125
 
97
126
  def handle_pr_critic(options)
@@ -107,6 +136,7 @@ module Smdev
107
136
  when "update_repos" then update_repos(options)
108
137
  when "console" then execute_console(options)
109
138
  when "ssh" then execute_ssh(options)
139
+ when "pr_critic" then handle_pr_critic(options)
110
140
  when "update" then handle_update(subcommand)
111
141
  else
112
142
  puts "Invalid command: #{command}. Use --help for a list of commands."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smdev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Neighbors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-08 00:00:00.000000000 Z
11
+ date: 2025-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize