-
Notifications
You must be signed in to change notification settings - Fork 328
/
release-docker-images-pipeline.yml
139 lines (135 loc) · 4.16 KB
/
release-docker-images-pipeline.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Build and Push Docker Container
trigger:
branches:
include:
- master
paths:
exclude:
- docs/*
- tests/*
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- task: PowerShell@2
inputs:
filePath: 'set-projectVersion.ps1'
- bash: |
#!/bin/sh
echo 'tag is $TAG'
if (curl --silent -f -lSL https://hub.docker.com/v2/repositories/munique/openmu/tags/$TAG > /dev/null) then
echo '##vso[task.setvariable variable=tagExists]true'
else
echo '##vso[task.setvariable variable=tagExists]false'
fi
env:
TAG: $(projectVersion)
- task: Docker@2
condition: eq(variables.tagExists, 'false')
inputs:
containerRegistry: 'munique docker hub'
command: 'login'
- task: CmdLine@2
condition: eq(variables.tagExists, 'false')
displayName: "Build and Push All-In-One Image (openmu)"
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Startup/Dockerfile \
-t munique/openmu:latest \
-t munique/openmu:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push AdminPanel Image (openmu-admin)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/AdminPanel.Host/Dockerfile \
-t munique/openmu-admin:latest \
-t munique/openmu-admin:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push ChatServer Image"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/ChatServer.Host/Dockerfile \
-t munique/openmu-chat:latest \
-t munique/openmu-chat:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push ConnectServer Image (openmu-connect)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/ConnectServer.Host/Dockerfile \
-t munique/openmu-connect:latest \
-t munique/openmu-connect:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push FriendServer Image (openmu-friend)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/FriendServer.Host/Dockerfile \
-t munique/openmu-friend:latest \
-t munique/openmu-friend:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push GameServer Image (openmu-game)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/GameServer.Host/Dockerfile \
-t munique/openmu-game:latest \
-t munique/openmu-game:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push GuildServer Image (openmu-guild)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/GuildServer.Host/Dockerfile \
-t munique/openmu-guild:latest \
-t munique/openmu-guild:$(projectVersion) \
--push \
.
- task: CmdLine@2
displayName: "Build and Push LoginServer Image (openmu-login)"
condition: eq(variables.tagExists, 'false')
inputs:
script: |
cd src
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 \
--file Dapr/LoginServer.Host/Dockerfile \
-t munique/openmu-login:latest \
-t munique/openmu-login:$(projectVersion) \
--push \
.