Skip to content

Commit a7f915a

Browse files
authored
Psiphon travis build pipeline (#40)
* trying build with latest releases of psiphon code * build breaking on docker build * build breaking because of go libs available during build * build breaking because of gomobile is failing * stupid mistake * back to basics * packages not pulled * should new be getting utls dependencies * maybe I was overwriting the gomobile in the psiabdroid image * missing utls dependecies in refraction/psiandroid * go get all refraction-networking dependencies inside of the psiandroid docker image * removed dependence on /android-sdk-linux/tools/bin/sdkmanager which is (unexplainably) missing from the latest psiandroid image build * accepting licenses because sdkmanager IS GONE FOR SOME REASON * Still missing some licenses for unknown reason * accepting license that makes it work locally? * added comments with warnings and uncommented all other build stages to run a full build again. * missed one line
1 parent bec9b78 commit a7f915a

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

.travis.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ _job_template: &_job_template
2121
stage: build
2222
# When Uncommented this will override the defaults set in travis ci web interface.
2323
env:
24-
- PSIPHON_CORE_VERSION=""
25-
- PSIPHON_SYSTEM_VERSION=""
24+
- PSIPHON_CORE_VERSION="tags/v2.0.11"
25+
- PSIPHON_SYSTEM_VERSION="default"
2626
install:
2727
- go get ./...
2828
# Substitute build string
@@ -125,13 +125,23 @@ jobs:
125125
- patch $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/build.gradle build/PsiphonCoreGradle.patch
126126
# Digest this branch's ClientConf into Psiphon's embedded_config
127127
- ./test_scripts/psiphon_digest_cc.sh ./assets/ClientConf $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/embedded_config.go
128+
- go get ./...
128129
script:
129130
# Build Psiphon Android Library ca.psiphon.aar
130-
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src:/go/src refraction/psiandroid /bin/bash -c 'go get ./... && cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash "TAPDANCE"'
131+
# The psiandroid image has a pined version of gomobile --> executing go get ./... will pull over that version of gomobile to the latest version
132+
# 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.
133+
# Since neither of those have dependencies on gomobile we can cd to their directories and pull them as necessary.
134+
- 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:latest /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 -
135+
131136
- mv $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android/ca.psiphon.aar build/
132-
# Build Psiphon Android App PsiphonAndroid-debug.apk
133137
- cp build/ca.psiphon.aar $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/libs/
134-
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android:/go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android refraction/psiandroid /bin/bash -c 'yes | /android-sdk-linux/tools/bin/sdkmanager --update && cd /go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android && ./gradlew assembleDebug'
138+
139+
# Build the Psiphon android app with the core library that we just compiled.
140+
# 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
141+
# interface. So because the android build system in the psiandroid image has not accepted licensing for a few libraries we have to do that
142+
# ourselves in this run command. This also cannot use the `yes` program because that sends the y character too quickly and actually declines
143+
# the license.
144+
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android:/go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android refraction/psiandroid /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; cd /go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android && ./gradlew assembleDebug'
135145
- sudo mv $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/build/outputs/apk/debug/PsiphonAndroid-debug.apk build/PsiphonAndroid-TD-debug.apk
136146

137147
- <<: *_job_template
@@ -154,9 +164,18 @@ jobs:
154164
- ./test_scripts/psiphon_digest_cc.sh ./assets/ClientConf $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/tapdance/embedded_config.go
155165
script:
156166
# Build Psiphon Android Library ca.psiphon.aar
157-
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src:/go/src refraction/psiandroid /bin/bash -c 'go get ./... && cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash "TAPDANCE"'
167+
# The psiandroid image has a pined version of gomobile --> executing go get ./... will pull over that version of gomobile to the latest version
168+
# 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.
169+
# Since neither of those have dependencies on gomobile we can cd to their directories and pull them as necessary.
170+
- 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:latest /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 -
171+
158172
- mv $GOPATH/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android/ca.psiphon.aar build/
159-
# Build Psiphon Android App PsiphonAndroid-debug.apk
160173
- cp build/ca.psiphon.aar $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/libs/
161-
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android:/go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android refraction/psiandroid /bin/bash -c 'yes | /android-sdk-linux/tools/bin/sdkmanager --update && cd /go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android && ./gradlew assembleDebug'
174+
175+
# Build the Psiphon android app with the core library that we just compiled.
176+
# 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
177+
# interface. So because the android build system in the psiandroid image has not accepted licensing for a few libraries we have to do that
178+
# ourselves in this run command. This also cannot use the `yes` program because that sends the y character too quickly and actually declines
179+
# the license.
180+
- docker run -v $TRAVIS_BUILD_DIR:/go/src/github.com/refraction-networking/gotapdance -v $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android:/go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android refraction/psiandroid /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; cd /go/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android && ./gradlew assembleDebug'
162181
- sudo mv $GOPATH/src/bitbucket.org/psiphon/psiphon-circumvention-system/Android/app/build/outputs/apk/debug/PsiphonAndroid-debug.apk build/PsiphonAndroid-CJ-debug.apk

0 commit comments

Comments
 (0)