-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
65 lines (56 loc) · 1.84 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
trigger:
- master
stages:
- stage: Build
jobs:
- job:
steps:
- script: dotnet build --configuration Release
displayName: 'dotnet build Release'
- task: DotNetCoreCLI@2
displayName: Run unit tests
inputs:
command: 'test'
projects: '**/*Tests*.csproj'
testRunTitle: 'Unit Tests'
- task: DotNetCoreCLI@2
displayName: Publish to $(Build.ArtifactStagingDirectory)
inputs:
command: 'publish'
publishWebProjects: false
projects: 'src/**/*.csproj'
arguments: '-c Release -o "$(Build.ArtifactStagingDirectory)"'
- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: Deploy
jobs:
- job:
variables:
- group: AWS-ARN
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: LambdaDeployFunction@1
displayName: 'Deploy Lambda Function'
inputs:
awsCredentials: 'awsLambdaCICDPipeline'
regionName: 'us-east-1'
deploymentMode: 'codeandconfiguration'
functionName: 'MyFunctionCreateFromAzureDevops'
description: 'From AzureDevops'
functionHandler: 'awsLambdaCICDPipeline::awsLambdaCICDPipeline.Function::FunctionHandler'
runtime: 'dotnetcore2.1'
codeLocation: 'localfile'
localZipFile: '$(Build.ArtifactStagingDirectory)/drop/awsLambdaCICDPipeline.zip'
roleARN: '$(AWS-Lambda-ARN)'
dependsOn:
- Build
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))