-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy path.travis.yml
48 lines (40 loc) · 2.4 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
sudo: required
services:
- docker
branches:
only:
- master
before_install:
- docker pull schmidtw/webpa.builder.centos6:latest
- docker run -it -e BUILD_NUMBER=$TRAVIS_BUILD_NUMBER -d --name build schmidtw/webpa.builder.centos6 bash
- env
- docker exec build rpm -q golang
- docker exec build go version
- docker exec build glide -v
- docker exec build git clone https://github.com/Comcast/talaria.git
- docker exec build git clone https://github.com/Comcast/talaria.git codecovio_build
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_80fea5e24838_key -iv $encrypted_80fea5e24838_iv -in keys/RPM-GPG-KEY-comcast-xmidt.private.enc -out keys/RPM-GPG-KEY-comcast-xmidt.private -d; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker cp keys/RPM-GPG-KEY-comcast-xmidt.private build:/RPM-GPG-KEY-comcast-xmidt.private; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker exec build bash -c "gpg --allow-secret-key-import --import /RPM-GPG-KEY-comcast-xmidt.private"; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then docker exec build bash -c "pushd talaria; git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge && git checkout -qf FETCH_HEAD; popd"; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then docker exec build bash -c "pushd codecovio_build; git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge && git checkout -qf FETCH_HEAD; popd"; fi'
script:
- docker exec build bash -c "export GOPATH=/codecovio_build && pushd codecovio_build/src && glide install --strip-vendor && cd talaria && go build talaria && go test -race -coverprofile=coverage.txt && popd"
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker exec build bash -c "pushd talaria; ./build_rpm.sh; popd"; fi'
after_success:
- docker exec build bash -c "pushd codecovio_build ; bash <(curl -s https://codecov.io/bash) -t 456790c4-2647-4625-9877-8ef7c04626d3; popd"
- docker cp build:/root/rpmbuild/RPMS/x86_64 .
- docker cp build:/versionno.txt .
- BINARY_NAME=`ls x86_64/`
- TRAVIS_TAG=`cat versionno.txt`
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker build -t talaria:local .; fi'
deploy:
provider: releases
prerelease: true
api_key: "$AUTH_TOKEN_BUILD"
file:
- x86_64/$BINARY_NAME
- keys/RPM-GPG-KEY-comcast-xmidt
skip_cleanup: true
on:
condition: "$TRAVIS_PULL_REQUEST = false"