forked from qa-guru/niffler-st5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-e2e.sh
52 lines (43 loc) · 1.72 KB
/
docker-compose-e2e.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
source ./docker.properties
export PROFILE=docker
echo '### Java version ###'
java --version
front=""
front_image=""
docker_arch=""
if [[ "$1" = "gql" ]]; then
front="./niffler-frontend-gql/";
front_image="${IMAGE_PREFIX}/${FRONT_IMAGE_NAME_GQL}-${PROFILE}:latest";
else
front="./niffler-frontend/";
front_image="$IMAGE_PREFIX/${FRONT_IMAGE_NAME}-${PROFILE}:latest";
fi
ARCH="$docker_arch" FRONT_IMAGE="$front_image" PREFIX="${IMAGE_PREFIX}" PROFILE="${PROFILE}" docker-compose -f docker-compose.test.yml down
docker_containers="$(docker ps -a -q)"
docker_images="$(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'niffler')"
if [ ! -z "$docker_containers" ]; then
echo "### Stop containers: $docker_containers ###"
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
fi
if [ ! -z "$docker_images" ]; then
echo "### Remove images: $docker_images ###"
docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'niffler')
fi
ARCH=$(uname -m)
bash ./gradlew -Pskipjaxb jibDockerBuild -x :niffler-e-2-e-tests:test
if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
docker_arch="linux/arm64"
docker build --build-arg DOCKER=arm64v8/eclipse-temurin:21-jdk -t "${IMAGE_PREFIX}/${TEST_IMAGE_NAME}:latest" -f ./niffler-e-2-e-tests/Dockerfile .
else
docker_arch="linux/amd64"
docker build --build-arg DOCKER=eclipse-temurin:21-jdk -t "${IMAGE_PREFIX}/${TEST_IMAGE_NAME}:latest" -f ./niffler-e-2-e-tests/Dockerfile .
fi
cd "$front" || exit
bash ./docker-build.sh ${PROFILE}
cd ../ || exit
docker pull selenoid/vnc_chrome:117.0
docker images
ARCH="$docker_arch" FRONT_IMAGE="$front_image" PREFIX="${IMAGE_PREFIX}" PROFILE="${PROFILE}" docker-compose -f docker-compose.test.yml up -d
docker ps -a