-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
63 lines (57 loc) · 2.11 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
# 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
pool:
vmImage: ubuntu-20.04
# steps:
# - script: echo Hello, world!
# displayName: 'Run a one-line script'
#
# - script: |
# echo Add other tasks to build, test, and deploy your project.
# echo See https://aka.ms/yaml
# displayName: 'Run a multi-line script'
# TODO:
# - detect the branch (master, develop or prod)
# - create a tag prefix for the docker tag, based on the branch
# master -> [no prefix]
# prod -> [no prefix]
# develop -> dev-
# - choose the container registry, based on the branch
# master -> acr-morphic
# prod -> dockerhub-raisingthefloor
# develop -> acr-morphicdev
# - NOTE: we may want to create an "acr-morphicpr" container registry as well, and send any docker images there for PR check-ins (and then launch a temporary site off of a pr.morphic.org subdomain)
# - finally: create a mechanism (during dev and production deployment) to delete any container images from the registry which are older than the image we are replacing (i.e. only keep the current one and the new one)
stages:
- stage: Docker
jobs:
- job: Docker
steps:
- task: Docker@2
displayName: Build docker image
inputs:
command: build
containerRegistry: acr-morphic
repository: morphic-app-website
tags: $(Build.BuildNumber)
- task: Docker@2
displayName: Log in to container registry
inputs:
command: login
containerRegistry: acr-morphic
- task: Docker@2
displayName: Push docker image
inputs:
command: push
containerRegistry: acr-morphic
repository: morphic-app-website
tags: $(Build.BuildNumber)
- task: Docker@2
displayName: Log out of container registry
inputs:
command: logout
containerRegistry: acr-morphic