Browse code
rename cloud-watcher -> daydreamer
Ed Langley authored on 01/11/2018 07:14:20
Showing 5 changed files
Showing 5 changed files
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-(defpackage :cloud-watcher.aws-result |
|
1 |
+(defpackage :daydreamer.aws-result |
|
2 | 2 |
(:use :cl :fw.lu :alexandria :st) |
3 | 3 |
(:export |
4 | 4 |
#:stack |
... | ... |
@@ -25,7 +25,7 @@ |
25 | 25 |
#:extract-stack |
26 | 26 |
#:timeline |
27 | 27 |
#:tagged-kv-formatter)) |
28 |
-(in-package :cloud-watcher.aws-result) |
|
28 |
+(in-package :daydreamer.aws-result) |
|
29 | 29 |
|
30 | 30 |
(defun find-all-indices (pred str &optional accum (start (or (car accum) 0))) |
31 | 31 |
(check-type pred function) |
32 | 32 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,33 @@ |
1 |
+(defpackage :fwoar.build |
|
2 |
+ (:use :cl) |
|
3 |
+ (:export make)) |
|
4 |
+(in-package :fwoar.build) |
|
5 |
+ |
|
6 |
+(defmacro eval-always (&body body) |
|
7 |
+ `(eval-when (:compile-toplevel :load-toplevel :execute) |
|
8 |
+ ,@body)) |
|
9 |
+ |
|
10 |
+(defmacro stepwise (&body body) |
|
11 |
+ `(progn |
|
12 |
+ ,@(mapcar (lambda (x) |
|
13 |
+ `(eval-always |
|
14 |
+ ,@x)) |
|
15 |
+ body))) |
|
16 |
+ |
|
17 |
+ |
|
18 |
+ |
|
19 |
+(define-symbol-macro *my-pathname* |
|
20 |
+ (or *compile-file-pathname* |
|
21 |
+ *load-pathname*)) |
|
22 |
+ |
|
23 |
+(stepwise |
|
24 |
+ ((defun load-compile (pn) |
|
25 |
+ (load (compile-file pn)))) |
|
26 |
+ |
|
27 |
+ ((princ |
|
28 |
+ (mapcar 'load-compile |
|
29 |
+ (directory (merge-pathnames "*.asd" |
|
30 |
+ *my-pathname*)))) |
|
31 |
+ (terpri)) |
|
32 |
+ |
|
33 |
+ ((ql:quickload :daydreamer))) |
... | ... |
@@ -1,16 +1,17 @@ |
1 |
-(defpackage :cloud-watcher.cli |
|
2 |
- (:import-from :cloud-watcher.main :stack-parameters :stack-outputs :stack-for-name :stack-info) |
|
3 |
- (:import-from :cloud-watcher.aws-result :start-date-time :end-date-time) |
|
1 |
+(defpackage :daydreamer.cli |
|
2 |
+ (:import-from :daydreamer.main :stack-parameters :stack-outputs :stack-for-name :stack-info) |
|
3 |
+ (:import-from :daydreamer.aws-result :start-date-time :end-date-time) |
|
4 | 4 |
(:import-from :serapeum :op) |
5 | 5 |
(:import-from :clon :defsynopsis :group :flag :stropt) |
6 | 6 |
(:use :cl :st) |
7 | 7 |
(:export options |
8 |
- #:*cloud-watcher-synopsis* |
|
8 |
+ #:*daydreamer-synopsis* |
|
9 | 9 |
#:dump)) |
10 | 10 |
|
11 |
-(in-package :cloud-watcher.cli) |
|
11 |
+(in-package :daydreamer.cli) |
|
12 | 12 |
|
13 |
-(defparameter *cloud-watcher-synopsis* |
|
13 |
+ |
|
14 |
+(defparameter *daydreamer-synopsis* |
|
14 | 15 |
(defsynopsis (:postfix "ARGS...") |
15 | 16 |
(group (:header "actions") |
16 | 17 |
(flag :short-name "s" :long-name "stacks" :description "show stack information") |
... | ... |
@@ -30,11 +31,11 @@ |
30 | 31 |
(defun stacks-main () |
31 | 32 |
(mapcar (lambda (s) |
32 | 33 |
(format t "~3&STACK ~a ~a~2%" |
33 |
- (cloud-watcher.aws-result:stack-name s) |
|
34 |
- (cloud-watcher.aws-result:stack-status s)) |
|
34 |
+ (daydreamer.aws-result:stack-name s) |
|
35 |
+ (daydreamer.aws-result:stack-status s)) |
|
35 | 36 |
(stack-info s)) |
36 |
- (mapcar 'cloud-watcher.aws-result:extract-stack |
|
37 |
- (cloud-watcher.aws-result:extract-list |
|
37 |
+ (mapcar 'daydreamer.aws-result:extract-stack |
|
38 |
+ (daydreamer.aws-result:extract-list |
|
38 | 39 |
(cdar |
39 | 40 |
(aws/cloudformation:describe-stacks)))))) |
40 | 41 |
|
... | ... |
@@ -48,24 +49,25 @@ |
48 | 49 |
(stack-info (stack-for-name name))) |
49 | 50 |
|
50 | 51 |
(defun run-tests () |
51 |
- (st:test :package (find-package :cloud-watcher.aws-result)) |
|
52 |
- (st:test :package (find-package :cloud-watcher.main)) |
|
53 |
- (st:test :package (find-package :cloud-watcher.cli))) |
|
52 |
+ (st:test :package (find-package :daydreamer.aws-result)) |
|
53 |
+ (st:test :package (find-package :daydreamer.main)) |
|
54 |
+ (st:test :package (find-package :daydreamer.cli))) |
|
54 | 55 |
|
55 |
-(defun dump () |
|
56 |
- "Create an executable with the command-line interface defined above." |
|
57 |
- (handler-bind ((sb-ext:name-conflict (lambda (c) |
|
58 |
- (declare (ignore c)) |
|
59 |
- (invoke-restart-interactively 'sb-ext:resolve-conflict)))) |
|
60 |
- (let ((sb-ext:*on-package-variance* '(:warn (:cloud-watcher.aws-result |
|
61 |
- :cloud-watcher.main |
|
62 |
- :cloud-watcher.cli) |
|
63 |
- :error t))) |
|
64 |
- (asdf:load-system :cloud-watcher :force t))) |
|
65 |
- (clon:dump "cloud-watcher" main)) |
|
56 |
+(eval-when (:compile-toplevel :load-toplevel :execute) |
|
57 |
+ (defun dump () |
|
58 |
+ "Create an executable with the command-line interface defined above." |
|
59 |
+ (handler-bind ((sb-ext:name-conflict (lambda (c) |
|
60 |
+ (declare (ignore c)) |
|
61 |
+ (invoke-restart-interactively 'sb-ext:resolve-conflict)))) |
|
62 |
+ (let ((sb-ext:*on-package-variance* '(:warn t #+nil(:daydreamer.aws-result |
|
63 |
+ :daydreamer.main |
|
64 |
+ :daydreamer.cli) |
|
65 |
+ #+nil(:error t)))) |
|
66 |
+ (asdf:load-system :daydreamer :force t))) |
|
67 |
+ (clon:dump "daydreamer" main))) |
|
66 | 68 |
|
67 | 69 |
(defun main () |
68 |
- (let* ((context (net.didierverna.clon:make-context :synopsis *cloud-watcher-synopsis*)) |
|
70 |
+ (let* ((context (net.didierverna.clon:make-context :synopsis *daydreamer-synopsis*)) |
|
69 | 71 |
(files (clon:remainder :context context)) |
70 | 72 |
(region (clon:getopt :long-name "aws-region")) |
71 | 73 |
(aws-sdk/api:*session* (aws-sdk/session:make-session :region region))) |
... | ... |
@@ -74,9 +76,13 @@ |
74 | 76 |
|
75 | 77 |
(cond ((clon:getopt :long-name "help") (clon:help)) |
76 | 78 |
((clon:getopt :long-name "info") (stack-info-main (car files))) |
77 |
- ((clon:getopt :long-name "watch") (cloud-watcher.main:watch-stack (car files))) |
|
79 |
+ ((clon:getopt :long-name "watch") (daydreamer.main:watch-stack (car files))) |
|
78 | 80 |
((clon:getopt :long-name "stacks") (stacks-main)) |
79 | 81 |
((clon:getopt :long-name "outputs") (stack-outputs-main (car files))) |
80 | 82 |
((clon:getopt :long-name "parameters") (stack-parameters-main (car files))) |
81 | 83 |
((clon:getopt :long-name "self-test") (run-tests)) |
82 |
- ((clon:getopt :long-name "rebuild") (dump))))) |
|
84 |
+ ((clon:getopt :long-name "rebuild") |
|
85 |
+ (load (compile-file (load-time-value |
|
86 |
+ (asdf:system-relative-pathname :daydreamer "cli.lisp")))) |
|
87 |
+ (dump))))) |
|
88 |
+ |
... | ... |
@@ -3,8 +3,8 @@ |
3 | 3 |
(eval-when (:execute :load-toplevel :compile-toplevel) |
4 | 4 |
(net.didierverna.clon:nickname-package)) |
5 | 5 |
|
6 |
-(defpackage :cloud-watcher.main |
|
7 |
- (:use :cl :fw.lu :alexandria :st :cloud-watcher.aws-result) |
|
6 |
+(defpackage :daydreamer.main |
|
7 |
+ (:use :cl :fw.lu :alexandria :st :daydreamer.aws-result) |
|
8 | 8 |
(:export main dump |
9 | 9 |
#:stack-parameters |
10 | 10 |
#:stack-outputs |
... | ... |
@@ -12,7 +12,7 @@ |
12 | 12 |
#:watch-stack |
13 | 13 |
#:stack-info)) |
14 | 14 |
|
15 |
-(in-package :cloud-watcher.main) |
|
15 |
+(in-package :daydreamer.main) |
|
16 | 16 |
|
17 | 17 |
(define-condition invalid-result (error) |
18 | 18 |
()) |
... | ... |
@@ -119,7 +119,7 @@ |
119 | 119 |
(setf (old-status object) (stack-status object))) |
120 | 120 |
|
121 | 121 |
(defgeneric refresh (stack-formatter) |
122 |
- (:method ((stack cloud-watcher.aws-result:stack)) |
|
122 |
+ (:method ((stack daydreamer.aws-result:stack)) |
|
123 | 123 |
(stack-for-name (stack-name stack))) |
124 | 124 |
(:method ((stack-formatter string)) |
125 | 125 |
(make-instance 'stack-formatter :stack (stack-for-name stack-formatter))) |
... | ... |
@@ -127,7 +127,7 @@ |
127 | 127 |
(setf (stack stack-formatter) (refresh (stack stack-formatter))) |
128 | 128 |
stack-formatter)) |
129 | 129 |
|
130 |
-(defmethod old-status ((stack cloud-watcher.aws-result:stack)) |
|
130 |
+(defmethod old-status ((stack daydreamer.aws-result:stack)) |
|
131 | 131 |
nil) |
132 | 132 |
|
133 | 133 |
(defun stack-info (the-stack) |