From 1e2e76eacc15fe8fe43947bb697fb614799dc858 Mon Sep 17 00:00:00 2001 From: Shashank Baghel Date: Wed, 7 Apr 2021 11:51:27 +0530 Subject: [PATCH] build: Switch to alpine linux docker Signed-off-by: Shashank Baghel --- .drone.yml => build.yml | 4 ++-- dronebuild | 12 ++-------- license_accepter.sh | 53 ----------------------------------------- 3 files changed, 4 insertions(+), 65 deletions(-) rename .drone.yml => build.yml (66%) delete mode 100644 license_accepter.sh diff --git a/.drone.yml b/build.yml similarity index 66% rename from .drone.yml rename to build.yml index ef2fefb56..a58264dd1 100644 --- a/.drone.yml +++ b/build.yml @@ -6,7 +6,7 @@ clone: steps: - name: assembleDebug - image: archlinux:latest + image: alvrme/alpine-android-base:latest environment: GITHUB_TOKEN: from_secret: GITHUB_TOKEN @@ -15,5 +15,5 @@ steps: commands: - "export TG_BOT_API" - "export GITHUB_TOKEN" - - pacman -Sy make git gradle zip unzip wget patch ninja curl jdk8-openjdk jre8-openjdk cmake glibc --noconfirm + - apk add bash cmake curl git make ninja - bash dronebuild \ No newline at end of file diff --git a/dronebuild b/dronebuild index c63f10a88..c7ca4a12d 100644 --- a/dronebuild +++ b/dronebuild @@ -1,16 +1,8 @@ #!/bin/bash -ANDROID_SDK_VERSION=6609375 ANDROID_HOME="/opt/android-sdk" -mkdir -p ${ANDROID_HOME}/cmdline-tools -wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip -unzip *tools*linux*.zip -d ${ANDROID_HOME}/cmdline-tools -rm *tools*linux*.zip -cp license_accepter.sh /opt/ -chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh ${ANDROID_HOME} - -bash ${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager --install "ndk;21.0.6113669" +export TZ=Asia/Kolkata DATE="`date +%d%m%Y-%H%M%S`" HEAD_COMMIT="$(git rev-parse HEAD)" @@ -47,4 +39,4 @@ else -d "disable_web_page_preview=true" \ -d "parse_mode=html" \ -d text="❌ Build error, exiting now!" -fi +fi \ No newline at end of file diff --git a/license_accepter.sh b/license_accepter.sh deleted file mode 100644 index 32a59a221..000000000 --- a/license_accepter.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# credits: thyrlian - -check_android_home() { - if [ "$#" -lt 1 ]; then - if [ -z "${ANDROID_HOME}" ]; then - echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter" - exit 1 - else - ANDROID_HOME="${ANDROID_HOME}" - fi - else - ANDROID_HOME=$1 - fi - echo "ANDROID_HOME is at $ANDROID_HOME" -} - -accept_all_android_licenses() { - ANDROID_LICENSES="$ANDROID_HOME/licenses" - if [ ! -d $ANDROID_LICENSES ]; then - echo "Android licenses directory doesn't exist, creating one..." - mkdir -p $ANDROID_LICENSES - fi - - accept_license_of android-googletv-license 601085b94cd77f0b54ff86406957099ebe79c4d6 - accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55 - accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e - accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee - accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd - accept_license_of android-sdk-preview-license 504667f4c0de7af1a06de9f4b1727b84351f2910 - accept_license_of google-gdk-license 33b6a2b64607f11b759f320ef9dff4ae5c47d97a - accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a -} - -accept_license_of() { - local license=$1 - local content=$2 - local file=$ANDROID_LICENSES/$license - if [ -f $file ]; then - if grep -q "^$content$" $file; then - echo "$license: $content has been accepted already" - else - echo "Accepting $license: $content ..." - echo -e $content >> $file - fi - else - echo "Accepting $license: $content ..." - echo -e $content > $file - fi -} - -check_android_home "$@" -accept_all_android_licenses \ No newline at end of file