Skip to content

Commit

Permalink
Add just docker rebuild command (#719)
Browse files Browse the repository at this point in the history
* Check for visible state

Usually `click()` should already do this for us I thought.

* Init `just docker rebuild` command

* Remove unnecessary docstring for private just method

* Don't start container afterwards
  • Loading branch information
Splines authored Dec 8, 2024
1 parent 8d83274 commit 1e19a40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
20 changes: 19 additions & 1 deletion .config/commands/docker.justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}
Expand Down Expand Up @@ -60,3 +59,22 @@ up-reseed *args:
#!/usr/bin/env bash
cd {{justfile_directory()}}/docker/development/
docker compose exec mampf bundle exec rails c

# Rebuilds the most essential containers in the dev or test environment
rebuild env="dev"
#!/usr/bin/env bash
environment={{ if env == "test" {"test"} else {"development"} }}
echo "Rebuilding in env: ${environment}"
cd {{justfile_directory()}}/docker/${environment}

# Remove
docker compose rm -s mampf
if [ "$environment" = "development" ]; then
docker compose rm -s webpacker
fi

# Rebuild
docker compose build mampf
if [ "$environment" = "development" ]; then
docker compose build webpacker
fi
1 change: 0 additions & 1 deletion .config/commands/test.justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}
Expand Down
1 change: 0 additions & 1 deletion .config/commands/utils.justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Prints this help message
[private]
help:
@just --list --justfile {{source_file()}}
Expand Down
1 change: 0 additions & 1 deletion .justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Documentation: https://just.systems/man/en/

# Prints this help message
[private]
help:
@just --list
Expand Down

0 comments on commit 1e19a40

Please sign in to comment.