-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
56 lines (51 loc) · 1.61 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
pr: none
trigger:
branches:
include:
- main
variables:
dockerRegistryServiceConnection: '6de94e67-eca1-41c5-98a7-8a3d21b62d99'
imageRepository: 'nadeko'
tag: '$(Build.BuildId)'
stages:
- stage: build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: "$(Build.SourcesDirectory)/Dockerfile"
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
latest
- stage: deployProd
displayName: Deploy Prod
dependsOn: build
jobs:
- deployment: deployProd
pool: prod-vm-uks-core
displayName: Deploy Prod
environment: prod
strategy:
runOnce:
deploy:
steps:
- task: Docker@2
displayName: Authenticate to docker registry
inputs:
command: login
containerRegistry: $(dockerRegistryServiceConnection)
- script: |
COMPOSE_FILE=/apps/nadeko/nadeko.yml
PROJECT=nadeko
docker compose -f $COMPOSE_FILE -p $PROJECT pull
docker compose -f $COMPOSE_FILE -p $PROJECT down
docker compose -f $COMPOSE_FILE -p $PROJECT up --force-recreate -d
env:
TAG: $(tag)