Using latest build-tool (25.0.2)

This commit is contained in:
butomo1989 2017-03-28 12:31:14 +02:00
parent 5934899793
commit c1f5730a33
2 changed files with 21 additions and 34 deletions

View file

@ -2,6 +2,7 @@
# Bash version should >= 4 to be able to run this script. # Bash version should >= 4 to be able to run this script.
IMAGE="butomo1989/docker-android" IMAGE="butomo1989/docker-android"
LATEST_BUILD_TOOL=25.0.2
if [ -z "$1" ]; then if [ -z "$1" ]; then
read -p "Environment (test|build|push|all) : " TASK read -p "Environment (test|build|push|all) : " TASK
@ -21,17 +22,16 @@ else
PROCESSOR=$3 PROCESSOR=$3
fi fi
function build_tool() { function api_level() {
declare -A build_tools=( declare -A levels=(
[5.0.1]=21.1.2 [5.0.1]=21
[5.1.1]=22.0.1 [5.1.1]=22
[6.0]=23.0.3 [6.0]=23
[7.0]=24.0.3 [7.0]=24
[7.1.1]=25.0.2 [7.1.1]=25
) )
# TODO: Need to be sorted for key in "${!levels[@]}"; do
for key in "${!build_tools[@]}"; do
if [[ $key == *"$GIVEN_VERSION"* ]]; then if [[ $key == *"$GIVEN_VERSION"* ]]; then
version=$key version=$key
fi fi
@ -44,19 +44,6 @@ function build_tool() {
fi fi
echo "Android version: $version" echo "Android version: $version"
build_tools=${build_tools[$version]}
echo "Build tool: $build_tools"
}
function api_level() {
declare -A levels=(
[5.0.1]=21
[5.1.1]=22
[6.0]=23
[7.0]=24
[7.1.1]=25
)
level=${levels[$version]} level=${levels[$version]}
echo "Api level: $level" echo "Api level: $level"
} }
@ -79,12 +66,12 @@ function system_image() {
} }
function init() { function init() {
build_tool
api_level api_level
system_image system_image
} }
init init
echo "Build tool: $build_tool"
IMAGE_NAME="$IMAGE-$PROCESSOR-$version" IMAGE_NAME="$IMAGE-$PROCESSOR-$version"
echo "Image tag: $TAG" echo "Image tag: $TAG"
@ -97,7 +84,7 @@ function build() {
# Remove pyc files # Remove pyc files
find . -name "*.pyc" -exec rm -f {} \; find . -name "*.pyc" -exec rm -f {} \;
docker build -t $IMAGE_NAME --build-arg ANDROID_VERSION=$version --build-arg BUILD_TOOL=$$build_tools \ docker build -t $IMAGE_NAME --build-arg ANDROID_VERSION=$version --build-arg BUILD_TOOL=$LATEST_BUILD_TOOL \
--build-arg API_LEVEL=$level --build-arg PROCESSOR=$PROCESSOR --build-arg SYS_IMG=$sys_img . --build-arg API_LEVEL=$level --build-arg PROCESSOR=$PROCESSOR --build-arg SYS_IMG=$sys_img .
} }

View file

@ -5,26 +5,26 @@ childlogdir=%(ENV_LOG_PATH)s
[program:xvfb] [program:xvfb]
command=/usr/bin/Xvfb %(ENV_DISPLAY)s -screen %(ENV_SCREEN)s %(ENV_SCREEN_WIDTH)sx%(ENV_SCREEN_HEIGHT)sx%(ENV_SCREEN_DEPTH)s command=/usr/bin/Xvfb %(ENV_DISPLAY)s -screen %(ENV_SCREEN)s %(ENV_SCREEN_WIDTH)sx%(ENV_SCREEN_HEIGHT)sx%(ENV_SCREEN_DEPTH)s
stdout_logfile=%(ENV_LOG_PATH)s/xvfb.log stdout_logfile=%(ENV_LOG_PATH)s/xvfb.stdout.log
redirect_stderr=true stderr_logfile=%(ENV_LOG_PATH)s/xvfb.stderr.log
[program:openbox] [program:openbox]
command=/usr/bin/openbox-session command=/usr/bin/openbox-session
stdout_logfile=%(ENV_LOG_PATH)s/openbox.log stdout_logfile=%(ENV_LOG_PATH)s/openbox.stdout.log
redirect_stderr=true stderr_logfile=%(ENV_LOG_PATH)s/openbox.stderr.log
[program:x11vnc] [program:x11vnc]
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -nopw -ncache 10 -forever command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -nopw -ncache 10 -forever
stdout_logfile=%(ENV_LOG_PATH)s/x11vnc.log stdout_logfile=%(ENV_LOG_PATH)s/x11vnc.stdout.log
redirect_stderr=true stderr_logfile=%(ENV_LOG_PATH)s/x11vnc.stderr.log
[program:novnc] [program:novnc]
command=./noVNC/utils/launch.sh --vnc localhost:%(ENV_LOCAL_PORT)s --listen %(ENV_TARGET_PORT)s command=./noVNC/utils/launch.sh --vnc localhost:%(ENV_LOCAL_PORT)s --listen %(ENV_TARGET_PORT)s
stdout_logfile=%(ENV_LOG_PATH)s/novnc.log stdout_logfile=%(ENV_LOG_PATH)s/novnc.stdout.log
redirect_stderr=true stderr_logfile=%(ENV_LOG_PATH)s/novnc.stderr.log
[program:docker-appium] [program:docker-appium]
command=python3 -m src.app command=python3 -m src.app
autorestart=false autorestart=false
stdout_logfile=%(ENV_LOG_PATH)s/docker-appium.log stdout_logfile=%(ENV_LOG_PATH)s/docker-appium.stdout.log
redirect_stderr=true stderr_logfile=%(ENV_LOG_PATH)s/docker-appium.stderr.log