From 07265a850b8db7f4610b47738091975e3cd5c8cb Mon Sep 17 00:00:00 2001 From: noahspannbauer Date: Tue, 24 Nov 2020 11:40:27 -0600 Subject: [PATCH] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 76 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..5857e26 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,76 @@ +# .NET Core Function App to Windows on Azure +# Build a .NET Core function app and deploy it to Azure as a Windows function App. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core + +trigger: +- main + +variables: + # Azure Resource Manager connection created during pipeline creation + azureSubscription: '43591186-adad-4d12-a645-db9f311b0705' + + # Function app name + functionAppName: 'noahspan-calendars-functions' + + # Agent VM image name + vmImageName: 'vs2017-win2016' + + # Working Directory + workingDirectory: '$(System.DefaultWorkingDirectory)/' + +stages: +- stage: Build + displayName: Build stage + + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + + steps: + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: 'build' + projects: | + $(workingDirectory)/*.csproj + arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration Release + + - task: ArchiveFiles@2 + displayName: 'Archive files' + inputs: + rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output' + includeRootFolder: false + archiveType: zip + archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + replaceExistingArchive: true + + - publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip + artifact: drop + +- stage: Deploy + displayName: Deploy stage + dependsOn: Build + condition: succeeded() + + jobs: + - deployment: Deploy + displayName: Deploy + environment: 'development' + pool: + vmImage: $(vmImageName) + + strategy: + runOnce: + deploy: + + steps: + - task: AzureFunctionApp@1 + displayName: 'Azure functions app deploy' + inputs: + azureSubscription: '$(azureSubscription)' + appType: functionApp + appName: $(functionAppName) + package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip' \ No newline at end of file