Skip to content
Snippets Groups Projects

Android example of .gitlab-ci.yml

Standard Android app with SonarQube analysis

  • One 'Analysis' stage with one job.
  • The job SonarQube is executed only in the branch develop.
stages:
  - Analysis

variables:
 GRADLE_USER_HOME: ${CI_PROJECT_DIR}/gradle_home

before_script:
  - ./gradlew dependencies
  - for d in /opt/android-sdk-linux/build-tools/*; do PATH="$PATH:$d"; done

SonarQube:
  stage: Analysis
  image: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:android
  tags:
    - docker
  only:
    - develop
  cache:
    paths:
      - gradle_home
  script:
    - ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.login=$SONAR_TOKEN