diff --git a/Dockerfile b/Dockerfile --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ apt-get install -y \ cl-quicklisp \ default-libmysqlclient-dev \ - git + git \ + kubernetes-client RUN mkdir -p /srv/phabricator /opt/forgerie RUN useradd -md /srv/forgerie -s /bin/bash forgerie @@ -25,3 +26,12 @@ # install quicklisp and pulls core dependencies for it to run properly RUN sbcl --quit + +# # for debugging purposes +# USER root +# RUN mkdir -p /srv/phabricator +# RUN export DEBIAN_FRONTEND=noninteractive && \ +# apt-get install -y \ +# telnet iproute2 + +# USER forgerie diff --git a/bin/build-config-tmpl b/bin/build-config-tmpl --- a/bin/build-config-tmpl +++ b/bin/build-config-tmpl @@ -66,7 +66,7 @@ forgerie-gitlab:*default-project* forgerie-gitlab:*ssh-public-key* forgerie-gitlab:*default-group* - forgerie-gitlab:*rails-console-ssh-args* + forgerie-gitlab:*rails-command-args** forgerie-gitlab:*merge-request-suffix* forgerie-gitlab:*ticket-suffix* forgerie-gitlab:*limit-to-active-users*)))) diff --git a/config/config.lisp.tmpl b/config/config.lisp.tmpl --- a/config/config.lisp.tmpl +++ b/config/config.lisp.tmpl @@ -152,7 +152,7 @@ ; User ; Port 2222 ; IdentityFile ~/.ssh/your_identity_file -(setf forgerie-gitlab:*rails-console-ssh-args* nil) +(setf forgerie-gitlab:*rails-command-args** nil) ; A function that takes an argument of a forgerie-core:merge-request and ; returns a string that will be appended to the description of created merge requests. diff --git a/src/main/gitlab/base.lisp b/src/main/gitlab/base.lisp --- a/src/main/gitlab/base.lisp +++ b/src/main/gitlab/base.lisp @@ -31,15 +31,23 @@ ; to do with the project with the name provided. (defvar *single-project* nil) +; +(defvar *rails-command* "/usr/bin/ssh" + "The rails command to execute, by default this uses ssh. But one could use kubectl or +docker instead.") + ; The args (host and command are normal) for the ssh command to ; boot the rails console. Sometimes this is localhost. Keys ; have to be set up. -(defvar *rails-console-ssh-args* nil - "A tuple of the form '(HOST COMMAND) that informs the gitlab forgerie - how to run rails commands over ssh. It will always use SSH, even if - set up to run on localhost, so keys must be installed to ssh to localhost. +(defvar *rails-command-args** nil + "A tuple of the form '(HOST COMMAND) that informs the gitlab forgerie how to run rails + commands over ssh. It will always use SSH, even if set up to run on localhost, so keys + must be installed to ssh to localhost. A simple list '(COMMAND) when using bare kubectl + or docker. + + When using kube... - An example for a server using docker might be: + When using ssh, an example for a server using docker might be: '(\"ssh.gitlab.yourdomain.tld\" \"docker exec -i gitlab /opt/gitlab/bin/gitlab-rails c\") diff --git a/src/main/gitlab/package.lisp b/src/main/gitlab/package.lisp --- a/src/main/gitlab/package.lisp +++ b/src/main/gitlab/package.lisp @@ -1,5 +1,5 @@ (defpackage #:forgerie-gitlab (:use :cl) (:export #:*private-token* #:*server-address* #:*default-project* #:*ssh-public-key* - #:*default-group* #:*single-project* #:*rails-console-ssh-args* #:*merge-request-suffix* - #:*ticket-suffix* #:*limit-to-active-users*)) + #:*default-group* #:*single-project* #:*rails-command* #:*rails-command-args* + #:*merge-request-suffix* #:*ticket-suffix* #:*limit-to-active-users*)) diff --git a/src/main/gitlab/utils.lisp b/src/main/gitlab/utils.lisp --- a/src/main/gitlab/utils.lisp +++ b/src/main/gitlab/utils.lisp @@ -223,7 +223,7 @@ (when (not *rails-connection*) (setf *rails-connection* - (sb-ext:run-program "/usr/bin/ssh" *rails-console-ssh-args* + (sb-ext:run-program *rails-command* *rails-command-args** :input :stream :output :stream :wait nil))