justfile (1904B)
1 help: 2 @just --list 3 4 # Bump version, update CHANGELOG, tag, and push (requires git-cliff) 5 bump: 6 @hack/git-release 7 8 9 # Setup pnpm and spago 10 setup: 11 pnpm install 12 pnpm spago install 13 14 # Build the project locally 15 build: 16 pnpm run build 17 18 # Build a release 19 release: 20 pnpm run release 21 22 # Run the project locally 23 run: 24 pnpm spago run 25 26 # Build and run locally 27 dev: build run 28 29 # Run tests 30 test: 31 pnpm test 32 33 # Format PureScript source code 34 tidy: 35 pnpm run tidy 36 37 # Enter the Nix development shell 38 shell: 39 nix develop 40 41 # Nix operations (build, run) 42 nix command: 43 @if [ "{{ command }}" = "build" ]; then \ 44 nix build .; \ 45 elif [ "{{ command }}" = "run" ]; then \ 46 ./result/bin/corpus-server; \ 47 else \ 48 echo "Unknown nix command: {{ command }}"; \ 49 exit 1; \ 50 fi 51 52 # Add a new user (--slug and --db required; --name, --listenbrainz-user, --lastfm-user optional) 53 add-user *args: 54 node server.js add-user {{args}} 55 56 # Reset the API token for a user (--slug required) 57 reset-token *args: 58 node server.js reset-token {{args}} 59 60 # List all users 61 list-users: 62 node server.js list-users 63 64 # Render docs diagrams (requires graphviz) 65 docs: 66 hack/graphviz docs/architecture.dot 67 68 # Run quality and security checks 69 check: 70 # pnpm exec whine 71 pnpm spago build --strict 72 pnpm exec purs-tidy check "src/**/*.purs" 73 elm-analyse 74 statix check . 75 76 # Manage the container image (build, load, push) 77 oci command: 78 @if [ "{{ command }}" = "build" ]; then \ 79 nix build .#container; \ 80 elif [ "{{ command }}" = "load" ]; then \ 81 podman load < result; \ 82 elif [ "{{ command }}" = "push" ]; then \ 83 skopeo copy \ 84 --dest-precompute-digests \ 85 docker-archive:result docker://ghcr.io/mtmn/corpus:latest; \ 86 else \ 87 echo "Unknown container command: {{ command }}"; \ 88 exit 1; \ 89 fi