-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (89 loc) · 5.74 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
87
88
89
90
91
92
93
94
95
96
97
98
99
sudo: required
services:
- docker
language: go
go:
- 1.9
env:
matrix:
- OKARCH=amd64 OSARCH=amd64
- OKARCH=386 OSARCH=i386
global:
- VERSION=${TRAVIS_TAG}
- GH_USER=${TRAVIS_REPO_SLUG%/*}
- GH_APP=${TRAVIS_REPO_SLUG#*/}
- JFROG_CLI_OFFER_CONFIG=false
# bintray token
- secure: CanX22Xa0njLPjmP2P/2jI6odviYG7ZrLxuV40rvEFzajfk+Vxli8tkxRL3+PTHOOoGLzlxFsrbkbjupYU+5YyXbocEWx5ZJ6NG3rhh/pfGHjyPxwm37CPPq70rJvhV35VDQNdVC5Ec+5HuTTMmkdGODR5h0KDiJtt8cD3hRh67jP0nQ1OtRPqOfJu+c9BDXxs3ZWWZgFyt3GlronMIpif1udVEVqUgX1Rt38Umz67l4idGflSfx7DNkB/7yAD8b/ynRs9o4SOGJsnuaAbShLmcUdT+YVWc8+2zDHggb7SXszY5qnhWJcGKUZ9CFlQgDiwLnE0zUTN9AIgFwj7MxSRRivtNpOPnfxvydnPlPsG1caiREo4HvDbJn1MhjrinJrP0kx8F9Q4E5UsIKgPYkWEe1cyEjaFqxV08tQ6Oz8Cd3tqC8n3BXReYr1kB9CMd2ofddGTiZqQfrponz5ClGiQX4KbmtOEjrm8YzN01rTZ9rCXnWCRyNqv4XeHOA2ftWHhE+vNC+Sf60nFbfRM4RtBtpkKJflD+m/e/xQJKECoUls/8oupCU6QRjTVDtaG4LFUa27lu5v7v0dRjA3/K5/iBwG24uB7pV887uajpcZSPmgk7+jKGYYr5mvgZPl1gDk6jeWf5eIM6jOc//MZXG/JAuRv1pHOTl1Klp/JJiuUc=
# env:
# global:
# - GH=mh-cbon/gump
# - JEKYLL=pietromenna/jekyll-cayman-theme
# - APP=gump
# - EMAIL=mh-cbon@users.noreply.github.com
# - MYAPP=gump
# - MYEMAIL=mh-cbon@users.noreply.github.com
# - secure: V45xPuPzQJFxUslcXFyvjNkpQVnyhtRSZQ6hulFeLuMhdcp8l1Sel6LytJ/w7kbSTGotiPTsJQhGUP+Jz3ouzDpoUb2kMAM2SfwrrvKJo/3hX7EnJ2a/lJYdTpvFbFEgyknRJkYGbaV6HEO9L1pNSr1vfdOYH1Ar1dLONed025bCUGIl7Xme6tFpIYBckPxBAgHQ/BOFVfR2jV9bYrB3gMEbmFBJV3TFge7VNasuPksgHfpskRYVAShoxclB3+9nPhRpW5y8ioIkBKingouy3mq9QUvbgUJxKnYFVW8rEslyDPLnxs4ECNRQSAyr2tbZpc2/l9WzHx0pyho/spKJTuRhwqvVAVbx2C8j4wPGymQORrKOMbHEJaYMsNn6vaW6MMDJwz9dTgrsT3vloV+L/Ajvi/SJjXvFbxgAUTUQcpyXxiIk+U0U/99UQhr1Yx4/RT+rXAE7XYN5SbqgUXaA4rBGRaZ9AgivtAT2bXuXe8rA1VgWZ6PRjSt+hd6WyqVCa8ky7XmNAlbURvkEVO9SNEESI2ZYh+c16vinJRO+wVfR6wGjdes/I57wYW4QD/FEH0o6BTR5eZq5rxoAVu2635GfL33LVNWrNthRpNWFXl0lvks8GdILoTeTSuzcTsDBhd2yox+ubLTYVkZywPAAQMz/H17md5+AdloCc+sFbg0=
before_install:
- sudo add-apt-repository 'deb https://dl.bintray.com/mh-cbon/deb unstable main'
- sudo apt-get -qq update
- sudo apt-get install --allow-unauthenticated changelog go-bin-deb fakeroot
- mkdir -p ${GOPATH}/bin
- cd ~
- curl https://glide.sh/get | sh
install:
- cd $GOPATH/src/github.com/$TRAVIS_REPO_SLUG
- glide install
- go install
script:
- go test -v
- go test config/* -v
- go test stringexec/* -v
# before_deploy:
# - mkdir -p build/{386,amd64}
# - mkdir -p pkg-build/{386,amd64}
# - GOOS=linux GOARCH=386 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/386/$APP gump.go
# - GOOS=linux GOARCH=amd64 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/amd64/$APP gump.go
# - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/create-pkg.sh | GH=$GH sh -xe
# - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-rpm/master/create-pkg.sh | GH=$GH sh -xe
#
# after_deploy:
# - wget -O - https://raw.githubusercontent.com/mh-cbon/gh-pages/master/all.sh | sh -x
# - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/setup-repository.sh | GH=$GH EMAIL=$EMAIL sh -xe
# - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-rpm/master/setup-repository.sh | GH=$GH EMAIL=$EMAIL sh -xe
before_deploy:
- POOL=`echo ${GH_APP} | cut -c 1`
# create the deb package
- cd $GOPATH/src/github.com/$TRAVIS_REPO_SLUG
- mkdir -p build/$OSARCH
- GOOS=linux go build --ldflags "-X main.VERSION=$VERSION" -o build/$OSARCH/$GH_APP gump.go
- go-bin-deb generate --file deb.json -a $OSARCH --version $VERSION -o $GH_APP-$OSARCH-$VERSION.deb
# copy the deb for gh release (backward compatibility)
- cp $GH_APP-$OSARCH-$VERSION.deb $GH_APP-$OKARCH.deb
# upload to bintray
- curl -fL https://getcli.jfrog.io | sh
- ./jfrog bt pc --key=$BTKEY --user=$GH_USER --licenses=MIT --vcs-url=https://github.com/$GH_USER/deb $GH_USER/deb/$GH_APP || echo "package already exists"
- ./jfrog bt upload --override=true --key $BTKEY --publish=true --deb=unstable/main/$OSARCH $GH_APP-$OSARCH-$VERSION.deb $GH_USER/deb/$GH_APP/$VERSION pool/$POOL/$GH_APP/
# create the rpm package
- docker pull fedora
- >
docker run -v $PWD:/mnt/travis fedora /bin/sh -c
"cd /mnt/travis && (curl -s -L https://bintray.com/mh-cbon/rpm/rpm > /etc/yum.repos.d/w.repo) && dnf install go-bin-rpm changelog rpm-build -y --quiet && go-bin-rpm generate --file rpm.json -a $OSARCH --version $VERSION -o $GH_APP-$OSARCH-$VERSION.rpm"
# copy the rpm for gh release (backward compatibility)
- cp $GH_APP-$OSARCH-$VERSION.rpm $GH_APP-$OKARCH.rpm
# upload to bintray
- ./jfrog bt pc --key=$BTKEY --user=$GH_USER --licenses=MIT --vcs-url=https://github.com/$GH_USER/rpm $GH_USER/rpm/$GH_APP || echo "package already exists"
- ./jfrog bt upload --override=true --key $BTKEY --publish=true $GH_APP-$OSARCH-$VERSION.rpm $GH_USER/rpm/$GH_APP/$VERSION pool/$POOL/$GH_APP/
# generate the repo metadata
- curl -X POST -u ${GH_USER}:${BTKEY} https://api.bintray.com/calc_metadata/${GH_USER}/rpm
deploy:
provider: releases
api_key:
secure: LDIJf5MDzbJ0RScFaxWBjyL6h8jZaHhr0ek7HZ4ubUVlvF+amwysMhK9vdgIb/4HTgLUUUFEIALlvstwGFf/LsLBs0OHZM3EPRY7A6/kt9s/aIJB3sfWSXRf+7ta+UrUeVVzKQxdXtTBT+Hba/hOu68A9vPA/v+h3107XkWng289au1RC41ZhrXbmV8PWb4WTYwt1OWhi+tgyULgsl2k8DG8OXRsVi3RMJEihEUXxcLo3R8GR7nBXZFgnxmuX45/9BuDBaFwEkKamCyidmV8CMZSB1EMSo3a+dcwihwdMpY3mvSUmJMurpNJuB0hY1ge8ANmI7kv8VivKRoc0JO8i4+vrArunUoz1LtNHxrvANfDMesvxW1by7N8S9k87Gym82Lm9VMDP1sXVQ4vvMGONayfzBH3A9I7AIhA80H6yfDtxQnwdLTI9hgYNmGGmhXImOSy5cE87CInPgGzc9BvmXnVTirgt7zyQ6Q6xpfxe37o2H/SrpZzvuzBbvmUGjM1DpWcMJTvu7WjkXVJN76hgRYLhLVl4lWVIeXlaUFqXyMoQCOeD38ryjC8+w8Pa0xnqYWM2QAPueVnl/X86IorbB865ZoF7ygp0O5Ujpxb5JZ8aUeGefo5t8+Dc0Y6c1U9LIGNTVsD16Wzn474ETL1vuNI2D19zGWCfCKG8d8cUxY=
file_glob: true
file:
- $GH_APP-$OKARCH.deb
- $GH_APP-$OKARCH.rpm
skip_cleanup: true
on:
tags: true