@ossy/deployment-tools 0.0.5 → 0.0.6

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/dist/index.js CHANGED
@@ -28476,12 +28476,12 @@ class CaddyClient {
28476
28476
  this.serverName = serverName
28477
28477
  }
28478
28478
 
28479
- deploy({ domain, targetPort }) {
28479
+ deploy({ domain, environmentName, targetPort }) {
28480
28480
  return fetch(`http://localhost:2019/config/apps/http/servers/${this.serverName}/routes`, {
28481
28481
  method: 'POST',
28482
28482
  headers: { 'Content-Type': 'application/json' },
28483
28483
  body: JSON.stringify({
28484
- match: [Matchers.host(domain)],
28484
+ match: [Matchers.host(`*.${environmentName}.${domain}`)],
28485
28485
  handle: [
28486
28486
  Handlers.subroute([{ handle: [Handlers.reverseProxy(targetPort)] }])
28487
28487
  ],
@@ -28834,7 +28834,11 @@ class ContainerManagerCommands {
28834
28834
 
28835
28835
  console.log('body', body)
28836
28836
 
28837
- fetch(`http://${targetEnvironment}.ci.${platform.domain}/deploy`, {
28837
+ const ciUrl = targetEnvironment === 'prod'
28838
+ ? `http://${platform.ciSubDomain}.${platform.domain}/deploy`
28839
+ : `http://${platform.ciSubDomain}.${targetEnvironment}.${platform.domain}/deploy`
28840
+
28841
+ fetch(ciUrl, {
28838
28842
  method: 'POST',
28839
28843
  headers: { 'Content-Type': 'application/json' },
28840
28844
  body: JSON.stringify(body)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Collection of scripts and tools to aid deployment of containers and static files",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -80,12 +80,12 @@ class CaddyClient {
80
80
  this.serverName = serverName
81
81
  }
82
82
 
83
- deploy({ domain, targetPort }) {
83
+ deploy({ domain, environmentName, targetPort }) {
84
84
  return fetch(`http://localhost:2019/config/apps/http/servers/${this.serverName}/routes`, {
85
85
  method: 'POST',
86
86
  headers: { 'Content-Type': 'application/json' },
87
87
  body: JSON.stringify({
88
- match: [Matchers.host(domain)],
88
+ match: [Matchers.host(`*.${environmentName}.${domain}`)],
89
89
  handle: [
90
90
  Handlers.subroute([{ handle: [Handlers.reverseProxy(targetPort)] }])
91
91
  ],
@@ -101,7 +101,11 @@ export class ContainerManagerCommands {
101
101
 
102
102
  console.log('body', body)
103
103
 
104
- fetch(`http://${targetEnvironment}.ci.${platform.domain}/deploy`, {
104
+ const ciUrl = targetEnvironment === 'prod'
105
+ ? `http://${platform.ciSubDomain}.${platform.domain}/deploy`
106
+ : `http://${platform.ciSubDomain}.${targetEnvironment}.${platform.domain}/deploy`
107
+
108
+ fetch(ciUrl, {
105
109
  method: 'POST',
106
110
  headers: { 'Content-Type': 'application/json' },
107
111
  body: JSON.stringify(body)