tayo 0.1.1 โ†’ 0.1.3

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: 53130b0f5947fd77184352fcdf0a77f95c63354b4b1156c9d52ae4e3f9487645
4
- data.tar.gz: b1361c9b598ccbd2909eb63149892e9d8c5f490365d6ef24ddcb0db93fe2c2cc
3
+ metadata.gz: 0a521c446bb379872cbb6377859c06259df27c3756077986e49c8a782ded5c8d
4
+ data.tar.gz: c691860435a9f43468c79604c71b099b6b273635cb82d1a8b7c74a829f1acf6c
5
5
  SHA512:
6
- metadata.gz: 07f29a987b027a5f3e2dcb799bc9d4b36a0810368d77e44be158f60604d5c6ef19981099696d6ce8c6b3d16a114c2fa0a679ec6c2d6ea753532a5b64803de07f
7
- data.tar.gz: eae92807061aaafcaae98c2c01b5fd0c3afd2813bcf9ff366c745f8483bdf2473ae707b4ee38f9148205df8e0ae21540a5b56e15631cd6745a52b2d8c125b63a
6
+ metadata.gz: 74fd3a2b85e0798f7c9c6584eb79eca7b397a961d1304d0bf6e6dc1580e93a2ecb934661863a27babdc9a72978e802072bef97eda36f96c98012560bcb17e9d1
7
+ data.tar.gz: 1c10ec62c63fc48c2645714713707d009123f5e0a9d7aca5610ec992902745d7b491d79cc367b281c186b41ab275a1c8e8d7c98b356fb3bef79993544fa3aaa1
@@ -39,6 +39,9 @@ module Tayo
39
39
  update_deploy_config(domain_info)
40
40
 
41
41
  puts "\n๐ŸŽ‰ Cloudflare DNS ์„ค์ •์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!".colorize(:green)
42
+
43
+ # ๋ณ€๊ฒฝ์‚ฌํ•ญ ์ปค๋ฐ‹
44
+ commit_cloudflare_changes(domain_info)
42
45
  end
43
46
 
44
47
  private
@@ -385,6 +388,38 @@ module Tayo
385
388
  puts " servers.web: #{@server_info}".colorize(:gray)
386
389
  puts " ssh.user: #{@ssh_user}".colorize(:gray) if @ssh_user && @ssh_user != "root"
387
390
  end
391
+
392
+ def commit_cloudflare_changes(domain_info)
393
+ puts "\n๐Ÿ“ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ Git์— ์ปค๋ฐ‹ํ•ฉ๋‹ˆ๋‹ค...".colorize(:yellow)
394
+
395
+ # ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ์ด ์žˆ๋Š”์ง€ ํ™•์ธ
396
+ status_output = `git status --porcelain`.strip
397
+
398
+ if status_output.empty?
399
+ puts "โ„น๏ธ ์ปค๋ฐ‹ํ•  ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์—†์Šต๋‹ˆ๋‹ค.".colorize(:yellow)
400
+ return
401
+ end
402
+
403
+ # Git add
404
+ system("git add -A")
405
+
406
+ # Commit ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ
407
+ commit_message = "Configure Cloudflare DNS settings\n\n- Setup DNS for domain: #{domain_info[:domain]}\n- Configure server IP: #{domain_info[:server_ip]}\n- Update deployment configuration\n- Add proxy host settings\n\n๐Ÿค– Generated with Tayo"
408
+
409
+ # Commit ์‹คํ–‰
410
+ if system("git commit -m \"#{commit_message}\"")
411
+ puts "โœ… ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ปค๋ฐ‹๋˜์—ˆ์Šต๋‹ˆ๋‹ค.".colorize(:green)
412
+
413
+ # GitHub์— ํ‘ธ์‹œ
414
+ if system("git push", out: File::NULL, err: File::NULL)
415
+ puts "โœ… ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด GitHub์— ํ‘ธ์‹œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.".colorize(:green)
416
+ else
417
+ puts "โš ๏ธ GitHub ํ‘ธ์‹œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™์œผ๋กœ 'git push'๋ฅผ ์‹คํ–‰ํ•ด์ฃผ์„ธ์š”.".colorize(:yellow)
418
+ end
419
+ else
420
+ puts "โŒ Git ์ปค๋ฐ‹์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.".colorize(:red)
421
+ end
422
+ end
388
423
  end
389
424
  end
390
425
  end
@@ -43,6 +43,9 @@ module Tayo
43
43
  puts "โ€ข GitHub ์ €์žฅ์†Œ: https://github.com/#{@username}/#{@repo_name}".colorize(:cyan)
44
44
  puts "โ€ข Container Registry: #{@registry_url}".colorize(:cyan)
45
45
  puts "โ€ข ๋ฐฐํฌ ์„ค์ •: config/deploy.yml".colorize(:cyan)
46
+
47
+ # ๋ณ€๊ฒฝ์‚ฌํ•ญ ์ปค๋ฐ‹
48
+ commit_github_changes
46
49
  end
47
50
 
48
51
  private
@@ -384,6 +387,38 @@ module Tayo
384
387
  File.write("config/deploy.yml", deploy_config.to_yaml)
385
388
  puts " โš ๏ธ ์„œ๋ฒ„ ์ •๋ณด์™€ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.".colorize(:yellow)
386
389
  end
390
+
391
+ def commit_github_changes
392
+ puts "\n๐Ÿ“ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ Git์— ์ปค๋ฐ‹ํ•ฉ๋‹ˆ๋‹ค...".colorize(:yellow)
393
+
394
+ # ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ์ด ์žˆ๋Š”์ง€ ํ™•์ธ
395
+ status_output = `git status --porcelain`.strip
396
+
397
+ if status_output.empty?
398
+ puts "โ„น๏ธ ์ปค๋ฐ‹ํ•  ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์—†์Šต๋‹ˆ๋‹ค.".colorize(:yellow)
399
+ return
400
+ end
401
+
402
+ # Git add
403
+ system("git add -A")
404
+
405
+ # Commit ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ
406
+ commit_message = "Add GitHub Container Registry configuration\n\n- Setup GitHub repository: #{@repo_name}\n- Configure container registry: #{@registry_url}\n- Add deployment configuration files\n- Setup environment variables\n\n๐Ÿค– Generated with Tayo"
407
+
408
+ # Commit ์‹คํ–‰
409
+ if system("git commit -m \"#{commit_message}\"")
410
+ puts "โœ… ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ปค๋ฐ‹๋˜์—ˆ์Šต๋‹ˆ๋‹ค.".colorize(:green)
411
+
412
+ # GitHub์— ํ‘ธ์‹œ
413
+ if system("git push", out: File::NULL, err: File::NULL)
414
+ puts "โœ… ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด GitHub์— ํ‘ธ์‹œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.".colorize(:green)
415
+ else
416
+ puts "โš ๏ธ GitHub ํ‘ธ์‹œ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™์œผ๋กœ 'git push'๋ฅผ ์‹คํ–‰ํ•ด์ฃผ์„ธ์š”.".colorize(:yellow)
417
+ end
418
+ else
419
+ puts "โŒ Git ์ปค๋ฐ‹์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.".colorize(:red)
420
+ end
421
+ end
387
422
  end
388
423
  end
389
424
  end
@@ -136,6 +136,8 @@ module Tayo
136
136
  end
137
137
 
138
138
  def ensure_dockerfile_exists
139
+ dockerfile_created = false
140
+
139
141
  unless File.exist?("Dockerfile")
140
142
  puts "๐Ÿณ Dockerfile์ด ์—†์Šต๋‹ˆ๋‹ค. ๊ธฐ๋ณธ Dockerfile์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค...".colorize(:yellow)
141
143
 
@@ -143,13 +145,44 @@ module Tayo
143
145
  if system("rails app:update:bin")
144
146
  system("./bin/rails generate dockerfile")
145
147
  puts "โœ… Dockerfile์ด ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.".colorize(:green)
148
+ dockerfile_created = true
146
149
  else
147
150
  puts "โš ๏ธ Dockerfile ์ƒ์„ฑ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๋™์œผ๋กœ ์ƒ์„ฑํ•ด์ฃผ์„ธ์š”.".colorize(:yellow)
148
151
  puts " ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์„ธ์š”: ./bin/rails generate dockerfile".colorize(:cyan)
152
+ return
149
153
  end
150
154
  else
151
155
  puts "โœ… Dockerfile์ด ์ด๋ฏธ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.".colorize(:green)
152
156
  end
157
+
158
+ # Dockerfile์—์„œ bootsnap precompile ๋ถ€๋ถ„ ์ œ๊ฑฐ (๋นŒ๋“œ ๋ฌธ์ œ ํ•ด๊ฒฐ)
159
+ fix_dockerfile_bootsnap_issue
160
+ end
161
+
162
+ def fix_dockerfile_bootsnap_issue
163
+ return unless File.exist?("Dockerfile")
164
+
165
+ dockerfile_content = File.read("Dockerfile")
166
+
167
+ # bootsnap precompile ๊ด€๋ จ ๋ผ์ธ๋“ค์„ ์ฐพ์•„์„œ ์ œ๊ฑฐ
168
+ bootsnap_lines = [
169
+ "# Precompile bootsnap code for faster boot times",
170
+ "RUN bundle exec bootsnap precompile app/ lib/"
171
+ ]
172
+
173
+ modified = false
174
+ bootsnap_lines.each do |line|
175
+ if dockerfile_content.include?(line)
176
+ dockerfile_content.gsub!(/^.*#{Regexp.escape(line)}.*\n/, "")
177
+ modified = true
178
+ end
179
+ end
180
+
181
+ if modified
182
+ File.write("Dockerfile", dockerfile_content)
183
+ puts "โœ… Dockerfile์—์„œ bootsnap precompile ๋ถ€๋ถ„์„ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค. (๋นŒ๋“œ ๋ฌธ์ œ ํ•ด๊ฒฐ)".colorize(:green)
184
+ puts " - ์ด๋Š” ์•Œ๋ ค์ง„ ๋นŒ๋“œ ๋ฌธ์ œ๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•จ์ž…๋‹ˆ๋‹ค.".colorize(:gray)
185
+ end
153
186
  end
154
187
 
155
188
  def create_welcome_page
data/lib/tayo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tayo
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tayo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ์ด์›์„ญwonsup Lee/Alfonso