fix: do not delete devcontainers when running tests in a docker container

This commit is contained in:
Jose Diaz-Gonzalez
2021-09-16 00:24:29 -04:00
parent 974f601fa9
commit d83471bd46
2 changed files with 3 additions and 2 deletions

View File

@@ -15,4 +15,5 @@ RUN make ci-dependencies
COPY . .
ENV DOKKU_HOSTNAME=dokku.me
ENV DOKKU_HOSTNAME=dokku.me
LABEL org.label-schema.schema-version=1.0 org.label-schema.vendor=dokku com.dokku.devcontainer=true

View File

@@ -43,7 +43,7 @@ cleanup_apps() {
cleanup_containers() {
containers=$(docker container ls --quiet)
if [[ -n "$containers" ]]; then
docker container ls --quiet | xargs -n1 docker container rm -f || true
docker inspect -f '{{ if ne "true" (index .Config.Labels "com.dokku.devcontainer") }}{{.ID}} {{ end }}' $(docker ps -q) | xargs --no-run-if-empty -n1 docker container rm -f || true
fi
}