forked from yeg-relief/youcanbenefit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-master.yml
43 lines (35 loc) · 1.3 KB
/
azure-pipelines-master.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
# Docker image
# Build a Docker image to deploy, run, or push to a container registry.
# Add steps that use Docker Compose, tag images, push to a registry, run an image, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
branches:
include:
- master
pr: none
pool:
vmImage: 'Ubuntu-16.04'
steps:
- bash: |
cd backend
npm ci
npm run unit-test
displayName: 'docker unit-test backend'
- bash: |
cd backend
docker build --tag $(registryServerName)/youcanbenefit-api:$(build.buildId) --tag $(registryServerName)/youcanbenefit-api:latest .
displayName: 'docker build backend'
- bash: |
cd frontend
docker build --tag $(registryServerName)/youcanbenefit-web:$(build.buildId) --tag $(registryServerName)/youcanbenefit-web:latest .
displayName: 'docker build frontend'
- bash: echo $(docker.password) | docker login -u $(docker.username) --password-stdin
displayName: 'docker login'
- bash: |
docker push $(registryServerName)/youcanbenefit-api:$(build.buildId)
docker push $(registryServerName)/youcanbenefit-api:latest
displayName: 'docker push backend'
- bash: |
docker push $(registryServerName)/youcanbenefit-web:$(build.buildId)
docker push $(registryServerName)/youcanbenefit-web:latest
displayName: 'docker push frontend'