@goldstack/template-docker-image-aws 0.5.0 → 0.5.3
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/src/apiDockerImageAws.d.ts +39 -39
- package/dist/src/apiDockerImageAws.js +282 -282
- package/dist/src/infraAwsDockerImage.d.ts +7 -7
- package/dist/src/infraAwsDockerImage.js +85 -85
- package/dist/src/schemas/configSchema.json +170 -170
- package/dist/src/templateDockerImageAws.d.ts +7 -7
- package/dist/src/templateDockerImageAws.js +93 -93
- package/dist/src/types/AWSDockerImagePackage.d.ts +53 -53
- package/dist/src/types/AWSDockerImagePackage.js +2 -2
- package/package.json +19 -19
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.run = exports.getDeployment = exports.getConfig = exports.getLogs = exports.startTask = exports.runTask = exports.getDeploymentState = exports.getRepo = void 0;
|
|
7
|
-
const utils_cli_1 = require("@goldstack/utils-cli");
|
|
8
|
-
const infraAwsDockerImage_1 = require("./infraAwsDockerImage");
|
|
9
|
-
var infraAwsDockerImage_2 = require("./infraAwsDockerImage");
|
|
10
|
-
Object.defineProperty(exports, "getRepo", { enumerable: true, get: function () { return infraAwsDockerImage_2.getRepo; } });
|
|
11
|
-
Object.defineProperty(exports, "getDeploymentState", { enumerable: true, get: function () { return infraAwsDockerImage_2.getDeploymentState; } });
|
|
12
|
-
const apiDockerImageAws_1 = require("./apiDockerImageAws");
|
|
13
|
-
const yargs_1 = __importDefault(require("yargs"));
|
|
14
|
-
const utils_package_1 = require("@goldstack/utils-package");
|
|
15
|
-
const utils_terraform_1 = require("@goldstack/utils-terraform");
|
|
16
|
-
const utils_package_config_1 = require("@goldstack/utils-package-config");
|
|
17
|
-
var apiDockerImageAws_2 = require("./apiDockerImageAws");
|
|
18
|
-
Object.defineProperty(exports, "runTask", { enumerable: true, get: function () { return apiDockerImageAws_2.runTask; } });
|
|
19
|
-
Object.defineProperty(exports, "startTask", { enumerable: true, get: function () { return apiDockerImageAws_2.startTask; } });
|
|
20
|
-
Object.defineProperty(exports, "getLogs", { enumerable: true, get: function () { return apiDockerImageAws_2.getLogs; } });
|
|
21
|
-
const getConfig = () => {
|
|
22
|
-
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
23
|
-
packagePath: './',
|
|
24
|
-
});
|
|
25
|
-
return packageConfig.getConfig();
|
|
26
|
-
};
|
|
27
|
-
exports.getConfig = getConfig;
|
|
28
|
-
const getDeployment = (deploymentName) => {
|
|
29
|
-
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
30
|
-
packagePath: './',
|
|
31
|
-
});
|
|
32
|
-
return packageConfig.getDeployment(deploymentName);
|
|
33
|
-
};
|
|
34
|
-
exports.getDeployment = getDeployment;
|
|
35
|
-
const imageCommands = () => {
|
|
36
|
-
const deploymentPositional = (yargs) => {
|
|
37
|
-
return yargs.positional('deployment', {
|
|
38
|
-
type: 'string',
|
|
39
|
-
describe: 'Name of the deployment this command should be applied to',
|
|
40
|
-
demandOption: true,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
return (yargs) => {
|
|
44
|
-
return yargs
|
|
45
|
-
.command('run <deployment>', 'Runs the image', deploymentPositional)
|
|
46
|
-
.command('start <deployment>', 'Starts the image', deploymentPositional)
|
|
47
|
-
.command('logs <taskId>', 'Prints the logs for an image', (yargs) => {
|
|
48
|
-
return yargs.positional('taskId', {
|
|
49
|
-
type: 'string',
|
|
50
|
-
describe: 'Id of the tasks for which logs should be obtained.',
|
|
51
|
-
demandOption: true,
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
const run = async (args) => {
|
|
57
|
-
await (0, utils_cli_1.wrapCli)(async () => {
|
|
58
|
-
const argv = await (0, utils_package_1.buildCli)({
|
|
59
|
-
yargs: yargs_1.default,
|
|
60
|
-
deployCommands: (0, utils_package_1.buildDeployCommands)(),
|
|
61
|
-
infraCommands: (0, utils_terraform_1.infraCommands)(),
|
|
62
|
-
})
|
|
63
|
-
.command('image', 'Commands for working with images.', imageCommands())
|
|
64
|
-
.help()
|
|
65
|
-
.parse();
|
|
66
|
-
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
67
|
-
packagePath: './',
|
|
68
|
-
});
|
|
69
|
-
const config = packageConfig.getConfig();
|
|
70
|
-
const command = argv._[0];
|
|
71
|
-
const [, , , ...opArgs] = args;
|
|
72
|
-
if (command === 'infra') {
|
|
73
|
-
const deploymentName = opArgs[1];
|
|
74
|
-
const deployment = packageConfig.getDeployment(deploymentName);
|
|
75
|
-
await (0, infraAwsDockerImage_1.infraAwsDockerImageCli)(config, deployment, opArgs);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (command === 'deploy') {
|
|
79
|
-
const deploymentName = opArgs[0];
|
|
80
|
-
const deployment = packageConfig.getDeployment(deploymentName);
|
|
81
|
-
await (0, infraAwsDockerImage_1.infraAwsDockerImageCli)(config, deployment, ['deploy', ...opArgs]);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (command === 'image') {
|
|
85
|
-
const deploymentName = opArgs[1];
|
|
86
|
-
const deployment = packageConfig.getDeployment(deploymentName);
|
|
87
|
-
await (0, apiDockerImageAws_1.apiDockerImageAwsCli)(config, deployment, opArgs);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
throw new Error('Unknown command: ' + command);
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
exports.run = run;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.run = exports.getDeployment = exports.getConfig = exports.getLogs = exports.startTask = exports.runTask = exports.getDeploymentState = exports.getRepo = void 0;
|
|
7
|
+
const utils_cli_1 = require("@goldstack/utils-cli");
|
|
8
|
+
const infraAwsDockerImage_1 = require("./infraAwsDockerImage");
|
|
9
|
+
var infraAwsDockerImage_2 = require("./infraAwsDockerImage");
|
|
10
|
+
Object.defineProperty(exports, "getRepo", { enumerable: true, get: function () { return infraAwsDockerImage_2.getRepo; } });
|
|
11
|
+
Object.defineProperty(exports, "getDeploymentState", { enumerable: true, get: function () { return infraAwsDockerImage_2.getDeploymentState; } });
|
|
12
|
+
const apiDockerImageAws_1 = require("./apiDockerImageAws");
|
|
13
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
14
|
+
const utils_package_1 = require("@goldstack/utils-package");
|
|
15
|
+
const utils_terraform_1 = require("@goldstack/utils-terraform");
|
|
16
|
+
const utils_package_config_1 = require("@goldstack/utils-package-config");
|
|
17
|
+
var apiDockerImageAws_2 = require("./apiDockerImageAws");
|
|
18
|
+
Object.defineProperty(exports, "runTask", { enumerable: true, get: function () { return apiDockerImageAws_2.runTask; } });
|
|
19
|
+
Object.defineProperty(exports, "startTask", { enumerable: true, get: function () { return apiDockerImageAws_2.startTask; } });
|
|
20
|
+
Object.defineProperty(exports, "getLogs", { enumerable: true, get: function () { return apiDockerImageAws_2.getLogs; } });
|
|
21
|
+
const getConfig = () => {
|
|
22
|
+
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
23
|
+
packagePath: './',
|
|
24
|
+
});
|
|
25
|
+
return packageConfig.getConfig();
|
|
26
|
+
};
|
|
27
|
+
exports.getConfig = getConfig;
|
|
28
|
+
const getDeployment = (deploymentName) => {
|
|
29
|
+
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
30
|
+
packagePath: './',
|
|
31
|
+
});
|
|
32
|
+
return packageConfig.getDeployment(deploymentName);
|
|
33
|
+
};
|
|
34
|
+
exports.getDeployment = getDeployment;
|
|
35
|
+
const imageCommands = () => {
|
|
36
|
+
const deploymentPositional = (yargs) => {
|
|
37
|
+
return yargs.positional('deployment', {
|
|
38
|
+
type: 'string',
|
|
39
|
+
describe: 'Name of the deployment this command should be applied to',
|
|
40
|
+
demandOption: true,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
return (yargs) => {
|
|
44
|
+
return yargs
|
|
45
|
+
.command('run <deployment>', 'Runs the image', deploymentPositional)
|
|
46
|
+
.command('start <deployment>', 'Starts the image', deploymentPositional)
|
|
47
|
+
.command('logs <taskId>', 'Prints the logs for an image', (yargs) => {
|
|
48
|
+
return yargs.positional('taskId', {
|
|
49
|
+
type: 'string',
|
|
50
|
+
describe: 'Id of the tasks for which logs should be obtained.',
|
|
51
|
+
demandOption: true,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const run = async (args) => {
|
|
57
|
+
await (0, utils_cli_1.wrapCli)(async () => {
|
|
58
|
+
const argv = await (0, utils_package_1.buildCli)({
|
|
59
|
+
yargs: yargs_1.default,
|
|
60
|
+
deployCommands: (0, utils_package_1.buildDeployCommands)(),
|
|
61
|
+
infraCommands: (0, utils_terraform_1.infraCommands)(),
|
|
62
|
+
})
|
|
63
|
+
.command('image', 'Commands for working with images.', imageCommands())
|
|
64
|
+
.help()
|
|
65
|
+
.parse();
|
|
66
|
+
const packageConfig = new utils_package_config_1.PackageConfig({
|
|
67
|
+
packagePath: './',
|
|
68
|
+
});
|
|
69
|
+
const config = packageConfig.getConfig();
|
|
70
|
+
const command = argv._[0];
|
|
71
|
+
const [, , , ...opArgs] = args;
|
|
72
|
+
if (command === 'infra') {
|
|
73
|
+
const deploymentName = opArgs[1];
|
|
74
|
+
const deployment = packageConfig.getDeployment(deploymentName);
|
|
75
|
+
await (0, infraAwsDockerImage_1.infraAwsDockerImageCli)(config, deployment, opArgs);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (command === 'deploy') {
|
|
79
|
+
const deploymentName = opArgs[0];
|
|
80
|
+
const deployment = packageConfig.getDeployment(deploymentName);
|
|
81
|
+
await (0, infraAwsDockerImage_1.infraAwsDockerImageCli)(config, deployment, ['deploy', ...opArgs]);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (command === 'image') {
|
|
85
|
+
const deploymentName = opArgs[1];
|
|
86
|
+
const deployment = packageConfig.getDeployment(deploymentName);
|
|
87
|
+
await (0, apiDockerImageAws_1.apiDockerImageAwsCli)(config, deployment, opArgs);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
throw new Error('Unknown command: ' + command);
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
exports.run = run;
|
|
94
94
|
//# sourceMappingURL=templateDockerImageAws.js.map
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { Package, Configuration } from '@goldstack/utils-package';
|
|
2
|
-
import { AWSDeployment } from '@goldstack/infra-aws';
|
|
3
|
-
import { TerraformDeployment } from '@goldstack/utils-terraform';
|
|
4
|
-
import { Deployment } from '@goldstack/infra';
|
|
5
|
-
/**
|
|
6
|
-
* Defines the name for the docker repository. This name must be unique in the AWS region.
|
|
7
|
-
*
|
|
8
|
-
* @title Repository Name
|
|
9
|
-
*/
|
|
10
|
-
declare type RepositoryName = string;
|
|
11
|
-
export interface AWSDockerImageDeploymentConfiguration {
|
|
12
|
-
repositoryName: RepositoryName;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Configures a static website deployment.
|
|
16
|
-
*
|
|
17
|
-
* @title Deployment
|
|
18
|
-
*/
|
|
19
|
-
export interface AWSDockerImageDeployment extends Deployment, AWSDeployment, TerraformDeployment {
|
|
20
|
-
configuration: AWSDockerImageDeploymentConfiguration;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Places where the website should be deployed to.
|
|
24
|
-
*
|
|
25
|
-
* @title Deployments
|
|
26
|
-
*/
|
|
27
|
-
export declare type Deployments = AWSDockerImageDeployment[];
|
|
28
|
-
/**
|
|
29
|
-
* Defines the tag for identifying the docker image.
|
|
30
|
-
*
|
|
31
|
-
* @title Image Tag
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
declare type ImageTag = string;
|
|
35
|
-
/**
|
|
36
|
-
* Configures a docker image deployed to AWS.
|
|
37
|
-
*
|
|
38
|
-
* @title AWS Docker Image Configuration
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
export interface AWSDockerImagePackageConfiguration extends Configuration {
|
|
42
|
-
imageTag: ImageTag;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A docker image hosted on AWS.
|
|
46
|
-
*
|
|
47
|
-
* @title AWS Docker Image Package
|
|
48
|
-
*/
|
|
49
|
-
export interface AWSDockerImagePackage extends Package {
|
|
50
|
-
configuration: AWSDockerImagePackageConfiguration;
|
|
51
|
-
deployments: Deployments;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
1
|
+
import { Package, Configuration } from '@goldstack/utils-package';
|
|
2
|
+
import { AWSDeployment } from '@goldstack/infra-aws';
|
|
3
|
+
import { TerraformDeployment } from '@goldstack/utils-terraform';
|
|
4
|
+
import { Deployment } from '@goldstack/infra';
|
|
5
|
+
/**
|
|
6
|
+
* Defines the name for the docker repository. This name must be unique in the AWS region.
|
|
7
|
+
*
|
|
8
|
+
* @title Repository Name
|
|
9
|
+
*/
|
|
10
|
+
declare type RepositoryName = string;
|
|
11
|
+
export interface AWSDockerImageDeploymentConfiguration {
|
|
12
|
+
repositoryName: RepositoryName;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configures a static website deployment.
|
|
16
|
+
*
|
|
17
|
+
* @title Deployment
|
|
18
|
+
*/
|
|
19
|
+
export interface AWSDockerImageDeployment extends Deployment, AWSDeployment, TerraformDeployment {
|
|
20
|
+
configuration: AWSDockerImageDeploymentConfiguration;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Places where the website should be deployed to.
|
|
24
|
+
*
|
|
25
|
+
* @title Deployments
|
|
26
|
+
*/
|
|
27
|
+
export declare type Deployments = AWSDockerImageDeployment[];
|
|
28
|
+
/**
|
|
29
|
+
* Defines the tag for identifying the docker image.
|
|
30
|
+
*
|
|
31
|
+
* @title Image Tag
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
declare type ImageTag = string;
|
|
35
|
+
/**
|
|
36
|
+
* Configures a docker image deployed to AWS.
|
|
37
|
+
*
|
|
38
|
+
* @title AWS Docker Image Configuration
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
export interface AWSDockerImagePackageConfiguration extends Configuration {
|
|
42
|
+
imageTag: ImageTag;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A docker image hosted on AWS.
|
|
46
|
+
*
|
|
47
|
+
* @title AWS Docker Image Package
|
|
48
|
+
*/
|
|
49
|
+
export interface AWSDockerImagePackage extends Package {
|
|
50
|
+
configuration: AWSDockerImagePackageConfiguration;
|
|
51
|
+
deployments: Deployments;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
54
|
//# sourceMappingURL=AWSDockerImagePackage.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=AWSDockerImagePackage.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/template-docker-image-aws",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Utilities for packages that are deployed as Docker Images using AWS Fargate",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -45,29 +45,29 @@
|
|
|
45
45
|
"version:apply:force": "yarn version $@ && yarn version apply"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@goldstack/infra": "0.4.
|
|
49
|
-
"@goldstack/infra-aws": "0.4.
|
|
50
|
-
"@goldstack/utils-aws-cli": "0.4.
|
|
51
|
-
"@goldstack/utils-cli": "0.3.
|
|
52
|
-
"@goldstack/utils-config": "0.4.
|
|
53
|
-
"@goldstack/utils-docker": "0.4.
|
|
54
|
-
"@goldstack/utils-git": "0.2.
|
|
55
|
-
"@goldstack/utils-log": "0.3.
|
|
56
|
-
"@goldstack/utils-package": "0.4.
|
|
57
|
-
"@goldstack/utils-package-config": "0.4.
|
|
58
|
-
"@goldstack/utils-s3-deployment": "0.5.
|
|
59
|
-
"@goldstack/utils-sh": "0.5.
|
|
60
|
-
"@goldstack/utils-template": "0.4.
|
|
61
|
-
"@goldstack/utils-terraform": "0.4.
|
|
62
|
-
"@goldstack/utils-terraform-aws": "0.4.
|
|
48
|
+
"@goldstack/infra": "0.4.2",
|
|
49
|
+
"@goldstack/infra-aws": "0.4.3",
|
|
50
|
+
"@goldstack/utils-aws-cli": "0.4.3",
|
|
51
|
+
"@goldstack/utils-cli": "0.3.2",
|
|
52
|
+
"@goldstack/utils-config": "0.4.2",
|
|
53
|
+
"@goldstack/utils-docker": "0.4.2",
|
|
54
|
+
"@goldstack/utils-git": "0.2.2",
|
|
55
|
+
"@goldstack/utils-log": "0.3.2",
|
|
56
|
+
"@goldstack/utils-package": "0.4.2",
|
|
57
|
+
"@goldstack/utils-package-config": "0.4.2",
|
|
58
|
+
"@goldstack/utils-s3-deployment": "0.5.3",
|
|
59
|
+
"@goldstack/utils-sh": "0.5.2",
|
|
60
|
+
"@goldstack/utils-template": "0.4.2",
|
|
61
|
+
"@goldstack/utils-terraform": "0.4.3",
|
|
62
|
+
"@goldstack/utils-terraform-aws": "0.4.3",
|
|
63
63
|
"aws-sdk": "2.1055.0",
|
|
64
64
|
"source-map-support": "^0.5.21",
|
|
65
65
|
"yargs": "^17.5.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@goldstack/utils-git": "0.2.
|
|
69
|
-
"@goldstack/utils-package-config-generate": "0.3.
|
|
70
|
-
"@types/jest": "^
|
|
68
|
+
"@goldstack/utils-git": "0.2.2",
|
|
69
|
+
"@goldstack/utils-package-config-generate": "0.3.2",
|
|
70
|
+
"@types/jest": "^29.0.1",
|
|
71
71
|
"@types/node": "^18.7.13",
|
|
72
72
|
"@types/source-map-support": "^0.5.4",
|
|
73
73
|
"@types/yargs": "^17.0.10",
|