-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding travis-ci for go package and docker build
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM alpine | ||
ADD app /app | ||
CMD ["./app"] |