keep the dynamism of make in pure shell
Two mechanisms, matching what the make engine actually did:
Lazy defaults. A stack setting is a function myos_default_<VAR>, called only
when the variable has no value, and called again at every reference. That is
exactly a recursive ?=: an explicit value wins, and the default follows a
DOMAIN that a .env changes later. The prefix is what makes it safe; the first
version used a bare function named after the variable, and the test suite
caught it running /usr/bin/host for a stack group called host.
Templates. myos env-update fills a .env from the .env.dist files, expanding
${VAR} against the current values and running $(command), forward references
included.
Also fixed: the project .env now wins over /etc/conf.d/myos, which is what the
documentation claimed and the code did not.
share/make/shim.mk lets a project keep make as a front end: every myos command
becomes a target that shells out to bin/myos, and the project keeps its own
targets and its stack .mk files. It sits outside make/ because the legacy
engine globs every .mk in there.
This commit is contained in:
@@ -77,3 +77,7 @@ cmd-scale | app-nogit | scale postgres SERVICE=postgre
|
||||
cmd-ls | host-project | ls
|
||||
cmd-ls-groups | host-project | ls --groups
|
||||
cmd-env-domain | host-project | env DOMAIN
|
||||
shim-up-group | shim-project | @make up STACK=host DRYRUN=true
|
||||
shim-config | shim-project | @make config STACK=host/consul DRYRUN=true
|
||||
shim-project-target | shim-project | @make host-certs
|
||||
shim-env | shim-project | @make env ARGS=COMPOSE_PROJECT_NAME STACK=host
|
||||
|
||||
@@ -16,6 +16,7 @@ Commands:
|
||||
ps logs config exec run inspect and enter them
|
||||
ls [--groups] list the stacks myos can see
|
||||
env [VAR...] show resolved variables
|
||||
env-update fill .env from the .env.dist templates
|
||||
doctor check the installation
|
||||
version print the myos version
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
docker compose -f @WD@/stack/host/consul.yml -f @MYOS@/share/compose/networks.yml -p testhost --project-directory @WD@/stack/host config
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
COMPOSE_PROJECT_NAME testhost
|
||||
[exit 0]
|
||||
@@ -0,0 +1,2 @@
|
||||
would renew the certificates of host/consul host/fabio
|
||||
[exit 0]
|
||||
@@ -0,0 +1,4 @@
|
||||
docker network create tester-local
|
||||
docker network create testhost
|
||||
docker compose -f @WD@/stack/host/consul.yml -f @WD@/stack/host/fabio.yml -f @MYOS@/share/compose/networks.yml -p testhost --project-directory @WD@/stack/host up -d
|
||||
[exit 0]
|
||||
Reference in New Issue
Block a user