mirror of
https://github.com/ivuorinen/go-test-sarif.git
synced 2026-01-26 03:04:09 +00:00
feat: the app (#2)
This commit is contained in:
40
Justfile
Normal file
40
Justfile
Normal file
@@ -0,0 +1,40 @@
|
||||
# Set the application name
|
||||
app_name := "go-test-sarif"
|
||||
binary_path := "./bin/" + app_name
|
||||
src := "./cmd/main.go"
|
||||
|
||||
# Default task
|
||||
default:
|
||||
just build
|
||||
|
||||
# Build the Go binary
|
||||
build:
|
||||
echo "Building {{app_name}}..."
|
||||
mkdir -p bin
|
||||
GOOS=linux GOARCH=amd64 go build -o {{binary_path}} {{src}}
|
||||
echo "Binary built at {{binary_path}}"
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
echo "Running tests..."
|
||||
go test ./... -v
|
||||
|
||||
# Run the application
|
||||
run:
|
||||
echo "Running {{app_name}}..."
|
||||
{{binary_path}} go-test-results.json go-test-results.sarif
|
||||
|
||||
# Clean build artifacts
|
||||
clean:
|
||||
echo "Cleaning up..."
|
||||
rm -rf bin go-test-results.sarif
|
||||
|
||||
# Build the Docker image
|
||||
docker-build:
|
||||
echo "Building Docker image..."
|
||||
docker build -t ghcr.io/ivuorinen/{{app_name}}:latest .
|
||||
|
||||
# Run the application inside Docker
|
||||
docker-run:
|
||||
echo "Running {{app_name}} in Docker..."
|
||||
docker run --rm -v $(pwd):/workspace ghcr.io/ivuorinen/{{app_name}} go-test-results.json go-test-results.sarif
|
||||
Reference in New Issue
Block a user