-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
53 lines (43 loc) · 1.29 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
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
resources:
- repo: self
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
variables:
tags: $(Build.BuildId)
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
buildContext: '$(System.DefaultWorkingDirectory)'
repository: '$(AWS_ECR_REPOSITORY_URI)'
tags: |
$(Build.BuildId)
- task: CopyFiles@2
inputs:
Contents: 'eks-deploy-from-ecr.yaml'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: ECRPushImage@1
inputs:
awsCredentials: '$(AWS_CREDENTIALS)'
regionName: '$(AWS_REGION)'
imageSource: 'imagename'
sourceImageName: '$(AWS_ECR_REPOSITORY_URI)'
sourceImageTag: '$(Build.BuildId)'
repositoryName: '$(AWS_ECR_REPOSITORY_NAME)'
pushTag: '$(Build.BuildId)'