@ossy/deployment-tools 0.0.37 → 0.0.39
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/README.md +29 -21
- package/bin/aws-credentials-client.d.ts +4 -0
- package/bin/caddy-client.d.ts +13 -0
- package/bin/ci-rest-api.d.ts +4 -0
- package/bin/cli-commands/deploy-handler.d.ts +1 -0
- package/bin/cli-commands/index.d.ts +4 -0
- package/bin/cli-commands/start-handler.d.ts +1 -0
- package/bin/cli-commands/status-handler.d.ts +1 -0
- package/bin/cli-commands/stop-handler.d.ts +1 -0
- package/bin/deployment-platform-client.d.ts +11 -0
- package/bin/deployment-queue-client.d.ts +7 -0
- package/bin/dist/aws-credentials-client.d.ts +4 -0
- package/bin/dist/caddy-client.d.ts +13 -0
- package/bin/dist/ci-rest-api.d.ts +4 -0
- package/bin/dist/cli-commands/deploy-handler.d.ts +1 -0
- package/bin/dist/cli-commands/index.d.ts +4 -0
- package/bin/dist/cli-commands/start-handler.d.ts +1 -0
- package/bin/dist/cli-commands/status-handler.d.ts +1 -0
- package/bin/dist/cli-commands/stop-handler.d.ts +1 -0
- package/bin/dist/deployment-platform-client.d.ts +11 -0
- package/bin/dist/deployment-queue-client.d.ts +7 -0
- package/bin/dist/docker-client.d.ts +8 -0
- package/bin/dist/index.cli.d.ts +1 -0
- package/bin/dist/index.d.ts +2 -0
- package/bin/dist/log/index.d.ts +3 -0
- package/bin/dist/types/index.d.ts +65 -0
- package/bin/docker-client.d.ts +8 -0
- package/bin/index.cli.d.ts +1 -0
- package/bin/index.d.ts +2 -0
- package/bin/log/index.d.ts +3 -0
- package/bin/types/index.d.ts +65 -0
- package/dist/aws-credentials-client.d.ts +4 -0
- package/dist/caddy-client.d.ts +13 -0
- package/dist/ci-rest-api.d.ts +4 -0
- package/dist/cli-commands/deploy-handler.d.ts +1 -0
- package/dist/cli-commands/index.d.ts +4 -0
- package/dist/cli-commands/start-handler.d.ts +1 -0
- package/dist/cli-commands/status-handler.d.ts +1 -0
- package/dist/cli-commands/stop-handler.d.ts +1 -0
- package/dist/deployment-platform-client.d.ts +11 -0
- package/dist/deployment-queue-client.d.ts +7 -0
- package/dist/dist/aws-credentials-client.d.ts +4 -0
- package/dist/dist/caddy-client.d.ts +13 -0
- package/dist/dist/ci-rest-api.d.ts +4 -0
- package/dist/dist/cli-commands/deploy-handler.d.ts +1 -0
- package/dist/dist/cli-commands/index.d.ts +4 -0
- package/dist/dist/cli-commands/start-handler.d.ts +1 -0
- package/dist/dist/cli-commands/status-handler.d.ts +1 -0
- package/dist/dist/cli-commands/stop-handler.d.ts +1 -0
- package/dist/dist/deployment-platform-client.d.ts +11 -0
- package/dist/dist/deployment-queue-client.d.ts +7 -0
- package/dist/dist/docker-client.d.ts +8 -0
- package/dist/dist/index.cli.d.ts +2 -0
- package/dist/dist/index.d.ts +2 -0
- package/dist/dist/log/index.d.ts +3 -0
- package/dist/dist/types/index.d.ts +65 -0
- package/dist/docker-client.d.ts +8 -0
- package/dist/index.cli.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +0 -0
- package/dist/log/index.d.ts +3 -0
- package/dist/types/index.d.ts +65 -0
- package/package.json +4 -3
- package/src/cli-commands/stop-handler.ts +1 -1
- package/tsconfig.json +3 -1
package/README.md
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
# deployment-tools
|
|
1
|
+
# @ossy/deployment-tools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Collection of scripts and tools to aid deployment of
|
|
4
|
+
containers and static files to Amazon Web Services through GitHub Actions
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Scripts
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
### start
|
|
9
|
+
Starts a node server in the background that polls an deployment queue for container deployment requests.
|
|
10
|
+
Make sure NodeJs and npm is installed and Docker and Caddy is up and running.
|
|
11
|
+
```bash
|
|
12
|
+
npx @ossy/deployment-tools start
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| status | prints the status of the node server |
|
|
19
|
-
| deploy | make a deployment, the API needs to be up and running |
|
|
15
|
+
### stop
|
|
16
|
+
Stops the deployment-tools systemd service
|
|
17
|
+
```bash
|
|
18
|
+
npx @ossy/deployment-tools stop
|
|
19
|
+
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### status
|
|
22
|
+
Prints the status of the deployment-tools systemd service
|
|
23
|
+
```bash
|
|
24
|
+
npx @ossy/deployment-tools status
|
|
25
|
+
```
|
|
22
26
|
|
|
23
|
-
###
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
### deploy
|
|
28
|
+
Sends a deployment request to the aws sqs deployment queue.
|
|
29
|
+
```bash
|
|
30
|
+
npx --yes @ossy/deployment-tools deploy \
|
|
31
|
+
--username ${{ github.actor }} \
|
|
32
|
+
--authentication ${{ secrets.GITHUB_TOKEN }} \
|
|
33
|
+
--target-env ${{ github.event.inputs.environmentName }} \
|
|
34
|
+
--platforms packages/infrastructure/bin/deployment-platforms.json \
|
|
35
|
+
--ossyfile packages/${{ github.event.inputs.packageName }}/ossy.json \
|
|
36
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare const Matchers: {
|
|
3
|
+
host: (host: any) => {
|
|
4
|
+
host: any[];
|
|
5
|
+
};
|
|
6
|
+
path: (path: any) => {
|
|
7
|
+
path: any[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class CaddyClient {
|
|
11
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void | import("node-fetch").Response>;
|
|
12
|
+
static applyDefaultServerConfig(deploymentPlatform: DeploymentPlatform): Promise<void | import("node-fetch").Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deployHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const startHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const statusHandler: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stopHandler: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeploymentPlatform, SupportedEnvironments, DeploymentTemplate } from 'types';
|
|
2
|
+
export declare class DeploymentPlatformClient {
|
|
3
|
+
static start(pathToDeploymentPlatforms: string): void;
|
|
4
|
+
static deploy(username: any, authentication: any, targetEnvironment: any, pathToDeploymentPlatforms: any, pathToOssyFile: any): Promise<void>;
|
|
5
|
+
static getDeploymentTemplates(pathToOssyFile: string): Promise<DeploymentTemplate[]>;
|
|
6
|
+
static getDeploymentPlatforms(pathToDeploymentPlatforms: string): Promise<DeploymentPlatform[]>;
|
|
7
|
+
static getEnvironmentVariables(targetEnvironment: SupportedEnvironments, deploymentRequest: DeploymentTemplate): any;
|
|
8
|
+
static resolveDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
9
|
+
static setDefaultDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
10
|
+
static setCalculatedDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
3
|
+
export declare class DeploymentQueueClient {
|
|
4
|
+
static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
5
|
+
static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>): void;
|
|
6
|
+
static createAwsSqsClient(deploymentPlatform: DeploymentPlatform): Promise<SQSClient>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare const Matchers: {
|
|
3
|
+
host: (host: any) => {
|
|
4
|
+
host: any[];
|
|
5
|
+
};
|
|
6
|
+
path: (path: any) => {
|
|
7
|
+
path: any[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class CaddyClient {
|
|
11
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void | import("node-fetch").Response>;
|
|
12
|
+
static applyDefaultServerConfig(deploymentPlatform: DeploymentPlatform): Promise<void | import("node-fetch").Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deployHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const startHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const statusHandler: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stopHandler: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeploymentPlatform, SupportedEnvironments, DeploymentTemplate } from 'types';
|
|
2
|
+
export declare class DeploymentPlatformClient {
|
|
3
|
+
static start(pathToDeploymentPlatforms: string): void;
|
|
4
|
+
static deploy(username: any, authentication: any, targetEnvironment: any, pathToDeploymentPlatforms: any, pathToOssyFile: any): Promise<void>;
|
|
5
|
+
static getDeploymentTemplates(pathToOssyFile: string): Promise<DeploymentTemplate[]>;
|
|
6
|
+
static getDeploymentPlatforms(pathToDeploymentPlatforms: string): Promise<DeploymentPlatform[]>;
|
|
7
|
+
static getEnvironmentVariables(targetEnvironment: SupportedEnvironments, deploymentRequest: DeploymentTemplate): any;
|
|
8
|
+
static resolveDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
9
|
+
static setDefaultDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
10
|
+
static setCalculatedDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
3
|
+
export declare class DeploymentQueueClient {
|
|
4
|
+
static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
5
|
+
static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>): void;
|
|
6
|
+
static createAwsSqsClient(deploymentPlatform: DeploymentPlatform): Promise<SQSClient>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare class DockerClient {
|
|
3
|
+
static createDockerNetworkForContainerManagerServer(deploymentPlatform: DeploymentPlatform): void;
|
|
4
|
+
static stopContainer(deploymentRequest: ContainerDeploymentRequest): string;
|
|
5
|
+
static startContainer(deploymentPlatform: any, { image, containerPort, hostPort, registry, env }: ContainerDeploymentRequest): string;
|
|
6
|
+
static resolveCredentials({ registry, username, authentication }: ContainerDeploymentRequest): string;
|
|
7
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface DeploymentPlatformTemplate {
|
|
2
|
+
platformName: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
supportedDeploymentTypes: SupportedDeploymentTypes[];
|
|
5
|
+
supportedEnvironments: SupportedEnvironments[];
|
|
6
|
+
awsRegion?: string;
|
|
7
|
+
awsAccountId: string;
|
|
8
|
+
awsKeyPairName?: string;
|
|
9
|
+
awsRoleToAssume?: string;
|
|
10
|
+
awsDeploymentSqsArn?: string;
|
|
11
|
+
ciSubDomain?: string;
|
|
12
|
+
ciInternalServerPort?: string | number;
|
|
13
|
+
ciServerName?: string;
|
|
14
|
+
ciDockerNetworkName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeploymentPlatform extends Required<Omit<DeploymentPlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
17
|
+
activeEnvironment: SupportedEnvironments;
|
|
18
|
+
awsRoleToAssume?: string;
|
|
19
|
+
awsKeyPairName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SupportedRegions {
|
|
22
|
+
North = "eu-north-1"
|
|
23
|
+
}
|
|
24
|
+
export declare enum SupportedEnvironments {
|
|
25
|
+
LOCAL = "local",
|
|
26
|
+
QA = "qa",
|
|
27
|
+
TEST = "test",
|
|
28
|
+
DEMO = "demo",
|
|
29
|
+
PROD = "prod"
|
|
30
|
+
}
|
|
31
|
+
export declare enum SupportedDeploymentTypes {
|
|
32
|
+
Container = "CONTAINER"
|
|
33
|
+
}
|
|
34
|
+
export interface DeploymentTemplate {
|
|
35
|
+
type: SupportedDeploymentTypes;
|
|
36
|
+
targetDeploymentPlatform: string;
|
|
37
|
+
subdomain?: string;
|
|
38
|
+
env?: {
|
|
39
|
+
shared?: {
|
|
40
|
+
[name: string]: string | number;
|
|
41
|
+
};
|
|
42
|
+
prod?: {
|
|
43
|
+
[name: string]: string | number;
|
|
44
|
+
};
|
|
45
|
+
test?: {
|
|
46
|
+
[name: string]: string | number;
|
|
47
|
+
};
|
|
48
|
+
qa?: {
|
|
49
|
+
[name: string]: string | number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
54
|
+
type: SupportedDeploymentTypes.Container;
|
|
55
|
+
dockerFile: string;
|
|
56
|
+
dockerContext: string;
|
|
57
|
+
image: string;
|
|
58
|
+
hostPort: number;
|
|
59
|
+
containerPort: number;
|
|
60
|
+
registry: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
63
|
+
authentication?: string;
|
|
64
|
+
username?: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare class DockerClient {
|
|
3
|
+
static createDockerNetworkForContainerManagerServer(deploymentPlatform: DeploymentPlatform): void;
|
|
4
|
+
static stopContainer(deploymentRequest: ContainerDeploymentRequest): string;
|
|
5
|
+
static startContainer(deploymentPlatform: any, { image, containerPort, hostPort, registry, env }: ContainerDeploymentRequest): string;
|
|
6
|
+
static resolveCredentials({ registry, username, authentication }: ContainerDeploymentRequest): string;
|
|
7
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/bin/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface DeploymentPlatformTemplate {
|
|
2
|
+
platformName: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
supportedDeploymentTypes: SupportedDeploymentTypes[];
|
|
5
|
+
supportedEnvironments: SupportedEnvironments[];
|
|
6
|
+
awsRegion?: string;
|
|
7
|
+
awsAccountId: string;
|
|
8
|
+
awsKeyPairName?: string;
|
|
9
|
+
awsRoleToAssume?: string;
|
|
10
|
+
awsDeploymentSqsArn?: string;
|
|
11
|
+
ciSubDomain?: string;
|
|
12
|
+
ciInternalServerPort?: string | number;
|
|
13
|
+
ciServerName?: string;
|
|
14
|
+
ciDockerNetworkName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeploymentPlatform extends Required<Omit<DeploymentPlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
17
|
+
activeEnvironment: SupportedEnvironments;
|
|
18
|
+
awsRoleToAssume?: string;
|
|
19
|
+
awsKeyPairName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SupportedRegions {
|
|
22
|
+
North = "eu-north-1"
|
|
23
|
+
}
|
|
24
|
+
export declare enum SupportedEnvironments {
|
|
25
|
+
LOCAL = "local",
|
|
26
|
+
QA = "qa",
|
|
27
|
+
TEST = "test",
|
|
28
|
+
DEMO = "demo",
|
|
29
|
+
PROD = "prod"
|
|
30
|
+
}
|
|
31
|
+
export declare enum SupportedDeploymentTypes {
|
|
32
|
+
Container = "CONTAINER"
|
|
33
|
+
}
|
|
34
|
+
export interface DeploymentTemplate {
|
|
35
|
+
type: SupportedDeploymentTypes;
|
|
36
|
+
targetDeploymentPlatform: string;
|
|
37
|
+
subdomain?: string;
|
|
38
|
+
env?: {
|
|
39
|
+
shared?: {
|
|
40
|
+
[name: string]: string | number;
|
|
41
|
+
};
|
|
42
|
+
prod?: {
|
|
43
|
+
[name: string]: string | number;
|
|
44
|
+
};
|
|
45
|
+
test?: {
|
|
46
|
+
[name: string]: string | number;
|
|
47
|
+
};
|
|
48
|
+
qa?: {
|
|
49
|
+
[name: string]: string | number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
54
|
+
type: SupportedDeploymentTypes.Container;
|
|
55
|
+
dockerFile: string;
|
|
56
|
+
dockerContext: string;
|
|
57
|
+
image: string;
|
|
58
|
+
hostPort: number;
|
|
59
|
+
containerPort: number;
|
|
60
|
+
registry: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
63
|
+
authentication?: string;
|
|
64
|
+
username?: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare const Matchers: {
|
|
3
|
+
host: (host: any) => {
|
|
4
|
+
host: any[];
|
|
5
|
+
};
|
|
6
|
+
path: (path: any) => {
|
|
7
|
+
path: any[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class CaddyClient {
|
|
11
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void | import("node-fetch").Response>;
|
|
12
|
+
static applyDefaultServerConfig(deploymentPlatform: DeploymentPlatform): Promise<void | import("node-fetch").Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deployHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const startHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const statusHandler: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stopHandler: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeploymentPlatform, SupportedEnvironments, DeploymentTemplate } from 'types';
|
|
2
|
+
export declare class DeploymentPlatformClient {
|
|
3
|
+
static start(pathToDeploymentPlatforms: string): void;
|
|
4
|
+
static deploy(username: any, authentication: any, targetEnvironment: any, pathToDeploymentPlatforms: any, pathToOssyFile: any): Promise<void>;
|
|
5
|
+
static getDeploymentTemplates(pathToOssyFile: string): Promise<DeploymentTemplate[]>;
|
|
6
|
+
static getDeploymentPlatforms(pathToDeploymentPlatforms: string): Promise<DeploymentPlatform[]>;
|
|
7
|
+
static getEnvironmentVariables(targetEnvironment: SupportedEnvironments, deploymentRequest: DeploymentTemplate): any;
|
|
8
|
+
static resolveDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
9
|
+
static setDefaultDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
10
|
+
static setCalculatedDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
3
|
+
export declare class DeploymentQueueClient {
|
|
4
|
+
static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
5
|
+
static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>): void;
|
|
6
|
+
static createAwsSqsClient(deploymentPlatform: DeploymentPlatform): Promise<SQSClient>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare const Matchers: {
|
|
3
|
+
host: (host: any) => {
|
|
4
|
+
host: any[];
|
|
5
|
+
};
|
|
6
|
+
path: (path: any) => {
|
|
7
|
+
path: any[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class CaddyClient {
|
|
11
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void | import("node-fetch").Response>;
|
|
12
|
+
static applyDefaultServerConfig(deploymentPlatform: DeploymentPlatform): Promise<void | import("node-fetch").Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deployHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const startHandler: (cliArgs: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const statusHandler: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stopHandler: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeploymentPlatform, SupportedEnvironments, DeploymentTemplate } from 'types';
|
|
2
|
+
export declare class DeploymentPlatformClient {
|
|
3
|
+
static start(pathToDeploymentPlatforms: string): void;
|
|
4
|
+
static deploy(username: any, authentication: any, targetEnvironment: any, pathToDeploymentPlatforms: any, pathToOssyFile: any): Promise<void>;
|
|
5
|
+
static getDeploymentTemplates(pathToOssyFile: string): Promise<DeploymentTemplate[]>;
|
|
6
|
+
static getDeploymentPlatforms(pathToDeploymentPlatforms: string): Promise<DeploymentPlatform[]>;
|
|
7
|
+
static getEnvironmentVariables(targetEnvironment: SupportedEnvironments, deploymentRequest: DeploymentTemplate): any;
|
|
8
|
+
static resolveDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
9
|
+
static setDefaultDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
10
|
+
static setCalculatedDeploymentPlatformValues(deploymentPlatform: DeploymentPlatform): DeploymentPlatform;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
3
|
+
export declare class DeploymentQueueClient {
|
|
4
|
+
static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
5
|
+
static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>): void;
|
|
6
|
+
static createAwsSqsClient(deploymentPlatform: DeploymentPlatform): Promise<SQSClient>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare class DockerClient {
|
|
3
|
+
static createDockerNetworkForContainerManagerServer(deploymentPlatform: DeploymentPlatform): void;
|
|
4
|
+
static stopContainer(deploymentRequest: ContainerDeploymentRequest): string;
|
|
5
|
+
static startContainer(deploymentPlatform: any, { image, containerPort, hostPort, registry, env }: ContainerDeploymentRequest): string;
|
|
6
|
+
static resolveCredentials({ registry, username, authentication }: ContainerDeploymentRequest): string;
|
|
7
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface DeploymentPlatformTemplate {
|
|
2
|
+
platformName: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
supportedDeploymentTypes: SupportedDeploymentTypes[];
|
|
5
|
+
supportedEnvironments: SupportedEnvironments[];
|
|
6
|
+
awsRegion?: string;
|
|
7
|
+
awsAccountId: string;
|
|
8
|
+
awsKeyPairName?: string;
|
|
9
|
+
awsRoleToAssume?: string;
|
|
10
|
+
awsDeploymentSqsArn?: string;
|
|
11
|
+
ciSubDomain?: string;
|
|
12
|
+
ciInternalServerPort?: string | number;
|
|
13
|
+
ciServerName?: string;
|
|
14
|
+
ciDockerNetworkName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeploymentPlatform extends Required<Omit<DeploymentPlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
17
|
+
activeEnvironment: SupportedEnvironments;
|
|
18
|
+
awsRoleToAssume?: string;
|
|
19
|
+
awsKeyPairName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SupportedRegions {
|
|
22
|
+
North = "eu-north-1"
|
|
23
|
+
}
|
|
24
|
+
export declare enum SupportedEnvironments {
|
|
25
|
+
LOCAL = "local",
|
|
26
|
+
QA = "qa",
|
|
27
|
+
TEST = "test",
|
|
28
|
+
DEMO = "demo",
|
|
29
|
+
PROD = "prod"
|
|
30
|
+
}
|
|
31
|
+
export declare enum SupportedDeploymentTypes {
|
|
32
|
+
Container = "CONTAINER"
|
|
33
|
+
}
|
|
34
|
+
export interface DeploymentTemplate {
|
|
35
|
+
type: SupportedDeploymentTypes;
|
|
36
|
+
targetDeploymentPlatform: string;
|
|
37
|
+
subdomain?: string;
|
|
38
|
+
env?: {
|
|
39
|
+
shared?: {
|
|
40
|
+
[name: string]: string | number;
|
|
41
|
+
};
|
|
42
|
+
prod?: {
|
|
43
|
+
[name: string]: string | number;
|
|
44
|
+
};
|
|
45
|
+
test?: {
|
|
46
|
+
[name: string]: string | number;
|
|
47
|
+
};
|
|
48
|
+
qa?: {
|
|
49
|
+
[name: string]: string | number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
54
|
+
type: SupportedDeploymentTypes.Container;
|
|
55
|
+
dockerFile: string;
|
|
56
|
+
dockerContext: string;
|
|
57
|
+
image: string;
|
|
58
|
+
hostPort: number;
|
|
59
|
+
containerPort: number;
|
|
60
|
+
registry: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
63
|
+
authentication?: string;
|
|
64
|
+
username?: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types';
|
|
2
|
+
export declare class DockerClient {
|
|
3
|
+
static createDockerNetworkForContainerManagerServer(deploymentPlatform: DeploymentPlatform): void;
|
|
4
|
+
static stopContainer(deploymentRequest: ContainerDeploymentRequest): string;
|
|
5
|
+
static startContainer(deploymentPlatform: any, { image, containerPort, hostPort, registry, env }: ContainerDeploymentRequest): string;
|
|
6
|
+
static resolveCredentials({ registry, username, authentication }: ContainerDeploymentRequest): string;
|
|
7
|
+
static deploy(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest): Promise<void>;
|
|
8
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface DeploymentPlatformTemplate {
|
|
2
|
+
platformName: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
supportedDeploymentTypes: SupportedDeploymentTypes[];
|
|
5
|
+
supportedEnvironments: SupportedEnvironments[];
|
|
6
|
+
awsRegion?: string;
|
|
7
|
+
awsAccountId: string;
|
|
8
|
+
awsKeyPairName?: string;
|
|
9
|
+
awsRoleToAssume?: string;
|
|
10
|
+
awsDeploymentSqsArn?: string;
|
|
11
|
+
ciSubDomain?: string;
|
|
12
|
+
ciInternalServerPort?: string | number;
|
|
13
|
+
ciServerName?: string;
|
|
14
|
+
ciDockerNetworkName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeploymentPlatform extends Required<Omit<DeploymentPlatformTemplate, 'awsRoleToAssume' | 'awsKeyPairName'>> {
|
|
17
|
+
activeEnvironment: SupportedEnvironments;
|
|
18
|
+
awsRoleToAssume?: string;
|
|
19
|
+
awsKeyPairName?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare enum SupportedRegions {
|
|
22
|
+
North = "eu-north-1"
|
|
23
|
+
}
|
|
24
|
+
export declare enum SupportedEnvironments {
|
|
25
|
+
LOCAL = "local",
|
|
26
|
+
QA = "qa",
|
|
27
|
+
TEST = "test",
|
|
28
|
+
DEMO = "demo",
|
|
29
|
+
PROD = "prod"
|
|
30
|
+
}
|
|
31
|
+
export declare enum SupportedDeploymentTypes {
|
|
32
|
+
Container = "CONTAINER"
|
|
33
|
+
}
|
|
34
|
+
export interface DeploymentTemplate {
|
|
35
|
+
type: SupportedDeploymentTypes;
|
|
36
|
+
targetDeploymentPlatform: string;
|
|
37
|
+
subdomain?: string;
|
|
38
|
+
env?: {
|
|
39
|
+
shared?: {
|
|
40
|
+
[name: string]: string | number;
|
|
41
|
+
};
|
|
42
|
+
prod?: {
|
|
43
|
+
[name: string]: string | number;
|
|
44
|
+
};
|
|
45
|
+
test?: {
|
|
46
|
+
[name: string]: string | number;
|
|
47
|
+
};
|
|
48
|
+
qa?: {
|
|
49
|
+
[name: string]: string | number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ContainerDeploymentTemplate extends DeploymentTemplate {
|
|
54
|
+
type: SupportedDeploymentTypes.Container;
|
|
55
|
+
dockerFile: string;
|
|
56
|
+
dockerContext: string;
|
|
57
|
+
image: string;
|
|
58
|
+
hostPort: number;
|
|
59
|
+
containerPort: number;
|
|
60
|
+
registry: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ContainerDeploymentRequest extends ContainerDeploymentTemplate {
|
|
63
|
+
authentication?: string;
|
|
64
|
+
username?: string;
|
|
65
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/deployment-tools",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Collection of scripts and tools to aid deployment of containers and static files",
|
|
5
|
-
"main": "dist/index.js",
|
|
3
|
+
"version": "0.0.39",
|
|
4
|
+
"description": "Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions",
|
|
6
5
|
"type": "module",
|
|
6
|
+
"types": "dist/index.d.ts" ,
|
|
7
|
+
"main": "dist/index.js",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
10
|
"build": "npm run build:public-exports && npm run build:cli",
|