Skip to content

Commit 969c7c2

Browse files
Set up CI with Azure Pipelines
[skip ci]
1 parent c41f222 commit 969c7c2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

azure-pipelines.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Docker
2+
# Build and push an image to Azure Container Registry
3+
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
4+
5+
trigger:
6+
- master
7+
8+
resources:
9+
- repo: self
10+
11+
variables:
12+
# Container registry service connection established during pipeline creation
13+
dockerRegistryServiceConnection: 'bbc00546-6924-4a6f-981e-eb246a6761fb'
14+
imageRepository: 'mydocimage1'
15+
containerRegistry: 'devsecopscontainer212.azurecr.io'
16+
dockerfilePath: '$(Build.SourcesDirectory)/app/Dockerfile'
17+
tag: '$(Build.BuildId)'
18+
19+
# Agent VM image name
20+
vmImageName: 'ubuntu-latest'
21+
22+
stages:
23+
- stage: Build
24+
displayName: Build and push stage
25+
jobs:
26+
- job: Build
27+
displayName: Build
28+
pool:
29+
vmImage: $(vmImageName)
30+
steps:
31+
- task: Docker@2
32+
displayName: Build and push an image to container registry
33+
inputs:
34+
command: buildAndPush
35+
repository: $(imageRepository)
36+
dockerfile: $(dockerfilePath)
37+
containerRegistry: $(dockerRegistryServiceConnection)
38+
tags: |
39+
$(tag)

0 commit comments

Comments
 (0)