-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init
just
as command-line runner (#660)
* Init basic justfiles * Improve docker and test commands * Add Just VSCode extension to workspace recommendations * Add npm script to install latest version of `just` * Don't print help message in list * Add more docker `just` commands * Add more "open in browser" commands * Improve just installation via yarn commands * Add newline at end of `.justfile`
- Loading branch information
Showing
6 changed files
with
111 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Prints this help message | ||
[private] | ||
help: | ||
@just --list --justfile {{source_file()}} | ||
|
||
# Starts the dev docker containers | ||
@up *args: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
docker compose up {{args}} | ||
|
||
# Starts the dev docker containers and preseeds the database | ||
[confirm("This will reset all your data in the database locally. Continue? (y/n)")] | ||
up-reseed *args: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
export DB_SQL_PRESEED_URL="https://github.com/MaMpf-HD/mampf-init-data/raw/main/data/20220923120841_mampf.sql" | ||
export UPLOADS_PRESEED_URL="https://github.com/MaMpf-HD/mampf-init-data/raw/main/data/uploads.zip" | ||
docker compose up {{args}} | ||
|
||
# Removes the development docker containers | ||
@down: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
docker compose down | ||
|
||
# Stops the development docker containers (without removing them) | ||
@stop: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
docker compose stop | ||
|
||
# Puts you into a shell of your desired *development* docker container | ||
@shell name="mampf" shell="bash": | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
docker compose exec -it {{name}} bash | ||
|
||
# Puts you into a shell of your desired *test* docker container | ||
@shell-test name="mampf" shell="bash": | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/test/ | ||
docker compose exec -it {{name}} {{shell}} | ||
|
||
# Puts you into the rails console of the dev docker mampf container | ||
@rails-c: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/development/ | ||
docker compose exec mampf bundle exec rails c |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Prints this help message | ||
[private] | ||
help: | ||
@just --list --justfile {{source_file()}} | ||
|
||
# Starts the interactive Cypress test runner UI | ||
cypress: | ||
#!/usr/bin/env bash | ||
cd {{justfile_directory()}}/docker/test | ||
docker compose -f docker-compose.yml -f cypress.yml -f cypress-interactive.yml up --exit-code-from cypress | ||
|
||
# Opens Codecov in the default browser | ||
codecov: | ||
xdg-open https://app.codecov.io/gh/MaMpf-HD/mampf |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Documentation: https://just.systems/man/en/ | ||
|
||
# Prints this help message | ||
[private] | ||
help: | ||
@just --list | ||
|
||
# Test-related commands | ||
mod test ".config/commands/test.justfile" | ||
# see https://github.com/casey/just/issues/2216 | ||
# alias t := test | ||
|
||
# Docker-related commands | ||
mod docker ".config/commands/docker.justfile" | ||
|
||
# Opens the MaMpf wiki in the default browser | ||
wiki: | ||
#!/usr/bin/env bash | ||
xdg-open https://github.com/MaMpf-HD/mampf/wiki | ||
# Opens the MaMpf pull requests (PRs) in the default browser | ||
prs: | ||
#!/usr/bin/env bash | ||
xdg-open https://github.com/MaMpf-HD/mampf/pulls | ||
# Opens the PR for the current branch in the default browser | ||
pr: | ||
#!/usr/bin/env bash | ||
branchname=$(git branch --show-current) | ||
xdg-open "https://github.com/MaMpf-HD/mampf/pulls?q=is%3Apr+is%3Aopen+head%3A$branchname" | ||
# Opens the MaMpf GitHub code tree at the current branch in the default browser | ||
code branch="": | ||
#!/usr/bin/env bash | ||
branchname={{ if branch == "" {"$(git branch --show-current)"} else {branch} }} | ||
xdg-open https://github.com/MaMpf-HD/mampf/tree/$branchname |
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
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