mirror of
https://github.com/izzy2lost/docker-android.git
synced 2026-06-19 01:16:28 -07:00
Removed arm image
This commit is contained in:
+37
-101
@@ -16,15 +16,9 @@ else
|
||||
fi
|
||||
|
||||
if [ -z "$3" ]; then
|
||||
read -p "Processor type (x86|arm|all): " PROCESSOR
|
||||
else
|
||||
PROCESSOR=$3
|
||||
fi
|
||||
|
||||
if [ -z "$4" ]; then
|
||||
read -p "Release version: " RELEASE
|
||||
else
|
||||
RELEASE=$4
|
||||
RELEASE=$3
|
||||
fi
|
||||
|
||||
declare -A list_of_levels=(
|
||||
@@ -37,11 +31,6 @@ declare -A list_of_levels=(
|
||||
[8.1]=27
|
||||
)
|
||||
|
||||
declare -A list_of_processors=(
|
||||
[arm]=armeabi-v7a
|
||||
[x86]=x86
|
||||
)
|
||||
|
||||
function get_android_versions() {
|
||||
versions=()
|
||||
|
||||
@@ -66,39 +55,15 @@ function get_android_versions() {
|
||||
echo "Android versions: ${versions[@]}"
|
||||
}
|
||||
|
||||
function get_processors() {
|
||||
processors=()
|
||||
|
||||
if [ "$PROCESSOR" == "all" ]; then
|
||||
for key in "${!list_of_processors[@]}"; do
|
||||
processors+=($key)
|
||||
done
|
||||
else
|
||||
for key in "${!list_of_processors[@]}"; do
|
||||
if [[ $key == *"$PROCESSOR"* ]]; then
|
||||
processors+=($key)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# If version cannot be found in the list
|
||||
if [ -z "$processors" ]; then
|
||||
echo "Invalid processor \"$PROCESSOR\"! Valid options: x86, arm"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Processors: ${processors[@]}"
|
||||
}
|
||||
|
||||
get_android_versions
|
||||
get_processors
|
||||
processors=x86
|
||||
|
||||
function test() {
|
||||
# Prepare needed parameter to run tests
|
||||
test_android_version=7.1.1
|
||||
test_api_level=25
|
||||
test_processor=x86
|
||||
test_sys_img=x86_64
|
||||
test_sys_img=$test_processor
|
||||
test_img_type=google_apis
|
||||
test_browser=chrome
|
||||
test_image=test_img
|
||||
@@ -154,75 +119,46 @@ function build() {
|
||||
# Remove pyc files
|
||||
find . -name "*.pyc" -exec rm -f {} \;
|
||||
|
||||
# Build docker image(s)
|
||||
for p in "${processors[@]}"; do
|
||||
if [ "$p" == "x86" ]; then
|
||||
FILE_NAME=docker/Emulator_x86
|
||||
else
|
||||
FILE_NAME=docker/Emulator_arm
|
||||
fi
|
||||
# Build docker image
|
||||
FILE_NAME=docker/Emulator_x86
|
||||
|
||||
for v in "${versions[@]}"; do
|
||||
# Find image type and default web browser
|
||||
if [ "$v" == "5.0.1" ] || [ "$v" == "5.1.1" ]; then
|
||||
IMG_TYPE=default
|
||||
BROWSER=browser
|
||||
elif [ "$v" == "6.0" ]; then
|
||||
# It is because there is no ARM EABI v7a System Image for 6.0
|
||||
IMG_TYPE=google_apis
|
||||
BROWSER=browser
|
||||
elif [[ "${list_of_levels[$v]}" -ge "24" && "$p" == "x86" ]]; then
|
||||
IMG_TYPE=google_apis_playstore
|
||||
BROWSER=chrome
|
||||
else
|
||||
IMG_TYPE=google_apis
|
||||
BROWSER=chrome
|
||||
fi
|
||||
echo "[BUILD] IMAGE TYPE: $IMG_TYPE"
|
||||
level=${list_of_levels[$v]}
|
||||
echo "[BUILD] API Level: $level"
|
||||
sys_img=${list_of_processors[$p]}
|
||||
echo "[BUILD] System Image: $sys_img"
|
||||
image_version="$IMAGE-$p-$v:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v:latest"
|
||||
if [[ "${list_of_levels[$v]}" -ge "24" && "$p" == "x86" ]]; then
|
||||
image_version="$IMAGE-$p-$v-playstore:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v-playstore:latest"
|
||||
fi
|
||||
if [[ "${list_of_levels[$v]}" -ge "26" && "$p" == "arm" ]]; then
|
||||
echo "System image $p for $v not supported"
|
||||
echo "Skip building!"
|
||||
else
|
||||
echo "[BUILD] Image name: $image_version and $image_latest"
|
||||
echo "[BUILD] Dockerfile: $FILE_NAME"
|
||||
docker build -t $image_version --build-arg ANDROID_VERSION=$v --build-arg API_LEVEL=$level \
|
||||
--build-arg PROCESSOR=$p --build-arg SYS_IMG=$sys_img --build-arg IMG_TYPE=$IMG_TYPE \
|
||||
--build-arg BROWSER=$BROWSER -f $FILE_NAME .
|
||||
docker tag $image_version $image_latest
|
||||
fi
|
||||
done
|
||||
for v in "${versions[@]}"; do
|
||||
# Find image type and default web browser
|
||||
if [ "$v" == "5.0.1" ] || [ "$v" == "5.1.1" ]; then
|
||||
IMG_TYPE=default
|
||||
BROWSER=browser
|
||||
elif [ "$v" == "6.0" ]; then
|
||||
# It is because there is no ARM EABI v7a System Image for 6.0
|
||||
IMG_TYPE=google_apis
|
||||
BROWSER=browser
|
||||
else
|
||||
IMG_TYPE=google_apis_playstore
|
||||
BROWSER=chrome
|
||||
fi
|
||||
echo "[BUILD] IMAGE TYPE: $IMG_TYPE"
|
||||
level=${list_of_levels[$v]}
|
||||
echo "[BUILD] API Level: $level"
|
||||
sys_img=$processors
|
||||
echo "[BUILD] System Image: $sys_img"
|
||||
image_version="$IMAGE-$p-$v:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v:latest"
|
||||
echo "[BUILD] Image name: $image_version and $image_latest"
|
||||
echo "[BUILD] Dockerfile: $FILE_NAME"
|
||||
docker build -t $image_version --build-arg ANDROID_VERSION=$v --build-arg API_LEVEL=$level \
|
||||
--build-arg PROCESSOR=$p --build-arg SYS_IMG=$sys_img --build-arg IMG_TYPE=$IMG_TYPE \
|
||||
--build-arg BROWSER=$BROWSER -f $FILE_NAME .
|
||||
docker tag $image_version $image_latest
|
||||
done
|
||||
}
|
||||
|
||||
function push() {
|
||||
# Push docker image(s)
|
||||
for p in "${processors[@]}"; do
|
||||
for v in "${versions[@]}"; do
|
||||
image_version="$IMAGE-$p-$v:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v:latest"
|
||||
if [[ "${list_of_levels[$v]}" -ge "24" && "$p" == "x86" ]]; then
|
||||
image_version="$IMAGE-$p-$v-playstore:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v-playstore:latest"
|
||||
fi
|
||||
if [[ "${list_of_levels[$v]}" -ge "26" && "$p" == "arm" ]]; then
|
||||
echo "docker image $image_version and $image_latest not existed"
|
||||
echo "Skip pushing!"
|
||||
else
|
||||
echo "[PUSH] Image name: $image_version and $image_latest"
|
||||
docker push $image_version
|
||||
docker push $image_latest
|
||||
fi
|
||||
done
|
||||
for v in "${versions[@]}"; do
|
||||
image_version="$IMAGE-$p-$v:$RELEASE"
|
||||
image_latest="$IMAGE-$p-$v:latest"
|
||||
echo "[PUSH] Image name: $image_version and $image_latest"
|
||||
docker push $image_version
|
||||
docker push $image_latest
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user