All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pipeline.azure.azure.yaml.mustache Maven / Gradle / Ivy

Go to download

Gradle plugin to create a clean application in Java that already works, It follows our best practices!

There is a newer version: 3.20.10
Show newest version
name: $(Build.SourceBranchName).$(date:yyyyMMdd)$(rev:.r)

variables:
  - name: 'Artifactory.Repository'
    value: 'build-{{projectName}}'
  - name: 'Artifact.Name'
    value: '{{projectName}}'

resources:
  - repo: self
    clean: true

trigger:
  branches:
    include:
      - master
      - trunk
      - main
      - feature/*

stages:
- stage: CI
  jobs:
  - job: build
    displayName: 'Build'
    pool:
      name: Build
      demands:
        - java
    steps:
    - task: SonarQubePrepare@5
      displayName: 'Prepare analysis on SonarQube'
      inputs:
        SonarQube: SonarQube
        scannerMode: Other
        extraProperties: |
          {{#monoRepo}}
          sonar.projectKey=$(Build.Repository.Name)_$(projectName)
          sonar.projectName=$(Build.Repository.Name)_$(projectName)
          {{/monoRepo}}
          {{^monoRepo}}
          sonar.projectKey=$(Build.Repository.Name)
          sonar.projectName=$(Build.Repository.Name)
          {{/monoRepo}}

          sonar.projectVersion=$(Build.BuildNumber)

    - task: Gradle@3
      displayName: 'Build and Test'
      inputs:
        workingDirectory: .
        gradleWrapperFile: gradlew
        tasks: 'clean build jacocoMergedReport'
        publishJUnitResults: true
        testResultsFiles: '**/TEST-*.xml'
        sonarQubeRunAnalysis: true
        sqGradlePluginVersionChoice: 'build'

    - task: PublishCodeCoverageResults@1
      displayName: 'Publish code coverage'
      inputs:
        summaryFileLocation: '$(System.DefaultWorkingDirectory)/build/reports/jacocoMergedReport/jacocoMergedReport.xml'
        reportDirectory: '$(System.DefaultWorkingDirectory)/build/reports/jacocoMergedReport/html'

    - task: Sonar-buildbreaker@8
      displayName: 'Quality Gate'
      inputs:
        SonarQube: SonarQube

    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact'
      condition: in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/trunk', 'refs/heads/master')
      inputs:
        PathtoPublish: '$(System.DefaultWorkingDirectory)/applications/app-service/build/libs/'
        ArtifactName: '$(Artifact.Name)'




© 2015 - 2025 Weber Informatics LLC | Privacy Policy