@ossy/deployment-tools 0.0.4 → 0.0.7

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
@@ -28481,7 +28481,7 @@ class CaddyClient {
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(`*.${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)
@@ -28854,6 +28858,7 @@ class ContainerManagerCommands {
28854
28858
 
28855
28859
 
28856
28860
 
28861
+
28857
28862
  const [_, __, command, ...restArgs] = process.argv
28858
28863
 
28859
28864
  const startHandler = () => {
@@ -28874,7 +28879,9 @@ Description=D
28874
28879
  After=network.target
28875
28880
 
28876
28881
  [Service]
28877
- Environment=DEPLOYMENT_TOOLS_PORT=3000
28882
+ Environment=DEPLOYMENT_TOOLS_DOMAIN=${domain}
28883
+ Environment=DEPLOYMENT_TOOLS_SUBDOMAIN=${subdomain}
28884
+ Environment=DEPLOYMENT_TOOLS_PORT=${port}
28878
28885
  User=root
28879
28886
  ExecStart=npx @ossy/deployment-tools start-container-manager
28880
28887
  Restart=on-failure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
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",
@@ -85,7 +85,7 @@ class CaddyClient {
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(`*.${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)
package/src/index.js CHANGED
@@ -5,6 +5,7 @@ import { exec } from 'child_process'
5
5
  import arg from 'arg'
6
6
  import { ContainerManagerServer } from './container-manager-server.js'
7
7
  import { ContainerManagerCommands } from './container-manager-commands.js'
8
+ import * as config from './config.js'
8
9
 
9
10
  const [_, __, command, ...restArgs] = process.argv
10
11
 
@@ -26,7 +27,9 @@ Description=D
26
27
  After=network.target
27
28
 
28
29
  [Service]
29
- Environment=DEPLOYMENT_TOOLS_PORT=3000
30
+ Environment=DEPLOYMENT_TOOLS_DOMAIN=${config.domain}
31
+ Environment=DEPLOYMENT_TOOLS_SUBDOMAIN=${config.subdomain}
32
+ Environment=DEPLOYMENT_TOOLS_PORT=${config.port}
30
33
  User=root
31
34
  ExecStart=npx @ossy/deployment-tools start-container-manager
32
35
  Restart=on-failure