Add --init flag to docker run.
rustfmt Build rustfmt has succeeded Details
rust-build Build rust-build has succeeded Details
rust-test Build rust-test has succeeded Details

I noticed in a separate project that ctrl+c was not being honored under --init was passed, so I'm adding it in here.
This commit is contained in:
Tom Alexander 2023-08-19 02:51:00 -04:00
parent 5db6cd617e
commit d8c3285e3c
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ test:
.PHONY: dockertest
dockertest:
> $(MAKE) -C docker/organic_test
> docker run --rm -i -t -v "$$(readlink -f ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test cargo test --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS)
> docker run --init --rm -i -t -v "$$(readlink -f ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test cargo test --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS)
.PHONY: dockerclean
dockerclean:

View File

@ -40,7 +40,7 @@ function launch_container {
additional_flags+=(--env RUST_BACKTRACE=full)
fi
docker run "${additional_flags[@]}" --rm -i -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test "${additional_args[@]}"
docker run "${additional_flags[@]}" --init --rm -i -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test "${additional_args[@]}"
}
main "${@}"

View File

@ -50,7 +50,7 @@ cargo test --no-fail-fast --lib --test test_loader "$test" -- --show-output
EOF
)
docker run --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script"
docker run --init --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script"
}