small pixel drawing of a pufferfish zoa

readme updates
Jes Olson j3s@c3f.net
Tue, 27 Sep 2022 19:08:39 -0500
commit

0fa66e2095e6135d47146bc22cc577e5d37a5c15

parent

99753e24181949f8557f04fefb623369e2810325

1 files changed, 51 insertions(+), 28 deletions(-)

jump to
M READMEREADME

@@ -109,22 +109,33 @@ zoa https://git.j3s.sh/j3s/config main

^ ^ ^ zoa, duh. git repo git ref (branch or tag) - zoa will clone the repo+branch specified in your config (or attempt to - fetch it, if it's already cloned) to /var/lib/zoa/<repo>/<branch> + zoa will clone the repo+ref specified (or attempt to + fetch it, if it's already cloned) to /var/lib/zoa/repo + + zoa will then execute /var/lib/zoa/repo/main + + + zoa will see that it's a different repo & will set everything up for you. + + if you run "zoa" with 0 arguments, zoa will cd to /var/lib/zoa/repo, git fetch, + and execute the main script. + + dev mode: if you run "zoa .", zoa will execute whatever is in the $PWD - this + is mainly for my own sanity. + + if you ever want to change the repo you're pointed at, simply run the long form + of zoa again: - zoa will then execute /var/lib/zoa/<repo>/<branch>/main + zoa https://git.j3s.sh/j3s/a-different-zoa-repo dev - if you run "zoa" with 0 arguments, it will execute if it finds exactly 1 - repo/branch combo in /var/lib/zoa - if you run zoa this way, it will not - clone the remote repo. this can be very useful for local testing. note - that the next run of zoa with a repo+branch will wipe any changes you - make in /var/lib. + that's it, you've configured your server! now set up a cronjob/systemd timer to + run zoa on a schedule, if that's your thing. or just login and run zoa + periodically. - that's it, you've configured your server! set up a cronjob/systemd timer to - run zoa on a schedule, if that's your thing. or just login and run it - periodically. you could even have the first zoa run set up a cronjob that runs it + 👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀 + you could even have the first zoa run set up a cronjob that runs zoa on a schedule, to make your life even easier. - 👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀 + 👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀👀 --- 2: environment variables and helper functions ---

@@ -208,7 +219,9 @@ ^

script to execute description: - zoa-script executes the given script from $zoa_root/scripts/ + zoa-script executes the given script from /var/lib/zoa/scripts/ + this is basically shorthand for ". /var/lib/zoa/repo/script/scriptname", + and also adds some nice decorators. examples: zoa-script nginx

@@ -219,32 +232,42 @@ --- 3: the layout ---

ah. finally. how do i lay out my zoa repo? - here's the canonical fs layout: - main <-- entrypoint - files/ <-- arbitrary text files you'd like to place - scripts/ <-- arbitrary shell scripts + here's the canonical repo layout: + + main <-- file, entrypoint + files/ <-- dir, contains arbitrary text files you'd like to place + scripts/ <-- dir, contains arbitrary shell scripts to config your systems you need at least main! everything else is optional. main is your entrypoint. if your whole vibe is just doing basic configuration of nodes, you _could_ put literally everything in main and just be done with it. - however, you may want main to be a little more complex: + however, if you want main to be a little more complex, + here's a good starting point: - case $NODENAME in + case $HOSTNAME in git.j3s.sh) - . ./ + # note that the CERTS env var will + # pass into any scripts called after + # it is defined, as if they're all 1 + # long script + CERTS='git.j3s.sh' + zoa-script certs + zoa-script git + ;; + j3s.sh) + CERTS='j3s.sh' + zoa-script certs + zoa-script web + ;; esac - scripts/ contains arbitrary shell scripts. you can organize them how you'd like. + scripts/ contains arbitrary shell scripts. you can organize them + how you'd like. dirs are supported. - files/ contains text files (no big files or binaries pls) that you might be - interested in placing on hosts. these can be accessed with the zoa_file function. - - *~~~ warts ~~~* - * zoa doesn't support function definitions YET - * zoa reserved words must be all-on-one-line atm - + files/ contains text files (no big files or binaries) that you might be + interested in placing on hosts. these can be accessed with the zoa-file function. BONUS SECTION! :3 :3 <3 :3