mirror of
https://github.com/elyby/chrly.git
synced 2024-11-30 02:32:19 +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:
|
stages:
|
||||||
- test
|
- test
|
||||||
- publish
|
- name: deploy
|
||||||
|
if: branch = master OR tag IS present
|
||||||
|
|
||||||
before_install:
|
install:
|
||||||
- go get -u github.com/golang/dep/cmd/dep
|
- go get -u github.com/golang/dep/cmd/dep
|
||||||
|
- dep ensure
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: test
|
- stage: test
|
||||||
script:
|
script:
|
||||||
- dep ensure
|
- go test -v -race ./...
|
||||||
- go test ./...
|
- stage: deploy
|
||||||
- stage: publish
|
|
||||||
script:
|
script:
|
||||||
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
|
- 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
|
go build
|
||||||
-o release/chrly
|
-o release/chrly
|
||||||
-ldflags "-X github.com/elyby/chrly/bootstrap.version=latest"
|
-ldflags "-X github.com/elyby/chrly/bootstrap.version=$APP_VERSION"
|
||||||
main.go
|
main.go
|
||||||
- docker build -t elyby/chrly .
|
- docker build -t elyby/chrly:$DOCKER_TAG .
|
||||||
- docker push elyby/chrly
|
- 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