Open craigcomstock opened 20 hours ago
I have a work in progress extending what I did for the first command executed in the bash script as well as dynamically finding either docker-compose or "docker compose".
https://github.com/craigcomstock/scl_modules/tree/issue-11
I will make a PR after I have tested and fixed up this draft.
Thanks!
https://github.com/basvandervlies/scl_modules/pull/12 could probably use a touch of cleanup and more error handling could be added. Commits need to be squashed. :) Thanks for the useful module! It will be featured in a monthly module monday blog post on Dec. 2.
Thanks for this module. I am working through getting it working on a Debian-12 system and ran into a few snags.
While working through the snags I noticed that the textual description of errors from the module calling commands wasn't included in the log messages for notkept promises. I will make a PR here with some adjustments I came up with.
First I tried installing docker.io and docker-compose packages from Debian and those seem to be of such old version that they are incompatible with your promise type. e.g. docker.io provides the docker command but docker-compose doesn't provide the "plugin" version to enable "docker compose" but rather the stand-alone docker-compose command. Also, this version of docker-compose doesn't support the --format option.
Secondly, when I made a sample policy like in the README I get an error:
policy:
result:
Notice that the line
is coming out on stderr and if I look in Mission Portal, Policy Analyzer or Reports I can't see that detail in the log messages. Also note that the error caused no promise result to be returned from the module:
And then I see that Dockerfile is not where I expect it to be!
Egads, so
cfbs add ./composetest
which I expected to include all the files is not including Dockerfile. This is not really so much a bug but a "feature" of the limits to what the update policy in MPF will copy but it might be worth mentioning in your README.I added a def.json to my composetest directory which will get slurped up by cfbs build and added to the main def.json
This causes my Dockerfile to be copied to inputs next to my compose.yaml file and all is well.