|
| 1 | +name: Release Build |
| 2 | +trigger: |
| 3 | + branches: |
| 4 | + include: |
| 5 | + - release/v1-attribute |
| 6 | + |
| 7 | +variables: |
| 8 | + Parameters.solution: 'v1_attribute/src/AzureFunctionsIntroduction.sln' |
| 9 | + Parameters.connectedServiceName: 'AzureResourceManager' |
| 10 | + WebAppName: 'function-v1-function' |
| 11 | + BuildConfiguration: "Release" |
| 12 | + |
| 13 | +phases: |
| 14 | + |
| 15 | +- phase: build_windows_agent |
| 16 | + displayName: Windows Agent |
| 17 | + queue: |
| 18 | + name: Hosted VS2017 |
| 19 | + demands: msbuild |
| 20 | + |
| 21 | + steps: |
| 22 | + - task: DotNetCoreCLI@1 |
| 23 | + displayName: restore |
| 24 | + inputs: |
| 25 | + command: "restore" |
| 26 | + projects: "$(Parameters.solution)" |
| 27 | + |
| 28 | + - task: MSBuild@1 |
| 29 | + displayName: build |
| 30 | + inputs: |
| 31 | + solution: "$(Parameters.solution)" |
| 32 | + configuration: "$(BuildConfiguration)" |
| 33 | + msbuildArguments: "/p:OutputPath=$(Build.SourcesDirectory)/Tmp" |
| 34 | + clean: "true" |
| 35 | + |
| 36 | + - task: ArchiveFiles@2 |
| 37 | + displayName: 'Archive $(build.artifactstagingdirectory)' |
| 38 | + inputs: |
| 39 | + rootFolderOrFile: '$(build.SourcesDirectory)/Tmp' |
| 40 | + archiveFile: '$(Build.ArtifactStagingDirectory)/artifact.zip' |
| 41 | + includeRootFolder: false |
| 42 | + |
| 43 | + - task: PublishBuildArtifacts@1 |
| 44 | + displayName: 'Publish Artifact: drop' |
| 45 | + inputs: |
| 46 | + PathtoPublish: '$(build.artifactstagingdirectory)' |
| 47 | + |
| 48 | + - powershell: | |
| 49 | + $username = $env:DeployUserName |
| 50 | + $password = $env:DeployPassword |
| 51 | + $filePath = "$($env:Build_ArtifactStagingDirectory)/artifact.zip" |
| 52 | + $apiUrl = "https://$env:WebAppName.scm.azurewebsites.net/api/zipdeploy" |
| 53 | + echo "username : $username" |
| 54 | + echo "password : $password" |
| 55 | + echo "filePath : $filePath" |
| 56 | + echo "apiUrl : $apiUrl" |
| 57 | +
|
| 58 | + - powershell: | |
| 59 | + $username = $env:DeployUserName |
| 60 | + $password = $env:DeployPassword |
| 61 | + $filePath = "$($env:Build_ArtifactStagingDirectory)/artifact.zip" |
| 62 | + $apiUrl = "https://$env:WebAppName.scm.azurewebsites.net/api/zipdeploy" |
| 63 | + $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username, $password))) |
| 64 | + $userAgent = "powershell/1.0" |
| 65 | + Invoke-RestMethod -Uri $apiUrl -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -UserAgent $userAgent -Method POST -InFile $filePath -ContentType "multipart/form-data" |
| 66 | + displayName: 'deploy' |
0 commit comments