definitions:
  services:
    docker:
      memory: 3072 # Allocate 3GB (3072MB) of memory to Docker service
  steps:
    - step: &build-step
        name: SonarQube analysis
        script:
          - pipe: sonarsource/sonarqube-scan:3.0.2
            variables:
              SONAR_HOST_URL: ${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
              SONAR_TOKEN: ${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
              EXTRA_ARGS: "-Dsonar.scanner.forceEmbeddedJava=true"
  caches:
    sonar: ~/.sonar

clone:
  depth: full

pipelines:
  branches:
    '{master}':
      - step: *build-step

