forked from keybase/kbfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
104 lines (87 loc) · 4.33 KB
/
circle.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
# -----------------------------------------------------------------------------
#
# REMINDER: If you edit this file, you'll most likely also want to edit
# circle.yml in the client repository!
#
# -----------------------------------------------------------------------------
version: 2
jobs:
build:
working_directory: ~/kbfs
parallelism: 1
shell: /bin/bash --login
environment:
GOVERSION: 1.10.3
# TODO: Consider picking a better docker image.
#
# For more information on choosing an image (or alternatively
# using a VM instead of a container) see
# https://circleci.com/docs/2.0/executor-types/ To see the list of
# pre-built images that CircleCI provides for most common
# languages see https://circleci.com/docs/2.0/circleci-images/
docker:
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
steps:
##
## Install prereqs.
##
- run:
name: Update PATH and Define Environment Variable at Runtime
command: |
echo 'export GOPATH=$HOME/go-path' >> $BASH_ENV
echo 'export PATH=$GOROOT/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
# Configure java.
- run: sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/jdk1.8.0" >> $BASH_ENV
# Restore the dependency cache
- restore_cache:
keys:
# This branch if available
- v1-dep-{{ .Branch }}-
# Default branch if not
- v1-dep-master-
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
- v1-dep-
- run: sudo rm -rf /usr/local/go*
- run: mkdir -p ~/downloads ~/go-path
- run: ls "$HOME/downloads"
- run: ls "$ANDROID_HOME"
- run: if [[ ! -e "$HOME/downloads/go.$GOVERSION.tar.gz" ]]; then wget -nv https://storage.googleapis.com/golang/go$GOVERSION.linux-amd64.tar.gz -O $HOME/downloads/go.$GOVERSION.tar.gz ; fi
- run: cd $HOME && tar -xzvf downloads/go.$GOVERSION.tar.gz
- run: sudo mv $HOME/go /usr/local
- run: if ! $(grep -q "Revision=24.4.1" $ANDROID_HOME/tools/source.properties); then echo y | android update sdk -u -a -t "tools"; fi
- run: if [ ! -e $ANDROID_HOME/build-tools/23.0.2 ]; then echo y | android update sdk -u -a -t "build-tools-23.0.2"; fi
# Android Support Repository, revision 35 / Local Maven repository for Support Libraries
- run: if [ ! -d "/usr/local/android-sdk-linux/extras/android/m2repository/com/android/support/design/24.1.0" ]; then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
# Accept android licenses
- run: mkdir -p /usr/local/android-sdk-linux/licenses
- run: if [[ ! -e "$ANDROID_HOME/ndk-bundle" ]]; then wget -nv http:https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip -O android-ndk-r11c-linux-x86_64.zip && unzip -o android-ndk-r11c-linux-x86_64.zip -d "$ANDROID_HOME" && mv "$ANDROID_HOME/android-ndk-r11c" "$ANDROID_HOME/ndk-bundle"; fi
- run: echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk-linux/licenses/android-sdk-license
- run: echo "d56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk-linux/licenses/android-sdk-license
# Clone client.
- run: mkdir -p $GOPATH/src/github.com/keybase
- run: git clone https://github.com/keybase/client.git $HOME/client
- run: ln -s $HOME/client $GOPATH/src/github.com/keybase/client
##
## Build.
##
- checkout
- run: ln -s $HOME/kbfs $GOPATH/src/github.com/keybase/kbfs
- run:
working_directory: ../client/shared
environment:
LOCAL_KBFS: 1
command: ./react-native/gobuild.sh android
- run: ls -la $GOPATH/src/github.com/keybase/client/shared/react-native/android/keybaselib/keybaselib.aar
# Save dependency cache
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/downloads
- /tmp/go-android/bin
- /tmp/go-android/pkg
- /usr/local/android-sdk-linux/tools
- /usr/local/android-sdk-linux/ndk-bundle
- /usr/local/android-sdk-linux/build-tools/23.0.2
- /usr/local/android-sdk-linux/extras/android/m2repository