Skip to content

Commit

Permalink
chore: Add Taskfile automation
Browse files Browse the repository at this point in the history
  • Loading branch information
mircea-pavel-anton committed Aug 11, 2024
1 parent a004d32 commit 1290ad7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
version: "3"

env:
VERSION:
sh: git describe --tags --always --dirty
DIR_NAME:
sh: basename $(git rev-parse --show-toplevel)

tasks:
build:
desc: Build the binary.
sources:
- main.go
- cmd/*
- internal/*
- go.mod
- go.sum
cmd: go build -ldflags "-s -w -X github.com/mirceanton/kube-switcher/cmd.version=${VERSION}" -o ${DIR_NAME}

run:
desc: Run the binary.
deps: [build]
cmd: ./${DIR_NAME} {{.CLI_ARGS}}
test:
desc: Run tests.
cmd: go test -v ./... -race -covermode=atomic

lint:
desc: Run linter.
cmd: golangci-lint run

docker-build:
desc: Build the docker image.
cmd: docker build . -t ${DIR_NAME}:${VERSION}

0 comments on commit 1290ad7

Please sign in to comment.