This repository has been archived by the owner on May 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathazure-pipelines.yml
65 lines (57 loc) · 1.68 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
pool:
name: Azure Pipelines
vmImage: ubuntu-16.04
steps:
# we build and push the builder stage so we can reuse this image as cache source
- task: Docker@2
displayName: Login to Docker Hub
inputs:
command: login
containerRegistry: 'dockerhub remibou'
# we pull the latest version of the builder for using it in cache-from arguments
- task: Bash@3
displayName: Docker pull builder image
inputs:
targetType: 'inline'
script: docker pull remibou/toss:builder
# we build only the builder part
- task: Docker@2
displayName: Build Builder image
inputs:
command: build
repository: remibou/toss
tags: builder
arguments: --cache-from remibou/toss:builder --target build
Dockerfile: Dockerfile
buildContext: .
# we push only the builder part for future usage
- task: Docker@2
displayName: Push Builder image
inputs:
command: push
repository: remibou/toss
tags: builder
containerRegistry: 'dockerhub remibou'
# we build the full image
- task: Docker@2
displayName: Build Full image
inputs:
command: build
repository: remibou/toss
tags: latest
arguments: --cache-from remibou/toss:builder
Dockerfile: Dockerfile
buildContext: .
- task: DockerCompose@0
displayName: Run E2E (Cypress) tests
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'dockerhub remibou'
dockerComposeFile: 'docker-compose.yml'
dockerComposeCommand: 'up --renew-anon-volumes --exit-code-from cypress'
- task: PublishPipelineArtifact@1
displayName: 'Publish Cypress videos'
inputs:
targetPath: Toss.Tests.E2E.Cypress/cypress/videos/
artifact: 'Cypress videos'
condition: succeededOrFailed()