Run docker-compose with help from Nix/NixOS
5bd7ea2aa3
to ensure that the subtests defined in tests/arion-test/default.nix do not inadvertently re-use the arion-compose.nix, arion-pkgs.nix, etc. set up during the _previous_ subtest. Previously, each subtest attempted to clean itself up by doing the following: cd work && [...snip...] && rm -rf work This removes the directory "work/work", while leaving "work" itself intact. Subsequent subtests would then run: cp -r ${../../examples/some-example} work thereby copying the contents of "some-example" into "work/work" rather than into "work". As a result, all subtests but the first simply reapplied the Arion configuration set up by the first subtest, because this configuration persisted within the "work" directory used as the working directory for "arion up", etc. This commit corrects the issue by: 1. Removing "work" rather than "work/work", and 2. Adding certain flags to the "cp" invocation to ensure it reliably copies files into "work" rather than "work/work": (a) "-f" ("--force"), to overwrite destination files if they already exist, and (b) "-T" ("--no-target-directory") to copy the *contents* of the source directory to "work" rather than copying the source directory itself as a subdirectory of "work". Additionally, this commit factors out code common to all subtests into a reusable subtest generator coderef. |
||
---|---|---|
docs | ||
examples | ||
nix | ||
src | ||
tests | ||
.envrc | ||
.gitignore | ||
antora-playbook.yml | ||
arion-compose.cabal | ||
bors.toml | ||
build | ||
cabal.project | ||
CHANGELOG.md | ||
default.nix | ||
HACKING.md | ||
LICENSE | ||
live-check | ||
live-unit-tests | ||
README.asciidoc | ||
repl | ||
run-arion | ||
run-arion-quick | ||
run-arion-via-nix | ||
Setup.hs | ||
shell.nix | ||
update-options |
Arion is a tool for building and running applications that consist of multiple docker containers using NixOS modules. It has special support for docker images that are built with Nix, for a smooth development experience and improved performance. # https://docs.hercules-ci.com/arion/[Intro and Documentation]