Skip to content

Commit

Permalink
Merge 107a5a0 into d63ccb1
Browse files Browse the repository at this point in the history
  • Loading branch information
avelino committed Aug 16, 2020
2 parents d63ccb1 + 107a5a0 commit 6ae3ee6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 24 deletions.
39 changes: 20 additions & 19 deletions .goreleaser.yml
@@ -1,11 +1,16 @@
builds:
- binary: prestd
main: ./cmd/prestd/main.go
ldflags: -s -w main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser -X github.com/prest/prest/helpers.PrestVersionNumber={{.Version}}
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags:
- -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
goos:
- windows
- darwin
- linux
- freebsd
- openbsd
- netbsd
goarch:
- 386
- amd64
Expand All @@ -25,21 +30,17 @@ builds:
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
dockers:
-
goos: linux
goarch: amd64
binaries:
- prestd
image_templates:
- "prest/prest:{{ .Tag }}"
- "prest/ptest:v{{ .Major }}"
- "prest/prest:latest"
extra_files:
- ./cmd/prestd/prest.toml
# release:
# github:
# owner: prest
# name: prest
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^test:'
- Merge pull request
- Merge branch
- go mod tidy
release:
github:
owner: prest
name: prest
17 changes: 15 additions & 2 deletions .travis.yml
Expand Up @@ -18,6 +18,7 @@ matrix:
env:
- PREST_PG_USER=postgres PREST_PG_DATABASE=prest PREST_PG_PORT=5432 PREST_CONF=$TRAVIS_BUILD_DIR/testdata/prest.toml
before_install:
- sudo apt-get -y install gcc-multilib
- go get -v -d ./...
- go get -v github.com/inconshreveable/mousetrap
install:
Expand All @@ -27,19 +28,31 @@ before_script:
- docker login -u="$DOCKER_LOGIN" -p="$DOCKER_PASSWORD"
- sh testdata/schema.sh
script:
- curl -sfL https://git.io/goreleaser | sh -s -- check
- sh testdata/migrations_test.sh
- env go test -race -covermode=atomic -coverprofile=coverage.out ./...
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
- curl -sfL https://git.io/goreleaser | sh -s -- check

deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
script:
- docker build . -t prest/prest:v1
- docker push prest/prest:v1
- docker tag prest/prest:v1 prest/prest:$TRAVIS_TAG && docker push prest/prest:$TRAVIS_TAG
- curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
go: "1.15.x"
- provider: script
script:
- docker build . -t prest/prest:latest
- docker push prest/prest:latest
on:
branch: master
go: "1.15.x"
condition: $TRAVIS_OS_NAME = linux

notifications:
webhooks:
Expand Down
15 changes: 12 additions & 3 deletions Dockerfile
@@ -1,4 +1,13 @@
FROM alpine:3.7
COPY prestd /app/prestd
COPY ./cmd/prestd/prest.toml /app/prest.toml
FROM golang:alpine as builder

COPY . /go/src/github.com/prest/prest
WORKDIR /go/src/github.com/prest/prest/cmd/prestd
ENV GO111MODULE=on
RUN apk add --no-cache git && \
go mod tidy && go build

FROM alpine

COPY --from=builder /go/src/github.com/prest/prest/cmd/prestd/prestd /app/prestd
ADD ./cmd/prestd/prest.toml /app/prest.toml
CMD ["/app/prestd"]

0 comments on commit 6ae3ee6

Please sign in to comment.