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 +4 -4
- data/lib/tayo/commands/cf.rb +35 -0
- data/lib/tayo/commands/gh.rb +35 -0
- data/lib/tayo/commands/init.rb +33 -0
- data/lib/tayo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a521c446bb379872cbb6377859c06259df27c3756077986e49c8a782ded5c8d
|
4
|
+
data.tar.gz: c691860435a9f43468c79604c71b099b6b273635cb82d1a8b7c74a829f1acf6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fd3a2b85e0798f7c9c6584eb79eca7b397a961d1304d0bf6e6dc1580e93a2ecb934661863a27babdc9a72978e802072bef97eda36f96c98012560bcb17e9d1
|
7
|
+
data.tar.gz: 1c10ec62c63fc48c2645714713707d009123f5e0a9d7aca5610ec992902745d7b491d79cc367b281c186b41ab275a1c8e8d7c98b356fb3bef79993544fa3aaa1
|
data/lib/tayo/commands/cf.rb
CHANGED
@@ -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
|
data/lib/tayo/commands/gh.rb
CHANGED
@@ -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
|
data/lib/tayo/commands/init.rb
CHANGED
@@ -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