Method: Deployed::RunController#execute

Defined in:
app/controllers/deployed/run_controller.rb

#executeObject

Endpoint to execute the kamal command



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/deployed/run_controller.rb', line 10

def execute
  raise(ConcurrentProcessRunning) if process_running?
  release_process if stored_pid
  File.write(current_log_file, '')

  # Fork a child process
  Deployed::CurrentExecution.child_pid = fork do
    exec("bundle exec rake deployed:execute_and_log['#{command}']")
  end

  lock_process
  render json: { message: 'OK' }
rescue ConcurrentProcessRunning
  render json: { message: 'EXISTING PROCESS' }
end