我在运行Gitlab CI时遇到问题,源代码如下:
image: openjdk:8-jdk
stages:
- build
- test
- package
#####################################################################
# BUILD
#
.build_template: &build_template_def
stage: build
artifacts:
expire_in: 4 hours
paths:
- app/build/outputs/
- .android/
before_script:
# Extract the SDK version that we're building against
- export ANDROID_COMPILE_SDK=`egrep '^[[:blank:]]+compileSdkVersion' app/build.gradle | awk '{print $2}'`
# Explict output for logging purpose only
- echo $ANDROID_SDK_TOOLS
- echo $ANDROID_COMPILE_SDK
# Fetch the specified SDK tools version to build with
- wget --quiet --output-document=/tmp/sdk-tools-linux.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip /tmp/sdk-tools-linux.zip -d .android
# Set up environment variables
- export ANDROID_HOME=$PWD/.android
- export PATH=$PATH:$PWD/.android/platform-tools/
# Install platform tools and Android SDK for the compile target
- echo y | .android/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
- chmod +x ./gradlew
build_debug:
<<: *build_template_def
tags:
- buildtag
only:
- develop
- tags
script:
- ./gradlew assembleDebug
build_release:
<<: *build_template_def
only:
- master
script:
- ./gradlew assembleRelease
即使将标签添加到作业中,也表示卡住了。 还尝试更改: 变量:
ANDROID_COMPILE_SDK:“ 27”
ANDROID_BUILD_TOOLS:“ 27.0.3”
ANDROID_SDK_TOOLS:“ 4333796”
任何遇到此问题的人,尤其是对于android项目。