Add environments for running
authorFrank Duncan <frank@kank.net>
Mon, 27 Dec 2021 18:40:20 +0000 (12:40 -0600)
committerFrank Duncan <frank@kank.net>
Mon, 27 Dec 2021 18:40:20 +0000 (12:40 -0600)
src/main/aws/aws.lisp
src/main/base.lisp
src/main/cli.lisp
src/main/package.lisp

index c1499855b434b2a0ed6c30aeffd2f34fcdea22d8..c7fb21dae85fde7d9df6b19fa58c8539619b5464 100644 (file)
         "-i"
         *aws-keyfile*
         (describe-property "PublicIpAddress")
         "-i"
         *aws-keyfile*
         (describe-property "PublicIpAddress")
-        (format nil "cd ~A ; ~A run" *remote-work-dir* *remote-candle-location*))
+        (format nil "cd ~A ; ~A run --env aws" *remote-work-dir* *remote-candle-location*))
        :output out-str
        :error out-str
        :wait t)))))
        :output out-str
        :error out-str
        :wait t)))))
index f5995a4aedc5711435f82b17ce36582826934f16..793841a00bd19ebc2e654bb3b3f5400e04967252 100644 (file)
@@ -16,6 +16,22 @@ DESCRIPTION:
   The main directory for all candle work to be done in.  When the server is running
   in local mode, this is also the place that builds are built in")
 
   The main directory for all candle work to be done in.  When the server is running
   in local mode, this is also the place that builds are built in")
 
+(defvar *environment* :local
+ "*ENVIRONMENT*
+
+VALUE TYPE:
+
+  A keyword
+
+INITIAL VALUE:
+
+  :LOCAL
+
+DESCRIPTION:
+
+  The environment that candle is currently running.  Useful to do switching in tests
+  or in the .candle file to do extra boot up processing.")
+
 (define-condition candle-error (error)
  ((reason :initarg :reason :reader candle-error-reason))
  (:documentation
 (define-condition candle-error (error)
  ((reason :initarg :reason :reader candle-error-reason))
  (:documentation
index 75ecd40b3af6b6c15eb5fe7527e1abd7d80b36f4..697fb42a5e333e9b04e7fe7dff09ecfdede4b60f 100644 (file)
  (let
   ((options
     '((:name :help :short "h" :long "help" :description "Print this usage.")
  (let
   ((options
     '((:name :help :short "h" :long "help" :description "Print this usage.")
-      (:name :task :long "task" :variable-name "TASK" :takes-argument t :description "Run TASK"))))
+      (:name :task :long "task" :variable-name "TASK" :takes-argument t :description "Run TASK")
+      (:name :env :long "env" :variable-name "ENV" :takes-argument t
+       :description "Runs candle with *candle-environment* set to ENV as a keyword."))))
   (standard-cli "candle run" options args :default nil
   (standard-cli "candle run" options args :default nil
+   (when (opera:option-present :env parsed-options)
+    (setf candle:*environment* (intern (string-upcase (opera:option-argument :env parsed-options)) :keyword)))
    (cond
     ((opera:option-present :task parsed-options)
      (let
    (cond
     ((opera:option-present :task parsed-options)
      (let
index fe0bc7084b7070fb02129d38cd0bfe5de6681966..90819d0592a1b51c051583209ef78315410b75f1 100644 (file)
@@ -3,7 +3,7 @@
   #:server #:add-project #:delete-project #:refresh-project #:list-projects
   #:project-branch-information #:run #:list-tasks #:*candle-dir* #:*job-system* #:*candle-dir* #:failures
   #:project-job-information #:get-job-log #:retry-job #:job-project #:project-dir #:process-job-in-system
   #:server #:add-project #:delete-project #:refresh-project #:list-projects
   #:project-branch-information #:run #:list-tasks #:*candle-dir* #:*job-system* #:*candle-dir* #:failures
   #:project-job-information #:get-job-log #:retry-job #:job-project #:project-dir #:process-job-in-system
-  #:shutdown-system
+  #:shutdown-system #:*environment*
 
   #:candle-error #:candle-error-reason)
  (:documentation "Main candle package.
 
   #:candle-error #:candle-error-reason)
  (:documentation "Main candle package.