@ossy/deployment-tools 0.0.48 → 0.0.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
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/deploy/cli.js CHANGED
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  const arg = require('arg')
3
3
  const { PlatformDeploymentService } = require('./platform-deployment')
4
- const { logInfo } = require('../log')
4
+ const { logInfo, logError } = require('../log')
5
5
 
6
- //eslint-disable-next-line no-unused-vars
7
- const [_, __, ...options] = process.argv
8
-
9
- const deploy = () => {
6
+ const deploy = options => {
10
7
  logInfo({ message: 'Running deploy command' })
11
8
 
12
9
  const parsedArgs = arg({
@@ -35,4 +32,10 @@ const deploy = () => {
35
32
  })
36
33
  }
37
34
 
38
- deploy()
35
+ module.exports = {
36
+ handler: ([command, ...options]) => {
37
+ !!command
38
+ ? { deploy }[command](options)
39
+ : logError({ message: 'No command provided' })
40
+ }
41
+ }
package/src/index.cli.js CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  const [_, __, handlerName, ...restArgs] = process.argv
5
5
 
6
- const { handler } = {
7
- aws: require('./aws-credentials/cli.js'),
8
- deploy: require('./deploy/cli.js'),
9
- template: require('./template/cli.js'),
10
- server: require('./server/cli.js')
6
+ const loadHandler = {
7
+ aws: () => require('./aws-credentials/cli.js'),
8
+ deployment: () => require('./deploy/cli.js'),
9
+ template: () => require('./template/cli.js'),
10
+ server: () => require('./server/cli.js')
11
11
  }[handlerName]
12
12
 
13
- !!handler && handler(restArgs)
13
+ !!loadHandler && loadHandler().handler(restArgs)
@@ -9,7 +9,7 @@ User=caddy
9
9
  Group=caddy
10
10
  AmbientCapabilities=CAP_NET_BIND_SERVICE
11
11
  CapabilityBoundingSet=CAP_NET_BIND_SERVICE
12
- ExecStart=/usr/bin/npx --yes @ossy/deployment-tools start --platforms /home/ubuntu/deployment-platform.json
12
+ ExecStart=/usr/bin/npx --yes @ossy/deployment-tools start --platforms /home/ubuntu/platform-config.json
13
13
  Restart=on-failure
14
14
 
15
15
  [Install]