Last active
January 11, 2022 14:32
-
-
Save jitendra-25/45fc49ba72586b03913740ee3ef4cdcb to your computer and use it in GitHub Desktop.
Azure Build Pipeline with FileTransform Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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