-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·35 lines (28 loc) · 1.04 KB
/
test.sh
File metadata and controls
executable file
·35 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -euo pipefail
DIR_HOME=$(pwd)
DIR_CC_REACT="$DIR_HOME/packages/cc-react"
DIR_PLAYGROUND="$DIR_HOME/playground"
DIR_TESTS="$DIR_HOME/testing"
source "${DIR_HOME}/scripts/log.sh"
clear
cd "$DIR_TESTS/environments"
ENVIRONMENTS=$(echo *)
cd "$DIR_TESTS"
for environment in $ENVIRONMENTS; do
(
DOCKER_TAG=cc-react-playwright:$environment
DOCKER_NAME=cc-react-playwright-$environment
FOLDER="environments/$environment"
BUILD_LOG="$FOLDER/logs/build.log"
RUN_LOG="$FOLDER/logs/run.log"
info "($environment) Removing old containers..."
docker rm "$DOCKER_NAME" > /dev/null
info "($environment) Building new images (output in $BUILD_LOG)..."
docker build -t "$DOCKER_TAG" --debug --file "$FOLDER/$environment.Dockerfile" --progress=plain . &> "$BUILD_LOG"
info "($environment) Running new images (output in $RUN_LOG)..."
docker run --name "$DOCKER_NAME" "$DOCKER_TAG" > /dev/null
docker logs "$DOCKER_NAME" > "$RUN_LOG"
) &
done
wait