Run docker-compose with help from Nix/NixOS
Find a file
Matt Schreiber 5bd7ea2aa3 Clean up "work" directory before "arion up"
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.
2020-03-19 12:04:04 +01:00
docs Fix doc formatting 2019-10-29 12:52:00 +01:00
examples Fix warnings 2019-10-29 11:04:25 +01:00
nix sources.nixpkgs: 19.03 -> 20.03 2020-03-19 12:04:04 +01:00
src arion-base: buildLayeredImage -> buildImage to avoid build error 2020-02-24 00:46:26 +01:00
tests Clean up "work" directory before "arion up" 2020-03-19 12:04:04 +01:00
.envrc Implement defaultExec 2019-09-28 14:25:41 +02:00
.gitignore Add scripts for hacking 2019-06-23 21:33:23 +02:00
antora-playbook.yml Update antora-playbook.yml 2019-10-25 00:13:41 +02:00
arion-compose.cabal Add cabal check to ci, build strictly (once) 2019-10-04 19:09:29 +02:00
bors.toml Add bors 2019-09-18 19:32:24 +02:00
build Add scripts for hacking 2019-06-23 21:33:23 +02:00
cabal.project Add scripts for hacking 2019-06-23 21:33:23 +02:00
CHANGELOG.md Bump to v0.1.0.0 2019-10-04 20:18:25 +02:00
default.nix Rewire nix 2019-09-28 16:27:07 +02:00
HACKING.md Add run-arion-quick + HACKING.md 2019-10-03 17:56:06 +02:00
LICENSE LICENSE: fill in 2019-09-09 19:12:54 +02:00
live-check Fix live-* script cabal file references 2019-09-28 14:53:46 +02:00
live-unit-tests Fix live-* script cabal file references 2019-09-28 14:53:46 +02:00
README.asciidoc Update README.asciidoc 2019-10-25 13:29:11 +02:00
repl Add scripts for hacking 2019-06-23 21:33:23 +02:00
run-arion Add scripts for hacking 2019-06-23 21:33:23 +02:00
run-arion-quick Add run-arion-quick + HACKING.md 2019-10-03 17:56:06 +02:00
run-arion-via-nix Add scripts for hacking 2019-06-23 21:33:23 +02:00
Setup.hs Add Haskell package 2019-06-14 16:10:37 +02:00
shell.nix Pass system through project nix files 2019-06-15 14:32:59 +02:00
update-options Fix doc formatting 2019-10-29 12:52:00 +01:00

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]