Skip to content

Commit 88cd039

Browse files
Merge pull request #46 from magento-commerce/imported-magento-magento-cloud-docker-319
[Imported] Remove volume deletion from "up" and "down" CLI commands
2 parents fe89cca + 81d0e3d commit 88cd039

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

dist/bin/magento-docker

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ USAGE="Magento Cloud Docker
66
77
\033[33mArguments:\033[0m
88
pull pull latest images
9-
up destroy, re-create and start containers
9+
init destroy, re-create and start containers and volumes
10+
up create or start containers
1011
down destroy containers
1112
bash connect to bash
1213
stop stop containers
@@ -40,12 +41,20 @@ case "$1" in
4041
pull)
4142
docker-compose pull
4243
;;
44+
init)
45+
read -p "Any existing data volumes will be removed. Are you sure? [y/N] " -r
46+
echo
47+
if [[ $REPLY =~ ^[Yy]$ ]]
48+
then
49+
docker-compose down --volumes
50+
docker-compose up --detach
51+
fi
52+
;;
4353
up)
44-
docker-compose down --volumes
4554
docker-compose up --detach
4655
;;
4756
down)
48-
docker-compose down --volumes
57+
docker-compose down
4958
;;
5059
bash)
5160
docker-compose run --rm deploy bash

0 commit comments

Comments
 (0)