forked from akannan1087/myPythonDockerRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws-ecr.yaml
More file actions
26 lines (25 loc) · 764 Bytes
/
aws-ecr.yaml
File metadata and controls
26 lines (25 loc) · 764 Bytes
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
stages:
- stage: Docker
displayName: Build & Push Docker image to AWS ECR
jobs:
- job: Build_and_Push
displayName: Build & Push Docker image
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
buildContext: '$(Build.SourcesDirectory)'
repository: $(DOCKER_REPOSITORY_NAME)
- task: ECRPushImage@1
inputs:
awsCredentials: 'ecr_connection'
regionName: $(AWS_REGION)
imageSource: 'imagename'
sourceImageName: $(DOCKER_REPOSITORY_NAME)
sourceImageTag: $(Build.BuildId)
pushTag: latest
repositoryName: $(DOCKER_REPOSITORY_NAME)