-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
just: add more structure and comments
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
- Loading branch information
Showing
3 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,73 @@ | ||
# Use `just <recipe>` to run a recipe | ||
# https://just.systems/man/en/ | ||
|
||
# By default, run the `--choose` command | ||
# By default, run the `--list` command | ||
default: | ||
@just --choose | ||
@just --list | ||
|
||
# Variables | ||
# Try to use "docker compose" and fall back to "docker-compose" if not available | ||
|
||
dockerComposeCommand := `docker compose > /dev/null && echo docker compose || echo docker-compose` | ||
containerName := "nextcloud-qownnotesapi-app-1" | ||
volumeName := "nextcloud-qownnotesapi_nextcloud" | ||
|
||
# Aliases | ||
|
||
alias remove-volumes := reset | ||
|
||
# Check the code, run tests and sign the app | ||
all: check-code test sign-app | ||
|
||
# Build the docker image | ||
build: | ||
{{ dockerComposeCommand }} build | ||
|
||
# Fetch the database from the container | ||
fetch-db: | ||
{{ dockerComposeCommand }} run --rm app su -c "cp data/mydb.db apps/qownnotesapi" www-data | ||
|
||
# Push the database to the container | ||
push-db: | ||
{{ dockerComposeCommand }} run --rm app su -c "cp apps/qownnotesapi/mydb.db* data" www-data | ||
|
||
# Open a shell in the container | ||
bash: | ||
{{ dockerComposeCommand }} run --rm app su -c "bash" www-data | ||
|
||
# Open a shell in the container as root | ||
bash-root: | ||
{{ dockerComposeCommand }} run --rm app bash | ||
|
||
# Run a sidecar container with more debugging tools | ||
slim-shell: | ||
slim debug --target nextcloud-qownnotesapi-app-1 | ||
slim debug --target {{ containerName }} | ||
|
||
# Turn off maintenance mode | ||
maintenance-mode-off: | ||
{{ dockerComposeCommand }} run --rm app su -c "./occ maintenance:mode --off" www-data | ||
|
||
# Run the app:check-code command | ||
check-code: | ||
{{ dockerComposeCommand }} run --rm app su -c "./occ app:check-code qownnotesapi" www-data | ||
|
||
# Run the app signing command for Nextcloud | ||
sign-app: | ||
{{ dockerComposeCommand }} run --rm app ../sign-app.sh www-data | ||
|
||
# Run the app signing command for Owncloud | ||
sign-app-owncloud: | ||
{{ dockerComposeCommand }} run --rm app ../sign-app-owncloud.sh | ||
|
||
# Run the tests | ||
test: | ||
{{ dockerComposeCommand }} run --rm app su -c "cd apps/qownnotesapi && make test" www-data | ||
|
||
# Show Nextcloud logs | ||
show-log: | ||
{{ dockerComposeCommand }} run --rm app tail -f /var/www/html/data/nextcloud.log | ||
|
||
remove-volumes: | ||
# Remove the docker volume | ||
reset: | ||
docker compose down | ||
docker volume rm nextcloud-qownnotesapi_nextcloud | ||
docker volume rm {{ volumeName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters