Skip to content

Commit

Permalink
chore: Add logs volume to Docker test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
absternator committed Aug 16, 2024
1 parent 42569cf commit 1e037aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker/test/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test-repo
orderly-root-volume
logs-volume
4 changes: 4 additions & 0 deletions docker/test/common
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ export ORDERLY_VOLUME=$CONTAINER_NAMESPACE-orderly-root
export ORDERLY_RUNNER_IMAGE=ghcr.io/mrc-ide/orderly.runner:main

export CONTAINER_ORDERLY_ROOT_PATH=/orderly-root

export LOGS_DIR=/logs

export ORDERLY_LOGS_VOLUME=$CONTAINER_NAMESPACE-logs
2 changes: 2 additions & 0 deletions docker/test/copy-orderly-root
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ rm -rf $HERE/orderly-root-volume
mkdir -p $HERE/orderly-root-volume

docker cp $DEBUG:$CONTAINER_ORDERLY_ROOT_PATH/. $HERE/orderly-root-volume

docker cp $DEBUG:$LOGS_DIR/. $HERE/logs-volume
4 changes: 4 additions & 0 deletions docker/test/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ docker run --rm -d \
redis

docker volume create $ORDERLY_VOLUME
docker volume create $ORDERLY_LOGS_VOLUME

docker run --rm -d --pull=missing \
--name=$DEBUG \
-v $ORDERLY_VOLUME:$CONTAINER_ORDERLY_ROOT_PATH \
-v $ORDERLY_LOGS_VOLUME:$LOGS_DIR \
ubuntu \
sleep infinity

Expand All @@ -33,6 +35,7 @@ docker run --rm -d --pull=always \
--env=REDIS_CONTAINER_NAME=$REDIS \
-p 127.0.0.1:8001:8001 \
-v $ORDERLY_VOLUME:$CONTAINER_ORDERLY_ROOT_PATH \
-v $ORDERLY_LOGS_VOLUME:$LOGS_DIR \
$ORDERLY_RUNNER_IMAGE \
$CONTAINER_ORDERLY_ROOT_PATH

Expand All @@ -43,5 +46,6 @@ docker run --rm -d --pull=always \
--env=ORDERLY_RUNNER_QUEUE_ID=$ORDERLY_RUNNER_QUEUE_ID \
--env=REDIS_CONTAINER_NAME=$REDIS \
-v $ORDERLY_VOLUME:$CONTAINER_ORDERLY_ROOT_PATH \
-v $ORDERLY_LOGS_VOLUME:$LOGS_DIR \
$ORDERLY_RUNNER_IMAGE \
$CONTAINER_ORDERLY_ROOT_PATH

0 comments on commit 1e037aa

Please sign in to comment.