Skip to content

feat: Add clean command to dev.sh script #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ do_down() {
do_docker_compose down
}

# Clean all containers, images and volumes
do_clean() {
section_title "Cleanup containers and images"
do_docker_compose down --rmi all --volumes --remove-orphans
}

do_composer_update() {
echo 'composer update'
if [[ -z "${LOWEST}" ]]; then
Expand Down Expand Up @@ -325,6 +331,7 @@ do_notice() {
printf "\n ${GREEN}./dev.sh test_all --filter AnonymizatorFactoryTest${NC}"
printf "\n - ${GREEN}test${NC}: Run PHPUnit tests for a specific database vendors or version"
printf "\n - ${GREEN}unittest${NC}: Run PHPUnit tests without any database vendor"
printf "\n - ${GREEN}clean${NC}: Cleanup containers and images"
printf "\n - ${GREEN}notice${NC}: Display this help"
printf "\n"
printf "\nAvailable options:"
Expand All @@ -341,6 +348,6 @@ action=${1-}
if [[ -n $@ ]];then shift;fi

case $action in
build|up|down|ps|checks|test_all|unittest|test|composer_update|notice) do_$action "$@";;
build|up|down|ps|checks|test_all|unittest|test|composer_update|notice|clean) do_$action "$@";;
*) do_notice;;
esac
6 changes: 6 additions & 0 deletions docs/content/contribute/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ When you finish to develop, stop the stack with:
./dev.sh down
```

If you need to clean up everything (containers, images and volumes), you can use:

```sh
./dev.sh clean
```

To learn more about `dev.sh` script, launch:

```sh
Expand Down
Loading