forked from a-sync/game-server-watcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azuredeploy.json
177 lines (177 loc) · 6.4 KB
/
azuredeploy.json
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"type": "string",
"defaultValue": "GameServerWatcher",
"metadata": {
"description": "The name / subdomain of the web app that you wish to create. (alphanumeric only!)"
}
},
"siteLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location to use for creating the web app and hosting plan. It must be one of the Azure locations that support web apps."
}
},
"secret": {
"type": "string",
"metadata": {
"description": "Admin secret"
}
},
"refreshTimeMinutes": {
"type": "int",
"defaultValue": 2,
"minValue": 1,
"maxValue": 60,
"metadata": {
"description": "Game server info refresh interval in minutes"
}
},
"discordBotToken": {
"type": "string",
"defaultValue": "-",
"metadata": {
"description": "Discord bot token"
}
},
"telegramBotToken": {
"type": "string",
"defaultValue": "-",
"metadata": {
"description": "Telegram bot token"
}
},
"slackBotToken": {
"type": "string",
"defaultValue": "-",
"metadata": {
"description": "Slack bot token"
}
},
"slackAppToken": {
"type": "string",
"defaultValue": "-",
"metadata": {
"description": "Slack app token"
}
},
"steamWebApiKey": {
"type": "string",
"defaultValue": "-",
"metadata": {
"description": "Steam web API key"
}
},
"repoUrl": {
"type": "string",
"defaultValue": "https://github.com/a-sync/game-server-watcher.git",
"metadata": {
"description": "Source repo URL."
}
},
"branch": {
"type": "string",
"defaultValue": "master",
"metadata": {
"description": "Source repo branch."
}
}
},
"variables": {
"sku": "Basic",
"skuCode": "B1",
"linuxFxVersion": "NODE|16-lts",
"hostingPlanName": "[format('AppServicePlan-{0}', parameters('siteName'))]"
},
"resources": [
{
"apiVersion": "2021-02-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[parameters('siteLocation')]",
"sku": {
"name": "[variables('skuCode')]",
"tier": "[variables('sku')]"
},
"kind": "linux",
"properties": {
"name": "[variables('hostingPlanName')]",
"reserved": true
}
},
{
"apiVersion": "2021-02-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('siteLocation')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
],
"kind": "app,linux",
"properties": {
"serverFarmId": "[variables('hostingPlanName')]",
"siteConfig": {
"linuxFxVersion": "[variables('linuxFxVersion')]",
"AlwaysOn": true
}
},
"resources": [
{
"apiVersion": "2021-02-01",
"name": "web",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties": {
"siteProperties": {
"webSocketsEnabled": true
}
}
},
{
"apiVersion": "2021-02-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
],
"properties": {
"SECRET": "[parameters('secret')]",
"REFRESH_TIME_MINUTES": "[parameters('refreshTimeMinutes')]",
"DISCORD_BOT_TOKEN": "[if(equals('-', parameters('discordBotToken')), '', parameters('discordBotToken'))]",
"TELEGRAM_BOT_TOKEN": "[if(equals('-', parameters('telegramBotToken')), '', parameters('telegramBotToken'))]",
"SLACK_BOT_TOKEN": "[if(equals('-', parameters('slackBotToken')), '', parameters('slackBotToken'))]",
"SLACK_APP_TOKEN": "[if(equals('-', parameters('slackAppToken')), '', parameters('slackAppToken'))]",
"STEAM_WEB_API_KEY": "[if(equals('-', parameters('steamWebApiKey')), '', parameters('steamWebApiKey'))]"
}
},
{
"condition": "[contains(parameters('repoUrl'), 'http')]",
"apiVersion": "2021-02-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]",
"[concat('Microsoft.Web/Sites/', parameters('siteName'), '/config/web')]"
],
"properties": {
"RepoUrl": "[parameters('repoUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
],
"outputs": {
"siteUri": {
"type": "string",
"value": "[concat('https://',reference(resourceId('Microsoft.Web/sites', parameters('siteName'))).hostNames[0])]"
}
}
}