@ossy/deployment-tools 0.0.47 → 0.0.48
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/cdk.json +1 -1
- package/jsdoc.config.js +19 -0
- package/package.json +4 -9
- package/src/aws-credentials/cli.js +9 -9
- package/src/index.cli.js +13 -0
- package/src/server/cli.js +11 -11
- package/src/template/cli.js +8 -6
package/cdk.json
CHANGED
package/jsdoc.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
plugins: ['plugins/markdown'],
|
|
4
|
+
recurseDepth: 10,
|
|
5
|
+
source: {
|
|
6
|
+
// includePattern: '.+\\.js(doc|x)?$',
|
|
7
|
+
includePattern: '.+\\.js$',
|
|
8
|
+
excludePattern: '(^|\\/|\\\\)_'
|
|
9
|
+
},
|
|
10
|
+
sourceType: 'module',
|
|
11
|
+
tags: {
|
|
12
|
+
allowUnknownTags: true,
|
|
13
|
+
dictionaries: ['jsdoc', 'closure']
|
|
14
|
+
},
|
|
15
|
+
templates: {
|
|
16
|
+
cleverLinks: false,
|
|
17
|
+
monospaceLinks: false
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/deployment-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"description": "Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions",
|
|
5
|
+
"source": "./src/index.js",
|
|
5
6
|
"main": "./src/index.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
9
|
"build": "echo \"The build step is not required when using JavaScript!\" && exit 0",
|
|
9
|
-
"build:docs": "jsdoc ./src/index.js ./package.json",
|
|
10
|
+
"build:docs": "jsdoc -c ./jsdoc.config.js ./src/index.js ./package.json",
|
|
10
11
|
"cdk": "cdk"
|
|
11
12
|
},
|
|
12
13
|
"author": "Ossy",
|
|
13
14
|
"license": "ISC",
|
|
14
|
-
"bin":
|
|
15
|
-
"aws": "./src/aws-credentials/cli.js",
|
|
16
|
-
"deploy": "./src/deploy/cli.js",
|
|
17
|
-
"template": "./src/template/cli.js",
|
|
18
|
-
"server": "./src/server/cli.js",
|
|
19
|
-
"infrastructure": "./src/infrastructure/cli.js"
|
|
20
|
-
},
|
|
15
|
+
"bin": "./src/index.cli.js",
|
|
21
16
|
"dependencies": {
|
|
22
17
|
"@actions/core": "^1.10.0",
|
|
23
18
|
"@aws-sdk/client-sqs": "^3.186.0",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
const arg = require('arg')
|
|
3
2
|
const { AwsCredentialsService } = require('./aws-credentials')
|
|
4
3
|
|
|
@@ -6,10 +5,7 @@ const { PlatformTemplateService } = require('../template')
|
|
|
6
5
|
const { PlatformConfigService } = require('../config')
|
|
7
6
|
const { logInfo, logError } = require('../log')
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
const [_, __, command, ...options] = process.argv
|
|
11
|
-
|
|
12
|
-
const resolveCredentials = () => {
|
|
8
|
+
const resolveCredentials = options => {
|
|
13
9
|
logInfo({ message: 'resolve-credentials' })
|
|
14
10
|
|
|
15
11
|
const parsedArgs = arg({
|
|
@@ -25,7 +21,7 @@ const resolveCredentials = () => {
|
|
|
25
21
|
})
|
|
26
22
|
}
|
|
27
23
|
|
|
28
|
-
const assumeRole =
|
|
24
|
+
const assumeRole = options => {
|
|
29
25
|
logInfo({ message: 'assume-role' })
|
|
30
26
|
|
|
31
27
|
const parsedArgs = arg({
|
|
@@ -51,6 +47,10 @@ const assumeRole = () => {
|
|
|
51
47
|
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
module.exports = {
|
|
51
|
+
handler: ([command, ...options]) => {
|
|
52
|
+
!!command
|
|
53
|
+
? { 'resolve-credentials': resolveCredentials, 'assume-role': assumeRole }[command](options)
|
|
54
|
+
: logError({ message: 'No command provided' })
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/index.cli.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable global-require, no-unused-vars */
|
|
3
|
+
|
|
4
|
+
const [_, __, handlerName, ...restArgs] = process.argv
|
|
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')
|
|
11
|
+
}[handlerName]
|
|
12
|
+
|
|
13
|
+
!!handler && handler(restArgs)
|
package/src/server/cli.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
const arg = require('arg')
|
|
3
2
|
const { exec } = require('child_process')
|
|
4
|
-
const {
|
|
3
|
+
const { PlatformServerService } = require('./platform-server')
|
|
5
4
|
|
|
6
5
|
const { logInfo, logError } = require('../log')
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
const [_, __, command, ...restArgs] = process.argv
|
|
10
|
-
|
|
11
|
-
const start = cliArgs => {
|
|
7
|
+
const start = options => {
|
|
12
8
|
logInfo({ message: 'Running start command' })
|
|
13
9
|
|
|
14
10
|
const parsedArgs = arg({
|
|
15
11
|
'--platforms': String,
|
|
16
12
|
'-p': '--platforms'
|
|
17
|
-
}, { argv:
|
|
13
|
+
}, { argv: options })
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
PlatformServerService.start(parsedArgs['--platforms'])
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
const status = () => {
|
|
@@ -29,6 +25,10 @@ const stop = () => {
|
|
|
29
25
|
exec('systemctl stop deployment-tools.service')
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
module.exports = {
|
|
29
|
+
handler: ([command, ...options]) => {
|
|
30
|
+
!!command
|
|
31
|
+
? { start, status, stop }[command](options)
|
|
32
|
+
: logError({ message: 'No command provided' })
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/template/cli.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
const arg = require('arg')
|
|
3
2
|
const { PlatformTemplateService } = require('./platform-template')
|
|
4
3
|
|
|
5
4
|
const { logInfo, logError } = require('../log')
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
const [_, __, command, ...options] = process.argv
|
|
9
|
-
|
|
10
|
-
const validate = () => {
|
|
6
|
+
const validate = options => {
|
|
11
7
|
logInfo({ message: 'Running validate command' })
|
|
12
8
|
|
|
13
9
|
const parsedArgs = arg({
|
|
@@ -19,4 +15,10 @@ const validate = () => {
|
|
|
19
15
|
.then(() => logInfo({ message: 'Template is valid' }))
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
module.exports = {
|
|
19
|
+
handler: ([command, ...options]) => {
|
|
20
|
+
!!command
|
|
21
|
+
? { validate }[command](options)
|
|
22
|
+
: logError({ message: 'No command provided' })
|
|
23
|
+
}
|
|
24
|
+
}
|