@ossy/deployment-tools 0.0.52 → 0.0.54
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/jsdoc/AwsCredentialsService.html +166 -0
- package/jsdoc/AwsProfile.html +166 -0
- package/jsdoc/CaddyService.html +293 -0
- package/jsdoc/ContainerServer.html +265 -0
- package/jsdoc/DeploymentQueueService.html +166 -0
- package/jsdoc/DeploymentToolsService.html +166 -0
- package/jsdoc/DockerService.html +166 -0
- package/jsdoc/EstablishTrustStack.html +268 -0
- package/jsdoc/PlatformConfigService.html +166 -0
- package/jsdoc/PlatformDeploymentService.html +166 -0
- package/jsdoc/PlatformServerService.html +166 -0
- package/jsdoc/PlatformStack.html +166 -0
- package/jsdoc/PlatformTemplateService.html +502 -0
- package/jsdoc/RestApiService.html +166 -0
- package/jsdoc/aws-credentials_aws-credentials.js.html +138 -0
- package/jsdoc/config_platform-config.js.html +113 -0
- package/jsdoc/deploy_platform-deployment.js.html +155 -0
- package/jsdoc/deployment-queue_deployment-queue.js.html +132 -0
- package/jsdoc/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/jsdoc/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/jsdoc/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/jsdoc/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/jsdoc/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/jsdoc/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/jsdoc/fonts/OpenSans-Light-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/jsdoc/fonts/OpenSans-Light-webfont.woff +0 -0
- package/jsdoc/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/jsdoc/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/jsdoc/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/jsdoc/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/jsdoc/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/jsdoc/global.html +800 -0
- package/jsdoc/index.html +65 -0
- package/jsdoc/infrastructure_container-server_aws-profile.js.html +76 -0
- package/jsdoc/infrastructure_container-server_caddy.service.js.html +123 -0
- package/jsdoc/infrastructure_container-server_container-server.js.html +229 -0
- package/jsdoc/infrastructure_container-server_deployment-tools.service.js.html +91 -0
- package/jsdoc/infrastructure_establish-trust-stack.js.html +119 -0
- package/jsdoc/infrastructure_platform-stack.js.html +107 -0
- package/jsdoc/scripts/linenumber.js +25 -0
- package/jsdoc/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/jsdoc/scripts/prettify/lang-css.js +2 -0
- package/jsdoc/scripts/prettify/prettify.js +28 -0
- package/jsdoc/server_caddy.js.html +165 -0
- package/{src/server/docker.js → jsdoc/server_docker.js.html} +55 -1
- package/jsdoc/server_platform-server.js.html +91 -0
- package/jsdoc/server_rest-api.js.html +82 -0
- package/jsdoc/styles/jsdoc-default.css +358 -0
- package/jsdoc/styles/prettify-jsdoc.css +111 -0
- package/jsdoc/styles/prettify-tomorrow.css +132 -0
- package/jsdoc/template_platform-template.js.html +134 -0
- package/jsdoc.config.js +8 -12
- package/package.json +8 -7
- package/src/aws-credentials/aws-credentials.js +3 -0
- package/src/config/platform-config.js +9 -0
- package/src/deploy/platform-deployment.js +30 -0
- package/src/deployment-queue/deployment-queue.js +3 -0
- package/src/docker/docker-service.js +91 -0
- package/src/docker/docker-service.playground.js +17 -0
- package/src/docker/index.js +1 -0
- package/src/infrastructure/container-server/aws-profile.js +3 -0
- package/src/infrastructure/container-server/caddy.service.js +3 -0
- package/src/infrastructure/container-server/container-server.js +4 -0
- package/src/infrastructure/container-server/deployment-tools.service.js +3 -0
- package/src/infrastructure/establish-trust-stack.js +3 -0
- package/src/infrastructure/platform-stack.js +6 -2
- package/src/server/caddy.js +3 -0
- package/src/server/platform-server.js +6 -3
- package/src/server/rest-api.js +3 -0
- package/src/template/platform-template.js +24 -9
- package/src/types.js +0 -32
package/jsdoc.config.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
module.exports = {
|
|
3
|
-
plugins: ['plugins/markdown'],
|
|
4
3
|
recurseDepth: 10,
|
|
5
4
|
source: {
|
|
6
|
-
|
|
7
|
-
includePattern: '
|
|
8
|
-
|
|
5
|
+
include: ['src'],
|
|
6
|
+
includePattern: '\.js',
|
|
7
|
+
exclude: ['node_modules']
|
|
9
8
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
templates: {
|
|
16
|
-
cleverLinks: false,
|
|
17
|
-
monospaceLinks: false
|
|
9
|
+
opts: {
|
|
10
|
+
// template: './template',
|
|
11
|
+
destination: './jsdoc',
|
|
12
|
+
recurse: true
|
|
13
|
+
// tutorials: './tutorials'
|
|
18
14
|
}
|
|
19
15
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/deployment-tools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.54",
|
|
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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"build": "echo \"The build step is not required when using JavaScript!\" && exit 0",
|
|
10
|
-
"build:docs": "jsdoc -c
|
|
10
|
+
"build:docs": "jsdoc -c jsdoc.config.js",
|
|
11
11
|
"cdk": "cdk"
|
|
12
12
|
},
|
|
13
13
|
"author": "Ossy",
|
|
@@ -18,15 +18,16 @@
|
|
|
18
18
|
"@aws-sdk/client-sqs": "^3.186.0",
|
|
19
19
|
"@aws-sdk/client-sts": "^3.188.0",
|
|
20
20
|
"arg": "^5.0.2",
|
|
21
|
+
"aws-cdk-lib": "2.47.0",
|
|
22
|
+
"constructs": "^10.0.0",
|
|
23
|
+
"dockerode": "^3.3.4",
|
|
21
24
|
"express": "^4.18.1",
|
|
22
25
|
"nanoid": "^3.3.4",
|
|
23
|
-
"node-fetch": "^2.6.7"
|
|
24
|
-
"aws-cdk-lib": "2.47.0",
|
|
25
|
-
"constructs": "^10.0.0"
|
|
26
|
+
"node-fetch": "^2.6.7"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"jsdoc": "^3.6.11",
|
|
29
29
|
"aws-cdk": "2.47.0",
|
|
30
|
-
"jest": "^27.5.1"
|
|
30
|
+
"jest": "^27.5.1",
|
|
31
|
+
"jsdoc": "^3.6.11"
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -15,6 +15,15 @@ const SupportedDeploymentTypes = {
|
|
|
15
15
|
// Static = 'STATIC'
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// export interface PlatformConfig extends Required<Omit<PlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
19
|
+
// activeEnvironment: SupportedEnvironments;
|
|
20
|
+
// awsRoleToAssume?: string;
|
|
21
|
+
// awsKeyPairName?: string;
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @class
|
|
26
|
+
*/
|
|
18
27
|
class PlatformConfigService {
|
|
19
28
|
|
|
20
29
|
static from(template) {
|
|
@@ -5,6 +5,36 @@ const { PlatformConfigService, SupportedDeploymentTypes } = require('../config')
|
|
|
5
5
|
const { DeploymentQueueService } = require('../deployment-queue')
|
|
6
6
|
const { logError } = require('../log')
|
|
7
7
|
|
|
8
|
+
// export interface DeploymentTemplate {
|
|
9
|
+
// type: SupportedDeploymentTypes;
|
|
10
|
+
// targetDeploymentPlatform: string;
|
|
11
|
+
// subdomain?: string;
|
|
12
|
+
// env?: {
|
|
13
|
+
// shared?: { [name: string]: string | number };
|
|
14
|
+
// prod?: { [name: string]: string | number };
|
|
15
|
+
// test?: { [name: string]: string | number };
|
|
16
|
+
// qa?: { [name: string]: string | number };
|
|
17
|
+
// }
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
// export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
21
|
+
// type: SupportedDeploymentTypes.Container;
|
|
22
|
+
// dockerFile: string;
|
|
23
|
+
// dockerContext: string;
|
|
24
|
+
// image: string;
|
|
25
|
+
// hostPort: number;
|
|
26
|
+
// containerPort: number;
|
|
27
|
+
// registry: string;
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
// export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
31
|
+
// authentication?: string;
|
|
32
|
+
// username?: string;
|
|
33
|
+
// }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @class
|
|
37
|
+
*/
|
|
8
38
|
class PlatformDeploymentService {
|
|
9
39
|
|
|
10
40
|
static deploy({
|
|
@@ -7,6 +7,9 @@ const {
|
|
|
7
7
|
const { AwsCredentialsService } = require('../aws-credentials')
|
|
8
8
|
const { logInfo, logError, logDebug } = require('../log')
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @class
|
|
12
|
+
*/
|
|
10
13
|
class DeploymentQueueService {
|
|
11
14
|
|
|
12
15
|
static sendDeploymentRequest(platformConfig, deploymentRequest) {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const { exec } = require('child_process')
|
|
2
|
+
const Docker = require('dockerode')
|
|
3
|
+
|
|
4
|
+
const { logInfo } = require('../log')
|
|
5
|
+
|
|
6
|
+
// const exec = command => new Promise((resolve, reject) => {
|
|
7
|
+
// execBash('command', (error, stdout, stderr) => {
|
|
8
|
+
//
|
|
9
|
+
// if (error) {
|
|
10
|
+
// console.error(`exec error: ${error}`)
|
|
11
|
+
// return
|
|
12
|
+
// }
|
|
13
|
+
//
|
|
14
|
+
// console.log(`stdout: ${stdout}`)
|
|
15
|
+
// console.error(`stderr: ${stderr}`)
|
|
16
|
+
//
|
|
17
|
+
// command.stdout.on('data', data => {
|
|
18
|
+
// logInfo({ message: `[DockerService]: ${data}` })
|
|
19
|
+
// })
|
|
20
|
+
//
|
|
21
|
+
// command.stderr.on('data', (data) => {
|
|
22
|
+
// logError({ message: `[DockerService]: ${data}` })
|
|
23
|
+
// })
|
|
24
|
+
//
|
|
25
|
+
// })
|
|
26
|
+
// })
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @class
|
|
30
|
+
*/
|
|
31
|
+
class DockerService {
|
|
32
|
+
|
|
33
|
+
static createDockerNetworkForContainerManagerServer(platformConfig) {
|
|
34
|
+
logInfo({ message: '[DockerService] Creating docker network for comunication between containers' })
|
|
35
|
+
exec(`sudo docker network create ${platformConfig.ciDockerNetworkName}`)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static stopContainer(deploymentRequest) {
|
|
39
|
+
const name = deploymentRequest.image.replaceAll('/', '_')
|
|
40
|
+
logInfo({ message: `[DockerService] Running docker stop for image with the name of ${name}` })
|
|
41
|
+
exec(`sudo docker stop ${name}`)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static startContainer(platformConfig, { image, containerPort, hostPort, registry, env }) {
|
|
45
|
+
const name = image.replaceAll('/', '_')
|
|
46
|
+
const imageUrl = !!registry ? `${registry}/${image}` : image
|
|
47
|
+
const envsAsString = Object.entries(env || {}).reduce((envs, [name, value]) => `${envs} --env ${name}=${value}`, '')
|
|
48
|
+
logInfo({ message: `[DockerService] Running docker start for image with the name of ${name} with port mapping ${hostPort}:${containerPort} and source ${imageUrl}` })
|
|
49
|
+
exec(`sudo docker run -d -p ${hostPort}:${containerPort} --name=${name} --network=${platformConfig.ciDockerNetworkName} --network-alias=${name} --rm ${envsAsString} ${imageUrl}`)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static pullImage({ registry, username, authentication, image }) {
|
|
53
|
+
let authconfig
|
|
54
|
+
const shouldAuthenticate = username || authentication
|
|
55
|
+
|
|
56
|
+
if (shouldAuthenticate) {
|
|
57
|
+
authconfig = {
|
|
58
|
+
username: username,
|
|
59
|
+
password: authentication,
|
|
60
|
+
// auth: '',
|
|
61
|
+
// email: 'your@email.email',
|
|
62
|
+
serveraddress: registry
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
shouldAuthenticate
|
|
67
|
+
? logInfo({ message: '[DockerService] Docker credentials provided, trying to pull from private repository' })
|
|
68
|
+
: logInfo({ message: '[DockerService] No docker credentials provided, assuming image is publicly hosted' })
|
|
69
|
+
|
|
70
|
+
const docker = new Docker()
|
|
71
|
+
|
|
72
|
+
return docker.pull(image, { authconfig })
|
|
73
|
+
// .then()
|
|
74
|
+
// .catch()
|
|
75
|
+
|
|
76
|
+
// logInfo({ message: `[DockerService] Resolving docker credentials for ${registry}` })
|
|
77
|
+
// exec(`sudo docker login ${registry} -u ${username} -p ${authentication}`)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static deploy(platformConfig, deploymentRequest) {
|
|
81
|
+
logInfo({ message: '[DockerService] Starting docker deployment sequence' })
|
|
82
|
+
DockerService.stopContainer(deploymentRequest)
|
|
83
|
+
DockerService.pullImage(deploymentRequest)
|
|
84
|
+
DockerService.startContainer(platformConfig, deploymentRequest)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = {
|
|
90
|
+
DockerService
|
|
91
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { DockerService } = require('./docker-service')
|
|
2
|
+
|
|
3
|
+
DockerService.deploy(
|
|
4
|
+
{ ciDockerNetworkName: 'deployment-tools' },
|
|
5
|
+
{
|
|
6
|
+
type: 'CONTAINER',
|
|
7
|
+
dockerFile: './Dockerfile-prod',
|
|
8
|
+
dockerContext: './',
|
|
9
|
+
targetDeploymentPlatform: 'oskarssylwan',
|
|
10
|
+
image: 'mongo',
|
|
11
|
+
hostPort: '3005',
|
|
12
|
+
containerPort: '3000',
|
|
13
|
+
subdomain: 'cms',
|
|
14
|
+
env: {},
|
|
15
|
+
registry: 'ghcr.io'
|
|
16
|
+
}
|
|
17
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./docker-service')
|
|
@@ -35,6 +35,9 @@ const InstanceImages = {
|
|
|
35
35
|
UBUNTU: 'ami-092cce4a19b438926'
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @class
|
|
40
|
+
*/
|
|
38
41
|
class ContainerServer extends Construct {
|
|
39
42
|
|
|
40
43
|
/**
|
|
@@ -148,6 +151,7 @@ class ContainerServer extends Construct {
|
|
|
148
151
|
})
|
|
149
152
|
|
|
150
153
|
props.platformConfigBucket.grantRead(ec2Instance, '*')
|
|
154
|
+
props.deploymentQueue.grant(ec2Instance, '*')
|
|
151
155
|
|
|
152
156
|
// const hostedZone = !!props.createNewHostedZone
|
|
153
157
|
// ? new PublicHostedZone(this, 'HostedZone', { zoneName: props.domain })
|
|
@@ -8,6 +8,9 @@ const { ContainerServer } = require('./container-server')
|
|
|
8
8
|
|
|
9
9
|
const { SupportedDeploymentTypes } = require('../config')
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @class
|
|
13
|
+
*/
|
|
11
14
|
class PlatformStack extends Stack {
|
|
12
15
|
constructor(scope, id, props) {
|
|
13
16
|
super(scope, id, props)
|
|
@@ -20,7 +23,7 @@ class PlatformStack extends Stack {
|
|
|
20
23
|
|
|
21
24
|
if (isContainerDeploymentsEnabled) {
|
|
22
25
|
|
|
23
|
-
new Queue(this, 'DeploymentQueue', {
|
|
26
|
+
const deploymentQueue = new Queue(this, 'DeploymentQueue', {
|
|
24
27
|
queueName: `${props.config.platformName}-${props.config.activeEnvironment}`,
|
|
25
28
|
receiveMessageWaitTime: Duration.seconds(20)
|
|
26
29
|
})
|
|
@@ -40,7 +43,8 @@ class PlatformStack extends Stack {
|
|
|
40
43
|
|
|
41
44
|
new ContainerServer(this, 'ContainerServer', {
|
|
42
45
|
platformConfig: props.config,
|
|
43
|
-
platformConfigBucket: platformConfigDeployment.deployedBucket
|
|
46
|
+
platformConfigBucket: platformConfigDeployment.deployedBucket,
|
|
47
|
+
deploymentQueue: deploymentQueue
|
|
44
48
|
})
|
|
45
49
|
|
|
46
50
|
}
|
package/src/server/caddy.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
const { CaddyService } = require('./caddy')
|
|
2
|
-
const { DockerService } = require('
|
|
2
|
+
const { DockerService } = require('../docker')
|
|
3
3
|
const { RestApiService } = require('./rest-api')
|
|
4
4
|
|
|
5
5
|
const { PlatformTemplateService } = require('../template')
|
|
6
6
|
const { PlatformConfigService } = require('../config')
|
|
7
|
-
const {
|
|
7
|
+
const { DeploymentQueueService } = require('../deployment-queue')
|
|
8
8
|
const { logError } = require('../log')
|
|
9
9
|
|
|
10
10
|
// journalctl -u service-name.service
|
|
11
|
+
/**
|
|
12
|
+
* @class
|
|
13
|
+
*/
|
|
11
14
|
class PlatformServerService {
|
|
12
15
|
|
|
13
16
|
static start(platformTemplatesFilePath) {
|
|
@@ -17,7 +20,7 @@ class PlatformServerService {
|
|
|
17
20
|
RestApiService.start(platformConfig)
|
|
18
21
|
CaddyService.applyDefaultConfig(platformConfig)
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
DeploymentQueueService.pollForDeploymentRequests(
|
|
21
24
|
platformConfig,
|
|
22
25
|
deploymentRequest => {
|
|
23
26
|
DockerService.deploy(platformConfig, deploymentRequest)
|
package/src/server/rest-api.js
CHANGED
|
@@ -4,27 +4,33 @@ const { logError, logInfo } = require('../log')
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Platform template definition
|
|
7
|
-
* @namespace PlatformTemplate
|
|
8
7
|
* @typedef {Object} PlatformTemplate
|
|
9
8
|
* @property {string} platformName - Name of platform
|
|
10
9
|
* @property {string} domain - example.com
|
|
11
10
|
* @property {string[]} supportedDeploymentTypes - container
|
|
12
11
|
* @property {string[]} supportedEnvironments - qa
|
|
12
|
+
*
|
|
13
13
|
* @property {string} awsAccountId - Aws account id
|
|
14
|
-
* @property {string} awsRegion - ?
|
|
15
|
-
* @property {string} awsKeyPairName - ?
|
|
14
|
+
* @property {string=} awsRegion - ?
|
|
15
|
+
* @property {string=} awsKeyPairName - ?
|
|
16
16
|
* @property {string} awsRoleToAssume - ?
|
|
17
|
-
* @property {string} awsDeploymentSqsArn - ?
|
|
18
|
-
*
|
|
19
|
-
* @property {string}
|
|
20
|
-
* @property {string}
|
|
21
|
-
* @property {string}
|
|
17
|
+
* @property {string=} awsDeploymentSqsArn - ?
|
|
18
|
+
*
|
|
19
|
+
* @property {string=} ciSubDomain - ?
|
|
20
|
+
* @property {string|mumber=} ciInternalServerPort - ? | number;
|
|
21
|
+
* @property {string=} ciServerName - ?
|
|
22
|
+
* @property {string=} ciDockerNetworkName - ?
|
|
22
23
|
* @property {string} ciGithubActionsRepo - organisation/repoName
|
|
23
24
|
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Utility class that helps you read and validate platfor templates from file system
|
|
28
|
+
* @class
|
|
29
|
+
*/
|
|
24
30
|
class PlatformTemplateService {
|
|
25
31
|
|
|
26
32
|
/**
|
|
27
|
-
*
|
|
33
|
+
* Read and validat platform template(s) from file system
|
|
28
34
|
*
|
|
29
35
|
* @param {string} path - File path to platform templates json
|
|
30
36
|
* @return @Async {PlatformTemplate[]} - List of platform templates
|
|
@@ -57,6 +63,15 @@ class PlatformTemplateService {
|
|
|
57
63
|
return Promise.resolve(templates)
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Validates the template
|
|
68
|
+
*
|
|
69
|
+
* @param {PlatformTemplate} platformTemplate - File path to platform templates json
|
|
70
|
+
* @return @Async {PlatformTemplate} - List of platform templates
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const platformTemplate = PlatformTemplateService.readFromFile('./platforms.json')
|
|
74
|
+
*/
|
|
60
75
|
static fakeValidateTemplate(obj) {
|
|
61
76
|
// todo: implement real one
|
|
62
77
|
return obj
|
package/src/types.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// export interface PlatformConfig extends Required<Omit<PlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
2
|
-
// activeEnvironment: SupportedEnvironments;
|
|
3
|
-
// awsRoleToAssume?: string;
|
|
4
|
-
// awsKeyPairName?: string;
|
|
5
|
-
// }
|
|
6
|
-
|
|
7
|
-
// export interface DeploymentTemplate {
|
|
8
|
-
// type: SupportedDeploymentTypes;
|
|
9
|
-
// targetDeploymentPlatform: string;
|
|
10
|
-
// subdomain?: string;
|
|
11
|
-
// env?: {
|
|
12
|
-
// shared?: { [name: string]: string | number };
|
|
13
|
-
// prod?: { [name: string]: string | number };
|
|
14
|
-
// test?: { [name: string]: string | number };
|
|
15
|
-
// qa?: { [name: string]: string | number };
|
|
16
|
-
// }
|
|
17
|
-
// }
|
|
18
|
-
//
|
|
19
|
-
// export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
20
|
-
// type: SupportedDeploymentTypes.Container;
|
|
21
|
-
// dockerFile: string;
|
|
22
|
-
// dockerContext: string;
|
|
23
|
-
// image: string;
|
|
24
|
-
// hostPort: number;
|
|
25
|
-
// containerPort: number;
|
|
26
|
-
// registry: string;
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
// export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
30
|
-
// authentication?: string;
|
|
31
|
-
// username?: string;
|
|
32
|
-
// }
|