Add Licensing and Contributing
[candle] / src / main / base.lisp
index f5995a4aedc5711435f82b17ce36582826934f16..09f90035c439d7e4182f6cae8dfb02a24789fbfd 100644 (file)
@@ -1,3 +1,4 @@
+; Copyright 2022 Frank Duncan (frank@consxy.com) under AGPL3.  See distributed LICENSE.txt.
 (in-package #:candle)
 
 (defvar *candle-dir* nil
 (in-package #:candle)
 
 (defvar *candle-dir* nil
@@ -16,6 +17,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
@@ -73,6 +90,18 @@ DESCRIPTION:
 ; this will get set to nil but we keep them around for historical reference
 (lame-db:defdbstruct branch name in-git (project :join project) (job :join job))
 
 ; this will get set to nil but we keep them around for historical reference
 (lame-db:defdbstruct branch name in-git (project :join project) (job :join job))
 
+(setf (documentation 'project-name 'function)
+ "PROJECT-NAME PROJECT => NAME
+
+ARGUMENTS AND VALUES:
+
+  PROJECT: the project
+  NAME: a string, the name of the job
+
+DESCRIPTION:
+
+  Returns the name of the project in question.")
+
 (defun project-dir (project)
  "PROJECT-DIR PROJECT => DIR
 
 (defun project-dir (project)
  "PROJECT-DIR PROJECT => DIR