@ossy/deployment-tools 0.0.89 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/caddy/caddy.js +4 -0
- package/src/caddy/temp-config.json +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/deployment-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.90",
|
|
4
4
|
"description": "Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/caddy/caddy.js
CHANGED
|
@@ -60,6 +60,7 @@ class CaddyService {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
static getProxyConfig(containerDeploymentTemplate) {
|
|
63
|
+
logInfo({ message: `[CaddyService] Checking if a proxy for ${containerDeploymentTemplate.domain} exists` })
|
|
63
64
|
return fetch(`http://localhost:2019/id/${containerDeploymentTemplate.domain}`, {
|
|
64
65
|
method: 'GET',
|
|
65
66
|
headers: { 'Content-Type': 'application/json' }
|
|
@@ -73,6 +74,7 @@ class CaddyService {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
static applyProxyConfig(containerDeploymentTemplate) {
|
|
77
|
+
|
|
76
78
|
return CaddyService.getProxyConfig(containerDeploymentTemplate)
|
|
77
79
|
.then(proxyConfig => {
|
|
78
80
|
proxyConfig
|
|
@@ -82,6 +84,7 @@ class CaddyService {
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
static addProxyConfig(containerDeploymentTemplate) {
|
|
87
|
+
logInfo({ message: `[CaddyService] Adding proxy for ${containerDeploymentTemplate.domain}` })
|
|
85
88
|
const proxyConfig = CaddyConfigService.createProxyConfig(containerDeploymentTemplate)
|
|
86
89
|
return fetch('http://localhost:2019/config/apps/http/servers/deployment-tools/routes', {
|
|
87
90
|
method: 'POST',
|
|
@@ -93,6 +96,7 @@ class CaddyService {
|
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
static replaceProxyConfig(containerDeploymentTemplate) {
|
|
99
|
+
logInfo({ message: `[CaddyService] Replacing proxy for ${containerDeploymentTemplate.domain}` })
|
|
96
100
|
const proxyConfig = CaddyConfigService.createProxyConfig(containerDeploymentTemplate)
|
|
97
101
|
return fetch(`http://localhost:2019/id/${containerDeploymentTemplate.domain}`, {
|
|
98
102
|
method: 'POST',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"apps":{"http":{"servers":{"deployment-tools":{"listen":[":443"],"routes":[{"@id":"cms.qa.ossy.se","handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"localhost:3015"}]}]}]}],"match":[{"host":["cms.qa.ossy.se"]}]},{"@id":"www.plexus-sanitas.com","handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"localhost:3000"}]}]}]}],"match":[{"host":["www.plexus-sanitas.com"]}]},{"@id":"www.plexus-sanitas.com","handle":[{"handler":"subroute","routes":[{"handle":[{"handler":"reverse_proxy","upstreams":[{"dial":"localhost:3016"}]}]}]}],"match":[{"host":["www.plexus-sanitas.com"]}]}]}}},"tls":{"automation":{"policies":[{"issuers":[{"challenges":{"dns":{"provider":{"aws_profile":"ci-client","max_retries":10,"name":"route53"}}},"module":"acme"},{"challenges":{"dns":{"provider":{"max_retries":10,"name":"route53"}}},"module":"zerossl"}],"subjects":["cms.qa.ossy.se","www.plexus-sanitas.com"]}]}}}}
|