Skip to content

Instantly share code, notes, and snippets.

@jitendra-25
Last active January 11, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitendra-25/45fc49ba72586b03913740ee3ef4cdcb to your computer and use it in GitHub Desktop.
Save jitendra-25/45fc49ba72586b03913740ee3ef4cdcb to your computer and use it in GitHub Desktop.
Azure Build Pipeline with FileTransform Task
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- main
pool:
vmImage: windows-2019
variables:
- group: JsonVariableGrp
- name: buildConfiguration
value: 'Release'
- name: MailSettings.EMail
value: '$(EMail)'
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
echo "Print EMail value"
echo "Value: $(EMail)"
- task: FileTransform@1
displayName: "Running File Transform Task"
inputs:
folderPath: 'DemoCoreApp/**/'
fileType: 'json'
targetFiles: '*.json'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Running Publish Artifacts'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishPipelineArtifact@1
displayName: 'Uploading Artifact to Dir'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'artifactDrop'
publishLocation: 'pipeline'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment