diff --git a/.goreleaser.yml b/.goreleaser.yml index 1f7548b77..e6d7aaaf6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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}}" diff --git a/.travis.yml b/.travis.yml index 857106e42..598a8de59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c14edc142 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM golang:1.14-alpine + +COPY mockery / + +ENTRYPOINT ["/mockery"]