Skip to content

Commit

Permalink
test: Move compose test env to another dir
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Sul <mike.sul@foundries.io>
  • Loading branch information
mike-sul committed Oct 7, 2024
1 parent a6cd327 commit e553947
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dev-shell.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash

env_dir="${PWD}/test-env"

# Function to execute custom commands before exiting
down() {
docker compose --env-file=$PWD/docker/.env.dev -f $PWD/docker/docker-compose.yml down --remove-orphans
docker compose --env-file=$env_dir/.env.dev -f $env_dir/docker-compose.yml down --remove-orphans
# remove the docker runtime part
docker volume rm docker_docker-runtime
}
Expand All @@ -11,4 +13,4 @@ down() {
trap down EXIT

mkdir -p $PWD/.device/sysroot
docker compose --env-file=$PWD/docker/.env.dev -f $PWD/docker/docker-compose.yml run -e DEV_USER=$(id -u) -e DEV_GROUP=$(id -g) sotactl $@
docker compose --env-file=$env_dir/.env.dev -f $env_dir/docker-compose.yml run -e DEV_USER=$(id -u) -e DEV_GROUP=$(id -g) sotactl $@
3 changes: 3 additions & 0 deletions docker/.env.dev → test-env/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ BOOTDIR=$DEV_DIR/boot

# /var/lib/docker
DOCKER_DATA_ROOT=$DOCKER_DIR/data

# Dir containing Dockerfile and build context to build the "sotactl" image
SOTACTL_DOCKER_DIR=$PWD/docker
2 changes: 1 addition & 1 deletion docker/docker-compose.yml → test-env/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:

sotactl:
build:
context: .
context: ${SOTACTL_DOCKER_DIR}
args:
AKLITE_VER: master
dockerfile: Dockerfile
Expand Down

0 comments on commit e553947

Please sign in to comment.