-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprestashop.sh
executable file
·65 lines (56 loc) · 3.21 KB
/
prestashop.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
#!/bin/sh -e
#=============================================================================
# Use this script build hipay images and run Hipay Professional's containers
#
#==============================================================================
if [ "$1" = '' ] || [ "$1" = '--help' ];then
printf "\n "
printf "\n ================================================================================ "
printf "\n HiPay'S HELPER "
printf "\n "
printf "\n For each commands, you may specify the prestashop version "16" or "17" "
printf "\n ================================================================================ "
printf "\n "
printf "\n "
printf "\n - init : Build images and run containers (Delete existing volumes) "
printf "\n - restart : Run all containers if they already exist "
printf "\n - up : Up containters "
printf "\n - exec : Bash prestashop. "
printf "\n - log : Log prestashop. "
printf "\n "
fi
if [ "$1" = 'init' ] && [ "$2" = '' ];then
docker-compose -f docker-compose.dev.yml stop prestashop16 prestashop17 database smtp
docker-compose -f docker-compose.dev.yml rm -fv prestashop16 prestashop17 database smtp
rm -Rf data/
rm -Rf web16/
rm -Rf web17/
docker-compose -f docker-compose.dev.yml build --no-cache database smtp prestashop16 prestashop17
docker-compose -f docker-compose.dev.yml up -d database smtp prestashop16 prestashop17
fi
if [ "$1" = 'init' ] && [ "$2" != '' ];then
docker-compose -f docker-compose.dev.yml stop database smtp prestashop"$2"
docker-compose -f docker-compose.dev.yml rm database smtp -fv prestashop"$2"
rm -Rf data/
rm -Rf web16/
rm -Rf web17/
docker-compose -f docker-compose.dev.yml build --no-cache database smtp prestashop"$2"
docker-compose -f docker-compose.dev.yml up -d database smtp prestashop"$2"
fi
if [ "$1" = 'restart' ];then
docker-compose -f docker-compose.dev.yml stop database smtp prestashop16 prestashop17
docker-compose -f docker-compose.dev.yml up -d database smtp prestashop16 prestashop17
fi
if [ "$1" = 'kill' ];then
docker-compose -f docker-compose.dev.yml stop database smtp prestashop16 prestashop17
docker-compose -f docker-compose.dev.yml rm -fv database smtp prestashop16 prestashop17
rm -Rf data/
rm -Rf web16/
rm -Rf web17/
fi
if [ "$1" = 'exec' ] && [ "$2" != '' ];then
docker exec -it hipay-professional-shop-ps"$2" bash
fi
if [ "$1" = 'log' ] && [ "$2" != '' ];then
docker logs -f hipay-professional-shop-ps"$2"
fi