This repository was archived by the owner on Mar 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest-docker
More file actions
executable file
·51 lines (43 loc) · 1.41 KB
/
test-docker
File metadata and controls
executable file
·51 lines (43 loc) · 1.41 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
docker image build -f Dockerfile.ace -t ace:latest . || exit 0
for volume in ace-test-data-volume ace-test-db-volume
do
if docker volume ls | grep "$volume" > /dev/null
then
echo "removing $volume"
docker volume rm "$volume" > /dev/null || exit 0
fi
echo "creating $volume"
docker volume create "$volume" > /dev/null || exit 0
done
if ! docker network inspect ace-test-network > /dev/null 2>&1
then
docker network create ace-test-network
fi
if docker container inspect ace-test-db > /dev/null 2>&1
then
docker container stop ace-test-db
fi
cp docker/provision/test/50-ace-unittest.sql docker/mounts/mysql/init
cat sql/ace_schema.sql >> docker/mounts/mysql/init/50-ace-unittest.sql
cp docker/provision/test/9A-test.sql docker/mounts/mysql/init
docker run \
--name ace-test-db \
--hostname ace-test-db \
--rm \
-e MYSQL_ROOT_PASSWORD=ace \
--mount source=ace-test-db-volume,target=/var/lib/mysql \
--mount "type=bind,source=$SAQ_HOME/docker/mounts/mysql/init,target=/docker-entrypoint-initdb.d" \
--network ace-test-network \
--expose 3306 \
-p 127.0.0.1:13306:3306/tcp \
-d \
mysql:5.7
docker run \
-it -u ace \
--rm \
--network=ace-test-network \
--mount source=ace-test-data-volume,target=/opt/ace/data \
ace:latest \
/bin/bash -l -c docker/provision/test/execute
docker container stop ace-test-db