ordo/tryme.scm
2025-01-05 19:19:28 +00:00

41 lines
1.6 KiB
Scheme

(use-modules
(ordo connection)
(ordo action filesystem)
(ordo play)
(ordo task)
(ordo handler))
;; TODO: Consider how vars might be used in task args Currently a task argument
;; can be a context refrence, for example we could write:
;;
;; (install-directory (context-ref 'base-dir))
;;
;; but there's no way to nest these, so we this will not work:
;;
;; (install-file (file-name-join (context-ref 'base-dir) "foo"))
;;
;; Maybe we could implement something like:
;;
;; (install-file (context-fn (file-name-join (context-ref 'base-dir) "foo")))
;;
;; where context-fn is some syntax that returns (lambda (ctx) ...)
(define test-play
(play "Test play"
#:connection (local-connection)
#:tasks (list
(task "Create test directory"
(install-directory "/home/ray/ordo-test"))
(task "Create test file from string content"
(install-file "/home/ray/ordo-test/foo" #:content "Hello, world!\n"))
(task "Create test file from local source"
(install-file "/home/ray/ordo-test/bar" #:local-src "/home/ray/ordo-test/foo")
#:triggers '(fritz))
(task "Create test file from remote source"
(install-file "/home/ray/ordo-test/baz" #:remote-src "/home/ray/ordo-test/bar")
#:triggers '(frobnicate)))
#:handlers `((frobnicate . ,(handler "Frobnicate" (const #t)))
(fritz . ,(handler "Fritz" (const #t)))
(frotz . ,(handler "Frotz" (const #t))))))
;;(run-play test-play)