-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
72 lines (52 loc) · 1.58 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
66
67
68
69
70
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pr:
- master
jobs:
- job: azure_docker_integration
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
variables:
dockerId: tbillah
imageName: tbillah/entry_point
user: pnlbwh
wd: /home
steps:
- task: Docker@2
displayName: Login to Docker Hub
inputs:
command: login
containerRegistry: dockerHub
- task: CopyFiles@2
displayName: 'Copy test configFile'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**/equality-test.yaml'
TargetFolder: '$(Agent.BuildDirectory)'
- task: CopyFiles@2
displayName: 'Copy container structure test'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**/container-structure-test-linux-amd64'
TargetFolder: '$(Agent.BuildDirectory)'
- script: |
docker build -t $(imageName) -f Dockerfile.entrypoint --build-arg USER=$(user) .
# docker push $(imageName)
displayName: 'Build a docker image'
failOnStderr: true
- task: Docker@2
displayName: Push image to Docker Hub
inputs:
command: push
containerRegistry: dockerHub
repository: $(imageName)
tags: 'latest'
- script: |
$(Agent.BuildDirectory)/container-structure-test-linux-amd64 test --image $(imageName) --config $(Agent.BuildDirectory)/equality-test.yaml
displayName: 'Test the docker image'
failOnStderr: true