-
Notifications
You must be signed in to change notification settings - Fork 17
/
.travis.yml
194 lines (171 loc) · 13.7 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
language: go
go:
- "1.x"
os: linux
sudo: required
dist: bionic
services:
- docker
addons:
artifacts: true
notifications:
slack:
secure: ZzIEqFE4XRdE9U2p3aeE32DMtoC8RgjoEavhEQ1oLrWFgUpLktqmp9UVY/U+W6iElilLpDbFpry51+Sv9MWpxJMxr+Q/JJuq/3Bj5KjF/wEtil7qvBYhQ1sM/qUQFG6wRkrMNjZGMiaTmnkWF0rZB8lf7+nbnGFaPW3AVVbD+8gVDWTHI4Hcvvgs0UbrJzoPfpvH0dprOchswc1BBKTgo5c44rvS2fquEMVcqMMiNJ5JQqphuRWLTfzLgOzImSf0/xJJyVp/YTkSnVSg8BcWmDCJ4iB9fJkVyZM9WxcgY/J4T5VzFxfMah9zv2j8UTfzHSMeCJDRL647hdnkmr/Qum/LN91Ey2DJw5KUH743CsAbyGhQML6wZ3NCeEP06hnMDphalU5+BYhtAPyc5CB84g6eLIUQ2EqptuPZpjFQohFnapCTnfB5XKTcW+PjxJsoJzk8x+85Xid+H1nnNxeyf10tLv6Pwy4ZGmEEbsa4SYWXibpIEu3fPJXEdtrht0vM40pDLeUYL6Axmh7hNjmDQOXJG41saF+Rk4AArRhKhMQTmlYCc0e1H2/hIDXUMPbqjHeCpEkaA5W8BFBKynhlJa0JX+rtHDFaK82Di8rXT0NO2ACyG8ZQqk87qePyBYPyfR8hRwhrkmQHlYYOZzV6LBz+ynJuWl9ktcC2irJlHZs=
email:
if: branch IN (master, conjure)
on_success: never
on_failure: always
recipients:
- jack.wampler@colorao.edu
# Reuse the steps from build for vendoring changes (any redefined key-values with be overwritten)
_job_template: &_job_template
stage: build
# When Uncommented this will override the defaults set in travis ci web interface.
env:
- PSIPHON_CORE_VERSION="staging-client"
- PSIPHON_ANDROID_VERSION="master"
install:
- go get ./...
# Substitute build string
- sed -i.bak -e "s#buildInfo = \"\"#buildInfo = \"$TRAVIS_BRANCH-$TRAVIS_COMMIT\"#g" tapdance/logger.go
- mkdir -p $GOPATH/src/github.com/Psiphon-Labs
# Get Specific Psiphon Core Library Release
- git clone https://github.com/Psiphon-Labs/psiphon-tunnel-core.git $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && git checkout $PSIPHON_CORE_VERSION)
# - (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && git checkout $PSIPHON_CORE_VERSION -b build-refraction-networking)
# Remove gotapdance from vendored packages (it will look in GOPATH if after vendor directory)
- go get github.com/kardianos/govendor
- (cd $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core && govendor remove github.com/refraction-networking/gotapdance/...)
# Enable TapDance logging
- sed -i.bak -e 's#refraction_networking_tapdance.Logger().Out = ioutil.Discard##g' $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/refraction/refraction.go
after_success:
# Upload built binaries to S3
- sudo pip install awscli
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then aws s3 sync build s3://$ARTIFACTS_BUCKET/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/ --region us-west-1; fi
stages:
test
build
## Build job for Psiphon ConsoleClient and Android App
# Go versions: first value in array
jobs:
include:
- stage: test
name: "Validation tests Go 1.15.X"
go:
- "1.15.x"
install:
- go get -t ./...
- go get golang.org/x/lint/golint
- go get github.com/alecthomas/gometalinter
script:
- go test -race -v ./tapdance
- go test -race -v ./tdproxy
- gometalinter --install
- gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E deadcode --tests ./tapdance
- stage: test
name: "Validation tests Go 1.X"
go:
- "1.x"
install:
- go get -t ./...
- go get golang.org/x/lint/golint
- go get github.com/alecthomas/gometalinter
script:
- go test -race -v ./tapdance
- go test -race -v ./tdproxy
- gometalinter --install
- gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E deadcode --tests ./tapdance
- <<: *_job_template # YAML anchor/alias
name: "Build cli and Psiphon ConsoleClient on Linux"
before_script:
# Add the Current ClientConf and roots to the build folder for Psiphon's ConsoleClient
- cp assets/ClientConf build/tapdance/ClientConf
- cp assets/roots build/tapdance
script:
# Build cli
- go build -o build/cli-$TRAVIS_OS_NAME ./cli
# Build Tapdance ConsolClient
- go build -a -v -race -o build/ConsoleClient-td-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
# # Add dialer params for Conjure and re-build the ConsoleClient (TODO??)
# - patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/conjure.java.patch
- go build -a -v -race -o build/ConsoleClient-cj-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
- <<: *_job_template # Same build on OS X
name: "Build cli and Psiphon ConsoleClient on OS X"
os: osx
before_script:
# Add the Current ClientConf and roots to the build folder for Psiphon's ConsoleClient
- cp assets/ClientConf build/tapdance/ClientConf
- cp assets/roots build/tapdance
script:
# Build cli
- go build -o build/cli-$TRAVIS_OS_NAME ./cli
# Build Tapdance ConsolClient
- go build -a -v -race -o build/ConsoleClient-td-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
# # Add dialer params for Conjure and re-build the ConsoleClient (TODO??)
# - patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/conjure.java.patch
- go build -a -v -race -o build/ConsoleClient-cj-$TRAVIS_OS_NAME -tags 'TAPDANCE' github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
- <<: *_job_template
name: "Build Psiphon Android Library and App for Tapdance"
before_script:
# Get Android build environment
- docker pull refraction/psiandroid:v2.0.12
- mkdir -p $GOPATH/src/github.com/Psiphon-Inc/
- git clone https://github.com/Psiphon-Inc/psiphon-android $GOPATH/src/github.com/Psiphon-Inc/psiphon-android
- (cd $GOPATH/src/github.com/Psiphon-Inc/psiphon-android && git checkout $PSIPHON_ANDROID_VERSION)
# Use modified EmbeddedValues.java for TapDance
- openssl enc -nosalt -aes-256-cbc -md sha512 -pbkdf2 -iter 1000 -pass pass:$aes_cbc_passwd -d -in build/EmbeddedValues.java.enc -out $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/src/main/java/com/psiphon3/psiphonlibrary/EmbeddedValues.java
# Patched tunneling protocol to use TapDance
- patch $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/TunnelManager.tapdance.java.patch
# Patch the Psiphon app's gradle build for java 1.8 compatibility [TODO]{priority:later} remove this when psiphon merges it themselves
- patch $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/build.gradle build/PsiphonCoreGradle.patch
# Digest this branch's ClientConf into Psiphon's embedded_config
- ./test_scripts/psiphon_digest_cc.sh ./assets/ClientConf $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/refraction/embedded_config.go
- go get ./...
script:
# Build Psiphon Android Library ca.psiphon.aar
# The psiandroid image has a pined version of gomobile --> executing go get ./... will pull over that version of gomobile to the latest version
# this will break your build if not done carefully. At the same time we need to go get all of the dependencies for gotapdance and utls.
# Since neither of those have dependencies on gomobile we can cd to their directories and pull them as necessary.
- docker run --rm -v $GOPATH//src/github.com/Psiphon-Labs/psiphon-tunnel-core:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance refraction/psiandroid:v2.0.12 /bin/bash -c 'cd $GOPATH/src/github.com/refraction-networking/gotapdance && go get ./...;cd $GOPATH/src/github.com/refraction-networking/utls && go get ./...; cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash "TAPDANCE"'; cd -
- mv $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android/ca.psiphon.aar build/
- cp build/ca.psiphon.aar $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/libs/
# Build the Psiphon android app with the core library that we just compiled.
# This (at time of writing this comment) used android sdk 24.4.1 which has recently changed from using sdkmanager to using a purely android cli
# interface. So because the android build system in the psiandroid image has not accepted licensing for a few libraries we have to do that
# ourselves in this run command. This also cannot use the `yes` program because that sends the y character too quickly and actually declines
# the license.
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/github.com/Psiphon-Inc/psiphon-android:/go/src/github.com/Psiphon-Inc/psiphon-android refraction/psiandroid:v2.0.12 /bin/bash -c '(while true; do echo 'y'; sleep 2; done) | /android-sdk-linux/tools/android update sdk --no-ui --all --filter build-tools-27.0.3,build-tools-28.0.3,build-tools-29.0.3; cd /go/src/github.com/Psiphon-Inc/psiphon-android && ./gradlew assembleDebug'
- sudo mv $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/build/outputs/apk/debug/PsiphonAndroid-debug.apk build/PsiphonAndroid-TD-debug.apk
- <<: *_job_template
name: "Build Psiphon Android Library and App for Conjure"
before_script:
# Get Android build environment
- docker pull refraction/psiandroid:v2.0.12
- mkdir -p $GOPATH/src/github.com/Psiphon-Inc/
- git clone https://github.com/Psiphon-Inc/psiphon-android $GOPATH/src/github.com/Psiphon-Inc/psiphon-android
- (cd $GOPATH/src/github.com/Psiphon-Inc/psiphon-android && git checkout $PSIPHON_ANDROID_VERSION)
# Use modified EmbeddedValues.java for TapDance
- openssl enc -nosalt -aes-256-cbc -md sha512 -pbkdf2 -iter 1000 -pass pass:$aes_cbc_passwd -d -in build/EmbeddedValues.java.enc -out $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/src/main/java/com/psiphon3/psiphonlibrary/EmbeddedValues.java
# Patched tunneling protocol to use Conjure-ossh
- patch $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java build/TunnelManager.conjure.java.patch
# Patch the Psiphon app's gradle build for java 1.8 compatibility [TODO]{priority:later} remove this when psiphon merges it themselves
- patch $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/build.gradle build/PsiphonCoreGradle.patch
## Add dialer options to customize dialer Params for Conjure (TODO??)
# - patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/src/main/java/com/psiphon3/psiphonlibrary/TunnelManager.java.orig > build/conjure.java.patch build/conjure.java.patch
# Digest this branch's ClientConf into Psiphon's embedded_config
- ./test_scripts/psiphon_digest_cc.sh ./assets/ClientConf $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/refraction/embedded_config.go
script:
# Build Psiphon Android Library ca.psiphon.aar
# The psiandroid image has a pined version of gomobile --> executing go get ./... will pull over that version of gomobile to the latest version
# this will break your build if not done carefully. At the same time we need to go get all of the dependencies for gotapdance and utls.
# Since neither of those have dependencies on gomobile we can cd to their directories and pull them as necessary.
- docker run --rm -v $GOPATH//src/github.com/Psiphon-Labs/psiphon-tunnel-core:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance refraction/psiandroid:v2.0.12 /bin/bash -c 'cd $GOPATH/src/github.com/refraction-networking/gotapdance && go get ./...;cd $GOPATH/src/github.com/refraction-networking/utls && go get ./...; cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash "TAPDANCE"'; cd -
- mv $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android/ca.psiphon.aar build/
- cp build/ca.psiphon.aar $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/libs/
# Build the Psiphon android app with the core library that we just compiled.
# This (at time of writing this comment) used android sdk 24.4.1 which has recently changed from using sdkmanager to using a purely android cli
# interface. So because the android build system in the psiandroid image has not accepted licensing for a few libraries we have to do that
# ourselves in this run command. This also cannot use the `yes` program because that sends the y character too quickly and actually declines
# the license.
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/github.com/Psiphon-Inc/psiphon-android:/go/src/github.com/Psiphon-Inc/psiphon-android refraction/psiandroid:v2.0.12 /bin/bash -c '(while true; do echo 'y'; sleep 2; done) | /android-sdk-linux/tools/android update sdk --no-ui --all --filter build-tools-27.0.3,build-tools-28.0.3,build-tools-29.0.3; cd /go/src/github.com/Psiphon-Inc/psiphon-android && ./gradlew assembleDebug'
- sudo mv $GOPATH/src/github.com/Psiphon-Inc/psiphon-android/app/build/outputs/apk/debug/PsiphonAndroid-debug.apk build//PsiphonAndroid-CJ-debug.apk