Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit d9895f6

Browse files
committed
Add an android slave
1 parent a039126 commit d9895f6

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

slaves/android/Dockerfile

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
FROM ubuntu:14.04
2+
3+
RUN dpkg --add-architecture i386
4+
RUN apt-get -y update
5+
RUN apt-get -y install --force-yes \
6+
curl make git expect libncurses5:i386 libstdc++6:i386 zlib1g:i386 \
7+
python-dev python-pip stunnel \
8+
g++-multilib openjdk-6-jre
9+
10+
# Install buildbot and prep it to run
11+
RUN pip install buildbot-slave
12+
RUN groupadd -r rustbuild && useradd -r -g rustbuild rustbuild
13+
RUN mkdir /buildslave && chown rustbuild:rustbuild /buildslave
14+
15+
# Setup PATH to allow running android tools.
16+
ENV PATH=$PATH:/android/ndk-arm/bin:/android/ndk-aarch64/bin:/android/ndk-x86:/android/sdk/tools:/android/sdk/platform-tools
17+
18+
WORKDIR /build
19+
20+
# Prep the Android NDK
21+
#
22+
# See https://github.com/servo/servo/wiki/Building-for-Android
23+
RUN curl -O http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
24+
RUN chmod +x android-ndk-r10e-linux-x86_64.bin
25+
RUN ./android-ndk-r10e-linux-x86_64.bin
26+
RUN bash android-ndk-r10e/build/tools/make-standalone-toolchain.sh \
27+
--platform=android-18 \
28+
--toolchain=arm-linux-androideabi-4.8 \
29+
--install-dir=/android/ndk-arm \
30+
--ndk-dir=/build/android-ndk-r10e \
31+
--arch=arm
32+
RUN bash android-ndk-r10e/build/tools/make-standalone-toolchain.sh \
33+
--platform=android-21 \
34+
--toolchain=aarch64-linux-android-4.9 \
35+
--install-dir=/android/ndk-aarch64 \
36+
--ndk-dir=/build/android-ndk-r10e \
37+
--arch=arm64
38+
RUN bash android-ndk-r10e/build/tools/make-standalone-toolchain.sh \
39+
--platform=android-18 \
40+
--toolchain=x86-4.9 \
41+
--install-dir=/android/ndk-x86 \
42+
--ndk-dir=/build/android-ndk-r10e \
43+
--arch=x86
44+
RUN bash android-ndk-r10e/build/tools/make-standalone-toolchain.sh \
45+
--platform=android-21 \
46+
--toolchain=x86_64-4.9 \
47+
--install-dir=/android/ndk-x86_64 \
48+
--ndk-dir=/build/android-ndk-r10e \
49+
--arch=x86_64
50+
51+
# Prep the SDK and emulator
52+
#
53+
# Note that the update process requires that we accept a bunch of licenses, and
54+
# we can't just pipe `yes` into it for some reason, so we take the same strategy
55+
# located in https://github.com/appunite/docker by just wrapping it in a script
56+
# which apparently magically accepts the licenses.
57+
RUN curl -O http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz
58+
RUN tar xf android-sdk_r24.3.4-linux.tgz
59+
COPY android/android-accept-licenses.sh /build/android-accept-licenses.sh
60+
RUN mv android-sdk-linux /android/sdk
61+
RUN ["./android-accept-licenses.sh", \
62+
"android - update sdk -a --no-ui --filter platform-tools,android-18,android-21,sys-img-x86-android-18,sys-img-x86_64-android-21,sys-img-armeabi-v7a-android-18"]
63+
RUN echo "no" | android create avd \
64+
--name arm-18 \
65+
--target android-18 \
66+
--abi armeabi-v7a
67+
RUN echo "no" | android create avd \
68+
--name x86-18 \
69+
--target android-18 \
70+
--abi x86
71+
RUN echo "no" | android create avd \
72+
--name x86_64-21 \
73+
--target android-21 \
74+
--abi x86_64
75+
76+
# When running this container, startup buildbot
77+
WORKDIR /buildslave
78+
RUN rm -rf /build
79+
USER rustbuild
80+
COPY start-docker-slave.sh start-docker-slave.sh
81+
ENTRYPOINT ["sh", "start-docker-slave.sh"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/expect -f
2+
3+
set timeout 1800
4+
set cmd [lindex $argv 0]
5+
set licenses [lindex $argv 1]
6+
7+
spawn {*}$cmd
8+
expect {
9+
"Do you accept the license '*'*" {
10+
exp_send "y\r"
11+
exp_continue
12+
}
13+
eof
14+
}

0 commit comments

Comments
 (0)