Skip to content

Commit

Permalink
cleanup justfile and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger committed Jan 18, 2024
1 parent 254b949 commit 446bee2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ just web-install-deps

Run front end dev server and Go binary together with `mprocs`
```bash
just run-all-dev
just run-watch
```

### Configuration
Expand Down
51 changes: 20 additions & 31 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
default:
@just --list

image_name := 'ghcr.io/astriaorg/eth-faucet'
default_docker_tag := 'local'

# installs developer dependencies for MacOS users with `brew`
brew-install-dev-deps:
brew install just
brew install mprocs
brew install golangci-lint
brew install watchexec

# builds front end web app and go binary
build-all:
go generate -x
go build -v
# installs deps for front end app
web-install-deps:
cd web && npm install

# builds docker image w/ `local` tag by default
docker-build tag=default_docker_tag:
docker buildx build -f ./Dockerfile -t {{image_name}}:{{tag}} .
# runs the full web app. generates the front end app before starting the server.
run:
go generate -x
go run -v ./... -httpport 8080

# runs faucet via docker
docker-run tag=default_docker_tag:
docker run --rm -p 8080:8080 {{image_name}}:{{tag}}
# run cli and restart when code changes
run-watch:
watchexec --exts go,mod,svelte,js,ts,html --clear --restart -- just run

# lints the go code
go-lint:
Expand All @@ -36,34 +33,26 @@ go-test:
go-test-watch:
@just _watch-go go-test

# runs the go binary
go-run:
go run -v ./... -httpport 8080

# run cli and restart when code changes
go-run-watch:
@just _watch-go go-run

# formats Go code
go-fmt:
go fmt ./...

# installs deps for front end app
web-install-deps:
cd web && npm install

# prettifies web code
web-fmt:
cd web && npm run prettier

# run the front end dev server
web-run:
cd web && npm run dev
## Docker

image_name := 'ghcr.io/astriaorg/eth-faucet'
default_docker_tag := 'local'

# run front end and backend via mprocs (`brew install mprocs` may be needed)
run-all-dev:
mprocs "just web-run" "just go-run"
# builds docker image w/ `local` tag by default
docker-build tag=default_docker_tag:
docker buildx build -f ./Dockerfile -t {{image_name}}:{{tag}} .

# runs faucet via docker
docker-run tag=default_docker_tag:
docker run --rm -p 8080:8080 {{image_name}}:{{tag}}

## Helpers

Expand Down

0 comments on commit 446bee2

Please sign in to comment.