build: make build-and-push.sh runnable from any directory

- Resolve PROJECT_DIR from the script's own location by default
  (works with absolute, relative and symlinked invocations)
- Allow override via --project-dir flag or PROJECT_DIR env var
- Improve error message for invalid --project-dir paths
- Update usage and README accordingly
This commit is contained in:
2026-09-08 18:20:49 -03:00
parent ceebfb33f8
commit 3b0e6b4a3f
2 changed files with 27 additions and 8 deletions
+4
View File
@@ -18,6 +18,10 @@ The script reads `artifactId` and `version` from `pom.xml` for the image name
and tag, builds for `linux/amd64`, and verifies the image is present on the
remote after pushing. See `./scripts/build-and-push.sh --help` for all flags.
It can be invoked from any directory: by default it resolves the project root
from the script's own location. Override with `--project-dir PATH` or the
`PROJECT_DIR` environment variable when needed.
## Running the application in dev mode
You can run your application in dev mode that enables live coding using: