-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenerate.sh
executable file
·66 lines (58 loc) · 1.95 KB
/
generate.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
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
while true; do
read -p "Do you wish to run dev or test [test|dev]? " devtest
case $devtest in
[dev]* ) container="woocommerce-dev";test=false; break;;
[test]* ) container="woocommerce-test";test=true; break;;
* ) echo "Please answer dev or test.";;
esac
done
while true; do
read -p "You have chosen to start ${container}, are you sure [y/n]? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# Prepare environment and build package
docker-compose down
docker ps -aq --no-trunc -f status=exited | xargs docker rm
docker-compose up -d --build ${container}
docker-compose up -d selenium
npm install
node_modules/.bin/grunt
docker-compose exec ${container} curl -s https://getcomposer.org/installer | php
docker-compose exec ${container} ./composer.phar install
# Time to boot and install woocommerce
sleep 80
set -e
export WOOCOMMERCE_TEST_ENV=${devtest}
while true; do
read -p "Do you want to run full tests battery or only configure the module [full/configure/none]? " tests
case $tests in
[full]* ) break;;
[configure]* ) break;;
[none]* ) break;;
* ) echo "Please answer full, configure or none."; exit;;
esac
done
if [ ! -z "$tests" ] && [ "$tests" != "none" ];
then
vendor/bin/phpunit --group woocommerce3-basic
#Only for TEST environment. DEV environment is already installed
if [ $devtest = "test" ];
then
vendor/bin/phpunit --group woocommerce3-install
else
export WOOCOMMERCE_LANG=EN #in dev mode, woocommerce is installed in english
vendor/bin/phpunit --group woocommerce3-configure
fi
if [ $tests = "full" ];
then
vendor/bin/phpunit --group woocommerce3-buy
fi
fi
containerPort=$(docker container port ${container})
PORT=$(sed -e 's/.*://' <<< $containerPort)
echo 'Build of Woocommerce complete: http://'${container}'.docker:'${PORT}