mirror of
https://github.com/elyby/chrly.git
synced 2024-11-26 16:51:59 +05:30
Adjust Travis setup
This commit is contained in:
parent
befa163f0e
commit
d7bc77e5a7
27
.travis.yml
27
.travis.yml
@ -9,26 +9,33 @@ services:
|
||||
|
||||
stages:
|
||||
- test
|
||||
- publish
|
||||
- name: deploy
|
||||
if: branch = master OR tag IS present
|
||||
|
||||
before_install:
|
||||
install:
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
- dep ensure
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: test
|
||||
script:
|
||||
- dep ensure
|
||||
- go test ./...
|
||||
- stage: publish
|
||||
- go test -v -race ./...
|
||||
- stage: deploy
|
||||
script:
|
||||
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
|
||||
- dep ensure
|
||||
- export DOCKER_TAG="${TRAVIS_TAG:-dev}"
|
||||
- export APP_VERSION="${TRAVIS_TAG:-dev-${TRAVIS_COMMIT:0:7}}"
|
||||
- >
|
||||
env GOOS=linux
|
||||
env GOOS=linux GOARCH=amd64
|
||||
go build
|
||||
-o release/chrly
|
||||
-ldflags "-X github.com/elyby/chrly/bootstrap.version=latest"
|
||||
-ldflags "-X github.com/elyby/chrly/bootstrap.version=$APP_VERSION"
|
||||
main.go
|
||||
- docker build -t elyby/chrly .
|
||||
- docker push elyby/chrly
|
||||
- docker build -t elyby/chrly:$DOCKER_TAG .
|
||||
- docker push elyby/chrly:$DOCKER_TAG
|
||||
- |
|
||||
if [ -z ${TRAVIS_TAG+x} ]; then
|
||||
docker tag elyby/chrly:$DOCKER_TAG elyby/chrly:latest
|
||||
docker push elyby/chrly:latest
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user