Skip to content

Commit

Permalink
Travis ci (#15)
Browse files Browse the repository at this point in the history
* Adding travis-ci for go package and docker build
  • Loading branch information
ilkinulas authored Apr 1, 2019
1 parent 9622049 commit 96cb094
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- env:
- CGO_ENABLED=0
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: go

go:
- 1.8.3

services:
- docker

script:
- true

after_success:
- test -n "$TRAVIS_TAG" && curl -s https://raw.githubusercontent.com/goreleaser/get/master/latest | bash
- CGO_ENABLED="0" GOARCH="amd64" GOOS="linux" go build -a -installsuffix cgo -o ./app
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- export REPO=peakcom/s5cmd
- echo $REPO:$TRAVIS_BRANCH
- docker build -f Dockerfile -t $REPO:$TRAVIS_BRANCH .
- docker push $REPO:$TRAVIS_BRANCH
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_TAG ; fi`
- if [[ ! -z "${TAG}" ]]; then docker tag $REPO:$TRAVIS_BRANCH $REPO:$TAG; fi
- if [[ ! -z "${TAG}" ]]; then docker push $REPO:$TAG; fi
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine
ADD app /app
CMD ["./app"]

0 comments on commit 96cb094

Please sign in to comment.