version: '3' vars: IMAGE_NAME: docker/docker-index:local tasks: go:test: cmds: - go test ./... go:build: cmds: - go build -o docker-index -ldflags="-w -s -X 'github.com/docker/index-cli-plugin/internal.version={{.GIT_COMMIT}}'" env: CGO_ENABLED: 0 vars: GIT_COMMIT: sh: git describe --tags | cut -c 2- go:install: deps: [go:build] cmds: - mkdir -p ~/.docker/cli-plugins - install docker-index ~/.docker/cli-plugins/docker-index go:fmt: cmds: - goimports -w -local github.com/atomist-skills,github.com/docker,github.com/docker/index-cli-plugin . - gofmt -w . #- go mod tidy go:lint: cmds: - docker run --rm -v $(pwd):/app -v $(go env GOPATH)/pkg:/go/pkg -v $(go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -w /app golangci/golangci-lint:v1.50.1 golangci-lint run -v --timeout 10m go:release: cmds: - goreleaser release --rm-dist go:snapshot: cmds: - goreleaser release --snapshot --rm-dist docker:build: cmds: - docker buildx build . -f Dockerfile -t {{.IMAGE_NAME}} --load docker:build:all: cmds: - docker buildx build . -f Dockerfile -t {{.IMAGE_NAME}} --platform=linux/amd64,linux/arm64