Skip to content

Commit 263bc54

Browse files
committed
feat: Add clean command to dev.sh script
1 parent 88741f6 commit 263bc54

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

dev.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ do_down() {
7171
do_docker_compose down
7272
}
7373

74+
# Clean all containers, images and volumes
75+
do_clean() {
76+
section_title "Cleanup containers and images"
77+
do_docker_compose down --rmi all --volumes --remove-orphans
78+
}
79+
7480
do_composer_update() {
7581
echo 'composer update'
7682
if [[ -z "${LOWEST}" ]]; then
@@ -325,6 +331,7 @@ do_notice() {
325331
printf "\n ${GREEN}./dev.sh test_all --filter AnonymizatorFactoryTest${NC}"
326332
printf "\n - ${GREEN}test${NC}: Run PHPUnit tests for a specific database vendors or version"
327333
printf "\n - ${GREEN}unittest${NC}: Run PHPUnit tests without any database vendor"
334+
printf "\n - ${GREEN}clean${NC}: Cleanup containers and images"
328335
printf "\n - ${GREEN}notice${NC}: Display this help"
329336
printf "\n"
330337
printf "\nAvailable options:"
@@ -341,6 +348,6 @@ action=${1-}
341348
if [[ -n $@ ]];then shift;fi
342349

343350
case $action in
344-
build|up|down|ps|checks|test_all|unittest|test|composer_update|notice) do_$action "$@";;
351+
build|up|down|ps|checks|test_all|unittest|test|composer_update|notice|clean) do_$action "$@";;
345352
*) do_notice;;
346353
esac

docs/content/contribute/guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ When you finish to develop, stop the stack with:
4747
./dev.sh down
4848
```
4949

50+
If you need to clean up everything (containers, images and volumes), you can use:
51+
52+
```sh
53+
./dev.sh clean
54+
```
55+
5056
To learn more about `dev.sh` script, launch:
5157

5258
```sh

0 commit comments

Comments
 (0)