image:
  name: eclipse-temurin:17-jdk
  
variables:
  SONAR_TOKEN: "${SONAR_TOKEN}"
  SONAR_HOST_URL: "${SONAR_HOST_URL}"
  GIT_DEPTH: 0

sonarqube-check:
  stage: test
  before_script:
    - apt-get update && apt-get install -y curl unzip
    # - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
    # - unzip sonar-scanner.zip
    # - mv sonar-scanner-* sonar-scanner
    # - export PATH="$PWD/sonar-scanner/bin:$PATH"
  script:
    - >
      sonar-scanner -X
      -Dsonar.host.url=$SONAR_HOST_URL
      -Dsonar.token=$SONAR_TOKEN
      -Dsonar.projectKey=laura_geller_scraping
      -Dsonar.projectName=laura_geller_scraping
      -Dsonar.sources=.
      -Dsonar.qualitygate.wait=true
      -Dsonar.gitlab.max_major_issues_gate=0
  allow_failure: false
  tags:
    - linux
  only:
    - merge_requests
    - main
    - push
