forked from uc-cdis/cdis-data-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
86 lines (83 loc) · 3.16 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
sudo: required
dist: trusty
language: go
git:
depth: 1
go:
- 1.14
jobs:
include:
- stage: test
os: linux
script: go test -v github.com/uc-cdis/gen3-client/tests
- stage: build
os: linux
env: WANTOS=linux GOARCH=amd64
- stage: build
os: linux
env: WANTOS=darwin GOARCH=amd64
- stage: build
os: linux
env: WANTOS=windows GOARCH=amd64
- stage: deploy
script: echo "Deploying to GitHub" && ls -al ~/shared
deploy:
overwrite: true
skip_cleanup: true
provider: releases
api_key:
secure: "fW7z/qIWlUZtY2ME/Q9BpWCC8BC+HRXZc4aq9SbfsjzVXlUHLTwzLz7RDLNVXDn9pW500N1kUZolYKSGH7OsFK5Bq8zrV788lhDdb9VSFsme/yiVSDqOmkpcosXjxd5x34ea1+xCgL3VHajqQ6mmDEu2a5DjuiQS75WMoU4lcNUTnZ4kQsJAXWf4gRwZMji06rrqxRIHmfSs+V+cRLxIMxfSbkgtLlcVZC9tHm/EHfd+djqWABEuCTNKWGQicdWIkrXJjtwRo22nGCLGO8iZ/DztrRWY1Evp129ys7q6hcU7jralu67gXJaEwWXURlKCq2u5vxR8kSxrzQVuRP5o48NkPkTPeRqP2E2rktLypT64elFG4uZ1V31UGx8g+GrlYgKx895Qf5/QEObpFJ2ckGVFNF5UDkQQKmLhipGsxwQF0kzik8IztdAOUUQKAxRG2WXqqWXhuB7tJRhnt9BViyGjCoZSuAmB/+JWtqAVA8cY1RN9lV9Yk80Jp7ZbzGbIQZ7oJPR1JzawwX1YfBwGIPQEH/HcQcTi4gdn+IXK1UvU1KjLUbTkM+D83T7KYDi0OIu+n2NkpBUxqUUFv3otM48NWKmRjip5T2oQdvyjB/bZj0r9IZXzhORRXVBaTj2KhaeOzt38v6v+qne+oVH2uChdkd3U5qUvAqrLrTFRzQY="
file:
- /home/travis/shared/dataclient_win64.zip
- /home/travis/shared/dataclient_osx.zip
- /home/travis/shared/dataclient_linux.zip
on:
repo: uc-cdis/cdis-data-client
branch: master
tags: true
before_install: |-
pip install --user awscli
export PATH=$PATH:$HOME/.local/bin
ln -s $PWD $GOPATH/src/github.com/uc-cdis/gen3-client
printf "package g3cmd\n\nconst (" >gen3-client/g3cmd/gitversion.go \
&& COMMIT=`git rev-parse HEAD` && echo " gitcommit=\"${COMMIT}\"" >>gen3-client/g3cmd/gitversion.go \
&& VERSION=`git describe --always --tags` && echo " gitversion=\"${VERSION}\"" >>gen3-client/g3cmd/gitversion.go \
&& echo ")" >>gen3-client/g3cmd/gitversion.go
mkdir -p ~/shared
aws s3 sync s3://cdis-dc-builds/$TRAVIS_BRANCH ~/shared
export GOOS=$WANTOS
export GOARCH="amd64"
script: |-
if [ "$GOOS" == "linux" ]
then
set -e
go build -o cdis-data-client
ls -al
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mv gen3-client files && mv cdis-data-client gen3-client
zip dataclient_linux.zip gen3-client && mv dataclient_linux.zip ~/shared/.
aws s3 sync ~/shared s3://cdis-dc-builds/$TRAVIS_BRANCH
fi
set +e
elif [ "$GOOS" == "darwin" ]
then
set -e
go build -o cdis-data-client
ls -al
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
mv gen3-client files && mv cdis-data-client gen3-client
zip dataclient_osx.zip gen3-client && mv dataclient_osx.zip ~/shared/.
aws s3 sync ~/shared s3://cdis-dc-builds/$TRAVIS_BRANCH
fi
set +e
elif [ "$GOOS" == "windows" ]
then
set -e
go build -o gen3-client.exe
ls -al
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
zip dataclient_win64.zip gen3-client.exe && mv dataclient_win64.zip ~/shared/.
aws s3 sync ~/shared s3://cdis-dc-builds/$TRAVIS_BRANCH
fi
set +e
fi