Skip to content

Commit

Permalink
Added taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilyes512 committed Nov 19, 2023
1 parent f8b509d commit 87c93b4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Taskfile.dist.yml
@@ -0,0 +1,43 @@
# https://taskfile.dev

version: '3'

silent: true

env:
# BUILDKIT_PROGRESS: plain

vars:
GO_VERSION: bookworm
GO_CACHE_VOLUME_NAME: boilr-gocache
GO_MOD_CACHE_VOLUME_NAME: boilr-gomodcache

tasks:

go:shell:
desc: Shell into golang container
cmds:
- docker run --rm -it
--workdir /workspace
--volume {{.GO_CACHE_VOLUME_NAME}}:/root/.cache/go-build
--volume {{.GO_MOD_CACHE_VOLUME_NAME}}:/go/pkg/mod
--volume ${PWD}/.:/workspace
golang:{{.GO_VERSION}}
bash

go:deps:
desc: List direct dependencies with their current version and possible newer version
cmds:
- docker run --rm -it
--workdir /workspace
--volume {{.GO_CACHE_VOLUME_NAME}}:/root/.cache/go-build
--volume {{.GO_MOD_CACHE_VOLUME_NAME}}:/go/pkg/mod
--volume ${PWD}/.:/workspace
golang:{{.GO_VERSION}}
/bin/bash -c 'go list -f "{{`{{if not (or .Main .Indirect)}}{{.Path}}{{end}}`}}" -m all | xargs -r go list -m -u'

go:remove-cache-volumes:
desc: Remove Go cache volumes
cmds:
- docker volume rm {{.GO_CACHE_VOLUME_NAME}} || true
- docker volume rm {{.GO_MOD_CACHE_VOLUME_NAME}} || true

0 comments on commit 87c93b4

Please sign in to comment.