Merge pull request #4791 from dokku/tests-in-devcontainer
Fix test running in devcontainer
This commit is contained in:
@@ -2,7 +2,7 @@ FROM dokku/dokku:latest
|
|||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install --no-install-recommends -y build-essential file nano && \
|
RUN apt-get install --no-install-recommends -y build-essential file nano && \
|
||||||
apt-get install --no-install-recommends -y shellcheck xmlstarlet && \
|
apt-get install --no-install-recommends -y shellcheck uuid-runtime xmlstarlet && \
|
||||||
apt-get clean autoclean && \
|
apt-get clean autoclean && \
|
||||||
apt-get autoremove --yes && \
|
apt-get autoremove --yes && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
@@ -10,8 +10,10 @@ RUN apt-get install --no-install-recommends -y build-essential file nano && \
|
|||||||
ADD https://raw.githubusercontent.com/dokku/dokku/master/tests/dhparam.pem /mnt/dokku/etc/nginx/dhparam.pem
|
ADD https://raw.githubusercontent.com/dokku/dokku/master/tests/dhparam.pem /mnt/dokku/etc/nginx/dhparam.pem
|
||||||
|
|
||||||
COPY .devcontainer/bin/ /usr/local/bin/
|
COPY .devcontainer/bin/ /usr/local/bin/
|
||||||
COPY . .
|
COPY ["tests.mk", "Makefile"]
|
||||||
|
|
||||||
RUN make ci-dependencies
|
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
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"context": ".."
|
"context": ".."
|
||||||
},
|
},
|
||||||
"containerEnv": {
|
"containerEnv": {
|
||||||
"DOKKU_HOST_ROOT": "${localWorkspaceFolder}/tmp/data",
|
"DOKKU_HOST_ROOT": "${localWorkspaceFolder}/tmp/data/home/dokku",
|
||||||
"GO_ROOT_MOUNT": "${localWorkspaceFolder}:/go/src/github.com/dokku/dokku"
|
"GO_ROOT_MOUNT": "${localWorkspaceFolder}:/go/src/github.com/dokku/dokku"
|
||||||
},
|
},
|
||||||
"initializeCommand": ["mkdir", "-p", "tmp/data"],
|
"initializeCommand": ["mkdir", "-p", "tmp/data"],
|
||||||
|
|||||||
@@ -34,16 +34,13 @@ global_teardown() {
|
|||||||
cleanup_apps() {
|
cleanup_apps() {
|
||||||
rm -rf $DOKKU_ROOT/*/nginx.conf
|
rm -rf $DOKKU_ROOT/*/nginx.conf
|
||||||
|
|
||||||
apps=$(dokku --quiet apps:list)
|
dokku --quiet apps:list | xargs --no-run-if-empty -n1 dokku --force apps:destroy
|
||||||
if [[ -n "${apps}" ]]; then
|
|
||||||
dokku --quiet apps:list | xargs -n1 dokku --force apps:destroy
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup_containers() {
|
cleanup_containers() {
|
||||||
containers=$(docker container ls --quiet)
|
containers=$(docker container ls --quiet)
|
||||||
if [[ -n "$containers" ]]; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user