-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·28 lines (22 loc) · 1.06 KB
/
build.sh
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
#!/usr/bin/env bash
set -eu -o pipefail
pushd ../base && source ./setup.sh && popd
container_name="android-rebuilds-ndk"
VERSION='r23'
docker create --name ${container_name} --workdir /home/build/wd --entrypoint "tail" android-rebuilds:base "-f" "/dev/null"
docker start "${container_name}"
# Run build script
docker cp docker-build.sh "${container_name}":/home/build/wd/docker-build.sh
docker exec --user build "${container_name}" bash -c "/home/build/wd/docker-build.sh"
# copy output
docker cp "${container_name}":/home/build/wd/out/dist/android-ndk-0-linux-x86_64.zip android-ndk-${VERSION}-linux-x86_64.zip
docker cp "${container_name}":/home/build/wd/out/dist/android-ndk-0-windows-x86_64.zip android-ndk-${VERSION}-windows-x86_64.zip
# shutdown and remove container
if docker ps --format '{{.Names}}' | grep -w "${container_name}" &> /dev/null; then
echo "Stopping container"
docker stop "${container_name}"
fi
if docker ps --all --format '{{.Names}}' | grep -w "${container_name}" &> /dev/null; then
echo "Removing container"
docker rm "${container_name}"
fi