before_script: - apt-get update -qq && apt-get install -y -qq git sonarqube_master_job: stage: test only: - master script: - ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASS sonarqube_preview_feature_job: stage: test only: - /^feature\/*/ script: - git checkout origin/master - git merge $CI_COMMIT_SHA --no-commit --no-ff - ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASS -Dsonar.analysis.mode=preview -Dsonar.gitlab.commit_sha=$CI_BUILD_REF -Dsonar.gitlab.ref=$CI_BUILD_REF_NAME -Dsonar.gitab.project_id=$CI_PROJECT_ID