mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 08:41:42 +00:00
Merge branch 'issue-13619' into 'rails'
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix: deprecar Dir#chdir #13619 Closes #13619, #13715, #13716, and #13717 See merge request sutty/sutty!193
This commit is contained in:
commit
9bd591ec27
2 changed files with 18 additions and 14 deletions
|
@ -65,8 +65,7 @@ class Deploy < ApplicationRecord
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
time_start
|
time_start
|
||||||
Dir.chdir(site.path) do
|
Open3.popen2e(env, cmd, unsetenv_others: true, chdir: site.path) do |_, o, t|
|
||||||
Open3.popen2e(env, cmd, unsetenv_others: true) do |_, o, t|
|
|
||||||
# TODO: Enviar a un websocket para ver el proceso en vivo?
|
# TODO: Enviar a un websocket para ver el proceso en vivo?
|
||||||
Thread.new do
|
Thread.new do
|
||||||
o.each do |line|
|
o.each do |line|
|
||||||
|
@ -81,7 +80,6 @@ class Deploy < ApplicationRecord
|
||||||
|
|
||||||
r = t.value
|
r = t.value
|
||||||
end
|
end
|
||||||
end
|
|
||||||
time_stop
|
time_stop
|
||||||
|
|
||||||
build_stats.create action: readable_cmd(cmd),
|
build_stats.create action: readable_cmd(cmd),
|
||||||
|
|
|
@ -447,6 +447,10 @@ class Site < ApplicationRecord
|
||||||
find_by(name: "#{Site.domain}.")
|
find_by(name: "#{Site.domain}.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.one_at_a_time
|
||||||
|
@@one_at_a_time ||= Thread::Mutex.new
|
||||||
|
end
|
||||||
|
|
||||||
def reset
|
def reset
|
||||||
@read = false
|
@read = false
|
||||||
@layouts = nil
|
@layouts = nil
|
||||||
|
@ -553,8 +557,10 @@ class Site < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_in_path(&block)
|
def run_in_path(&block)
|
||||||
|
Site.one_at_a_time.synchronize do
|
||||||
Dir.chdir path, &block
|
Dir.chdir path, &block
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Instala las gemas cuando es necesario:
|
# Instala las gemas cuando es necesario:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue