forked from mittwald/mittnite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
49 lines (41 loc) · 1.31 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
language: go
dist: xenial
go:
- '1.13'
services:
- docker
addons:
apt:
packages:
- curl
- bash
- rpm
env:
global:
- GO111MODULE=on
- CGO_ENABLED=0
- GO_VERSION=1.13
- GOLANG_LINT_VERSION=v1.21.0
before_script:
- sudo sysctl -w net.ipv4.ip_forward=1
- wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANG_LINT_VERSION}
script:
- golangci-lint run ./... || exit 1
- curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist || exit 1
before_deploy:
- if [[ -n "${DOCKER_LOGIN_USERNAME}" ]] && [[ -n "${DOCKER_LOGIN_PASSWORD}" ]] && [[ -n "${DOCKER_LOGIN_URL}" ]]; then docker login -u "${DOCKER_LOGIN_USERNAME}" -p "${DOCKER_LOGIN_PASSWORD}" "${DOCKER_LOGIN_URL}"; fi
- export FULL_IMAGE="${DOCKER_LOGIN_URL}/mittwald/mittnite"
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist && docker push "${FULL_IMAGE}:latest"
on:
tags: false
branch: master
condition: $TRAVIS_OS_NAME = linux
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist
on:
tags: true
condition: $TRAVIS_OS_NAME = linux