forked from waltermoreira/abaco
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build_and_test.sh
executable file
·53 lines (43 loc) · 1.98 KB
/
build_and_test.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
53
# Use this script to build all images and run the test suite.
# Assumes docker is installed locally.
# First, remove all containers and launch the dbs
printf "\n\n****** Abaco build and test script *******\n\n"
printf "Removing all containers...\n"
docker-compose down
# Build the core image
printf "\n\nBuilding core image...\n\n"
docker build -t abaco/core .
# Build the testsuite image
printf "\n\nBuilding testsuite image...\n\n"
docker build -t abaco/testsuite -f Dockerfile-test .
# abaco_path variable is needed so that addition containers can find the config file.
export abaco_path=$(pwd)
# first, launch the stack for camel case
printf "\n\nCamel case tests..\n"
printf "Updating config file.\n"
sed -i.bak 's/case: snake/case: camel/g' local-dev.conf
printf "Config file updated, launching abaco stack..\n"
docker-compose up -d
printf "Stack launched. Sleeping while stack starts up..."
sleep 5
printf "\n\nStack should be ready. Starting test suite...\n"
docker run --network=abaco_abaco -e base_url=http://nginx -e case=camel -v /:/host -v $(pwd)/local-dev.conf:/etc/service.conf -it --rm abaco/testsuite$TAG
printf "\n\n********* Test suite complete, removing containers...\n"
#docker-compose down
printf "Containers removed."
## next, launch stack for snake case
#printf "\n\nSnake case tests..\n"
#printf "Updating config file.\n"
#sed -i.bak 's/case: camel/case: snake/g' local-dev.conf
#printf "Config file updated, removing all containers...\n"
#docker rm -f `docker ps -aq` || true
#printf "Containers removed, launching abaco stack..\n"
#docker-compose -f docker-compose-local-db.yml up -d
#sleep 5
#docker-compose -f docker-compose-local.yml up -d
#printf "Stack launched. Sleeping while stack starts up...\n"
#sleep 15
#printf "\n\nStack should be ready. Starting test suite...\n"
#docker run -e base_url=http://172.17.0.1:8000 -e case=snake -v $(pwd)/local-dev.conf:/etc/abaco.conf -it --rm jstubbs/abaco_testsuite
#docker-compose down
printf "Containers removed. Build and test completed.\n\n"