kind: pipeline
ttype: docker
name: ShakeAndCraft

trigger:
    event:
        - push

steps:
    - name: Install unzip
      image: alpine
      commands:
        - apk add --no-cache unzip
    - name: build
      image: gradle:jdk11
      commands:
        - wget -q "https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip" -O android-sdk.zip
        - unzip -q android-sdk.zip -d $HOME/android-sdk
        - echo 'export ANDROID_SDK_ROOT=$HOME/android-sdk' >> $HOME/.bashrc
        - echo 'export PATH="$HOME/android-sdk/cmdline-tools/tools/bin:$PATH"' >> $HOME/.bashrc
        - source $HOME/.bashrc
        - yes | $HOME/android-sdk/cmdline-tools/tools/bin/sdkmanager --licenses
        - $HOME/android-sdk/cmdline-tools/tools/bin/sdkmanager "platform-tools" "platforms;android-30"
        - cd ShakeAndCraft
        - gradle build
    - name: sonarqube
      image: sonarsource/sonar-scanner-cli:4.5
      environment:
        SONAR_HOST_URL: "https://your-sonarqube-url.com"
        SONAR_LOGIN: ${SONAR_TOKEN}
      commands:
        - sonar-scanner 