I'm new to azure. I was told that I need to make a condition: "if this is a request pool, then we run it depending on the content. If this is a build, then we run everything." As I see, each task already has a condition in all of this tasks:
condition: eq(dependencies.check.outputs['Check Changes.BE '], 'true')
As you can see, the task execution depends on the BE\FE variable. Task with that variables looks like this:
- task: CheckChanges@1
name: CheckChanges
pool: "windows-latest"
inputs:
rules: |
[FE]
**/*.json
**/*.ts
**/*.js
**/*.tsx
**/*.scss
**/*.html
**/*.css
[BE]
**/*.csproj
**/*.cs
**/*.yml
**/*.yaml
Here is the tasks with which it needs to be done:
- job: Restore BE
displayName: Restore BE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.BE'], 'true')
steps:
- task: Cake@2
displayName: Restore FE and Sitecore modules
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Server :: Restore"
verbosity: "Quiet"
Version: "1.3.0"
- job: Restore FE
displayName: Restore FE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.FE'], 'true')
steps:
- task: Cake@2
displayName: Restore FE and Sitecore modules
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Client :: Restore"
verbosity: "Quiet"
Version: "1.3.0"
- job: Build BE
displayName: Build BE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.BE'], 'true')
steps:
- task: Cake@2
displayName: Generate and Build FE and Sitecore
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Server :: Build"
verbosity: "Quiet"
arguments: '--BuildConfiguration "Release" --ScSiteUrl "dummy"'
Version: "1.3.0"
- job: Build FE
displayName: Build FE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.FE'], 'true')
steps:
- task: Cake@2
displayName: Generate and Build FE and Sitecore
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Client :: Build"
verbosity: "Quiet"
arguments: '--BuildConfiguration "Release" --ScSiteUrl "dummy"'
Version: "1.3.0"
- job: Unit tests BE
displayName: Unit tests BE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.BE'], 'true')
steps:
- task: Cake@2
displayName: Run Unit tests
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Server :: Tests"
verbosity: "Quiet"
Version: "1.3.0"
- job: Unit tests FE
displayName: Unit tests FE
dependsOn: CheckChanges
condition: eq(dependencies.check.outputs['CheckChanges.FE'], 'true')
steps:
- task: Cake@2
displayName: Run Unit tests
inputs:
script: "$(Build.Repository.LocalPath)/src/build.cake"
target: "Client :: Tests"
verbosity: "Quiet"
Version: "1.3.0"
I don't understand what I need to do. My Team Lead just say: "If it's a Pull Request, then we run it depending on the content. If it's a build, then we run everything."