Skip to content

Instantly share code, notes, and snippets.

@mikkipastel
Last active September 8, 2017 08:29
Show Gist options
  • Save mikkipastel/b430281f38002d01c8d3ef7ab2f7f574 to your computer and use it in GitHub Desktop.
Save mikkipastel/b430281f38002d01c8d3ef7ab2f7f574 to your computer and use it in GitHub Desktop.
ci file is gitlab for android studio beta application test in fabric
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "25"
ANDROID_BUILD_TOOLS: "25.0.2"
ANDROID_SDK_TOOLS: "25.2.5"
before_script:
# installing packages
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
# installing Android SDK
- wget --quiet --output-document=android-sdk-tools.zip https://dl.google.com/android/repository/tools_r${ANDROID_SDK_TOOLS}-linux.zip
- mkdir -p android-sdk-linux
- unzip android-sdk-tools.zip -d android-sdk-linux
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter android-${ANDROID_COMPILE_SDK}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter platform-tools
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter build-tools-${ANDROID_BUILD_TOOLS}
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-android-m2repository
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-google_play_services
- echo y | android-sdk-linux/tools/android --silent update sdk --no-ui --all --filter extra-google-m2repository
- pwd
- echo $PWD
# setup environment
- export ANDROID_HOME=$PWD/android-sdk-linux
- echo $ANDROID_HOME
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- echo $PATH
- chmod +x ./gradlew
# add license accpetion
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
cache:
paths:
- .gradle/wrapper
- .gradle/caches
build:
stage: build
script:
- ./gradlew assembleDebug
test:
stage: test
script:
- ./gradlew test
deploy:
stage: deploy
script:
- ./gradlew assembleDebug crashlyticsUploadDistributionDebug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment