Changeset View
Changeset View
Standalone View
Standalone View
src/main/gitlab/utils.lisp
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | |||||
(defvar *rails-connection* nil) | (defvar *rails-connection* nil) | ||||
; Each command needs to be a one liner standalone | ; Each command needs to be a one liner standalone | ||||
(defun rails-command (cmd) | (defun rails-command (cmd) | ||||
(when (not *rails-connection*) | (when (not *rails-connection*) | ||||
(setf | (setf | ||||
*rails-connection* | *rails-connection* | ||||
(sb-ext:run-program "/usr/bin/ssh" *rails-console-ssh-args* | (sb-ext:run-program *rails-command* *rails-command-args* | ||||
:input :stream | :input :stream | ||||
:output :stream | :output :stream | ||||
:wait nil)) | :wait nil)) | ||||
(format (sb-ext:process-input *rails-connection*) "0~%" cmd) | (format (sb-ext:process-input *rails-connection*) "0~%" cmd) | ||||
(force-output (sb-ext:process-input *rails-connection*)) | (force-output (sb-ext:process-input *rails-connection*)) | ||||
(loop for line = (read-line (sb-ext:process-output *rails-connection*)) | (loop for line = (read-line (sb-ext:process-output *rails-connection*)) | ||||
do (when forgerie-core:*debug* (format t "Booting: ~A~%" line)) | do (when forgerie-core:*debug* (format t "Booting: ~A~%" line)) | ||||
until (string= line "0"))) | until (string= line "0"))) | ||||
Show All 11 Lines |