Skip to content

Commit

Permalink
Merge pull request #260 from rogchap/docker-image
Browse files Browse the repository at this point in the history
Add support for releasing an offical docker image
  • Loading branch information
LandonTClipp authored May 12, 2020
2 parents f06a13b + 3f7cae0 commit 4746d91
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,20 @@ snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
dockers:
- goos: linux
goarch: amd64
binaries:
- mockery
image_templates:
- 'vektra/mockery:{{ .Tag }}'
- 'vektra/mockery:v{{ .Major }}'
- 'vektra/mockery:v{{ .Major }}.{{ .Minor }}'
- 'vektra/mockery:latest'
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ git:
script:
- go test -v -cover ./...

services:
- docker

after_success:
- test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"

deploy:
- provider: script
skip_cleanup: true
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM golang:1.14-alpine

COPY mockery /

ENTRYPOINT ["/mockery"]

0 comments on commit 4746d91

Please sign in to comment.