Skip to main content

Azure Pipeline (master branch)

masterThis is an Azure DevOps pipeline responsible for branch pushes and PR builds.
After the build, perform static analysis with SonarQube, and if it passes, push the image to ACR.

Pipeline List

pipelineYAML filetrigger
infolineage-apiinfra/azure-pipelines/pipelines/api-pipeline.ymlmaster push / PR
infolineage-workerinfra/azure-pipelines/pipelines/worker-pipeline.ymlmaster push / PR
infolineage-frontendinfra/azure-pipelines/pipelines/frontend-pipeline.ymlmaster push / PR

YAML Structure

infra/azure-pipelines/
├── pipelines/
│ ├── api-pipeline.yml ← 각 모듈 진입점
│ ├── worker-pipeline.yml
│ └── frontend-pipeline.yml
└── templates/
├── build-java.yml ← Gradle 빌드 템플릿
├── sonar-scan.yml ← SonarQube 분석 템플릿
└── docker-push.yml ← Docker 빌드 & ACR 푸시 템플릿

Pipeline YAML istemplates/totemplateReuse as a reference.

# 예시: api-pipeline.yml
stages:
- stage: Build
jobs:
- template: ../templates/build-java.yml
parameters:
module: infolineage-api

- stage: SonarQube
jobs:
- template: ../templates/sonar-scan.yml
parameters:
projectKey: infolineage-api

- stage: Docker
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- template: ../templates/docker-push.yml
parameters:
module: api

Trigger Strategy

trigger:
branches:
include:
- master

pr:
branches:
include:
- master
  • master push: Execute all 3 steps (Build → SonarQube → Docker)
  • PR Build: Run Build + SonarQube only, skip Docker push (condition: eq(variables['Build.SourceBranch'], 'refs/heads/master'))

Step 3 Flow

Stage 1: Build

- task: Gradle@3
inputs:
gradleWrapperFile: 'backend/gradlew'
workingDirectory: 'backend'
tasks: ':infolineage-api:bootJar -x test --build-cache'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '25'
options: '-Dorg.gradle.jvmargs="--enable-preview -Xmx2g"'

Stage 2: SonarQube

- task: SonarQubePrepare@5
inputs:
SonarQube: 'SonarQube' # Service Connection 이름
scannerMode: 'Other'
extraProperties: |
sonar.projectKey=infolineage-api
sonar.sources=backend/infolineage-api/src/main
sonar.tests=backend/infolineage-api/src/test
sonar.java.binaries=backend/infolineage-api/build/classes
sonar.java.source=25

- task: SonarQubeAnalyze@5

- task: SonarQubePublish@5
inputs:
pollingTimeoutSec: '300'

Stage 3: Docker → ACR

- task: Docker@2
inputs:
containerRegistry: 'AzureContainerRegistry'
repository: 'infolineage/api'
command: 'buildAndPush'
Dockerfile: 'backend/infolineage-api/Dockerfile'
buildContext: 'backend'
tags: 'latest'

Service Connection List

nameTypeUsage
SonarQubeSonarQubeConnecting to SonarQube Analysis Server
AzureContainerRegistryDocker RegistryACR Image Push

Manage in Azure DevOps → Project Settings → Service Connections.

Future Plans

stepContentStatus
Staging Automatic DeploymentAutomatic Rollout of K8s Staging After Docker StageNot implemented
Production Manual ApprovalAzure DevOps Approval Gates + Manual DeploymentNot implemented
path triggerBuild only the modified modules with monorepo path filterNot implemented