forked from getsops/sops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (48 loc) · 1.73 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
50
51
52
53
54
55
language: go
go: 1.13
go_import_path: go.mozilla.org/sops/
env:
- VAULT_VERSION=1.1.3 VAULT_TOKEN=root VAULT_ADDR='http://127.0.0.1:8200'
addons:
apt:
packages:
- rpm
- ruby
- python3
- unzip
before_install:
- gem install fpm || sudo gem install fpm
- curl https://sh.rustup.rs -sSf | sh -s -- -y
- source ~/.cargo/env
- curl -O "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" && sudo unzip vault_${VAULT_VERSION}_linux_amd64.zip -d /usr/local/bin/
before_script:
- vault server -dev -dev-root-token-id="$VAULT_TOKEN" &
- sleep 5
- vault secrets enable -version=1 kv
script:
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then make; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make origin-build; fi'
- bash <(curl -s https://codecov.io/bash)
before_deploy:
- mkdir dist
- make deb-pkg rpm-pkg
- mv *.deb *.rpm dist/
- GOOS=darwin CGO_ENABLED=0 GO111MODULE=on go build -mod vendor -o dist/sops-${TRAVIS_TAG}.darwin go.mozilla.org/sops/v3/cmd/sops
- GOOS=windows CGO_ENABLED=0 GO111MODULE=on go build -mod vendor -o dist/sops-${TRAVIS_TAG}.exe go.mozilla.org/sops/v3/cmd/sops
- GOOS=linux CGO_ENABLED=0 GO111MODULE=on go build -mod vendor -o dist/sops-${TRAVIS_TAG}.linux go.mozilla.org/sops/v3/cmd/sops
- |
if [ ! -z "$TRAVIS_TAG" ]; then
version="v$(grep '^const Version' version/version.go |cut -d '"' -f 2)"
if [ "$version" != "$TRAVIS_TAG" ]; then
echo "Git tag $TRAVIS_TAG does not match version $version, update the source!"
exit 1
fi
fi
deploy:
provider: releases
api_key: "${GITHUB_OAUTH_TOKEN}"
file_glob: true
file: dist/*
skip_cleanup: true
on:
tags: true