dcdx 1.2.0-next.5 → 1.2.0-next.7
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/assets/{quickreload-5.0.2.jar → quickreload-5.0.4.jar} +0 -0
- package/assets/versions.json +1 -1
- package/lib/commands/build.js +8510 -1
- package/lib/commands/database.js +8441 -1
- package/lib/commands/debug.js +9257 -0
- package/lib/commands/profile.js +2 -1
- package/lib/commands/reset.js +9194 -1
- package/lib/commands/run.js +9227 -1
- package/lib/commands/stop.js +9191 -1
- package/lib/index.js +93 -1
- package/lib/types/src/applications/bamboo.d.ts +4 -6
- package/lib/types/src/applications/base.d.ts +8 -12
- package/lib/types/src/applications/bitbucket.d.ts +4 -6
- package/lib/types/src/applications/confluence.d.ts +4 -6
- package/lib/types/src/applications/jira.d.ts +4 -6
- package/lib/types/src/databases/base.d.ts +7 -15
- package/lib/types/src/databases/mssql.d.ts +3 -12
- package/lib/types/src/databases/mysql.d.ts +3 -12
- package/lib/types/src/databases/postgres.d.ts +3 -12
- package/lib/types/src/helpers/ActionHandler.d.ts +39 -0
- package/lib/types/src/helpers/FileWatcher.d.ts +3 -0
- package/lib/types/src/helpers/amps.d.ts +22 -12
- package/lib/types/src/helpers/docker.d.ts +3 -5
- package/lib/types/src/helpers/getApplication.d.ts +2 -6
- package/lib/types/src/helpers/getDatabaseEngine.d.ts +2 -0
- package/lib/types/src/helpers/getZodDefaults.d.ts +3 -0
- package/lib/types/src/helpers/licences.d.ts +2 -2
- package/lib/types/src/helpers/showHelpWithDefaultCommandOptions.d.ts +2 -0
- package/lib/types/src/types/AMPS.d.ts +96 -0
- package/lib/types/src/types/Application.d.ts +65 -0
- package/lib/types/src/types/Database.d.ts +169 -0
- package/package.json +10 -5
- package/lib/commands/database/mssql.js +0 -2
- package/lib/commands/database/mysql.js +0 -2
- package/lib/commands/database/postgres.js +0 -2
- package/lib/commands/reset/bamboo.js +0 -2
- package/lib/commands/reset/bitbucket.js +0 -2
- package/lib/commands/reset/confluence.js +0 -2
- package/lib/commands/reset/jira.js +0 -2
- package/lib/commands/run/bamboo.js +0 -2
- package/lib/commands/run/bitbucket.js +0 -2
- package/lib/commands/run/confluence.js +0 -2
- package/lib/commands/run/jira.js +0 -2
- package/lib/commands/start.js +0 -2
- package/lib/commands/stop/bamboo.js +0 -2
- package/lib/commands/stop/bitbucket.js +0 -2
- package/lib/commands/stop/confluence.js +0 -2
- package/lib/commands/stop/jira.js +0 -2
- package/lib/types/src/commands/database/mysql.d.ts +0 -2
- package/lib/types/src/commands/database/postgres.d.ts +0 -2
- package/lib/types/src/commands/reset/bamboo.d.ts +0 -2
- package/lib/types/src/commands/reset/bitbucket.d.ts +0 -2
- package/lib/types/src/commands/reset/confluence.d.ts +0 -2
- package/lib/types/src/commands/reset/jira.d.ts +0 -2
- package/lib/types/src/commands/run/bamboo.d.ts +0 -2
- package/lib/types/src/commands/run/bitbucket.d.ts +0 -2
- package/lib/types/src/commands/run/confluence.d.ts +0 -2
- package/lib/types/src/commands/run/jira.d.ts +0 -2
- package/lib/types/src/commands/start.d.ts +0 -2
- package/lib/types/src/commands/stop/bamboo.d.ts +0 -2
- package/lib/types/src/commands/stop/bitbucket.d.ts +0 -2
- package/lib/types/src/commands/stop/confluence.d.ts +0 -2
- package/lib/types/src/commands/stop/jira.d.ts +0 -2
- package/lib/types/src/types/ApplicationOptions.d.ts +0 -13
- package/lib/types/src/types/DatabaseEngine.d.ts +0 -17
- package/lib/types/src/types/DatabaseOptions.d.ts +0 -9
- package/lib/types/src/types/SupportedApplications.d.ts +0 -6
- package/lib/types/src/types/SupportedDatabaseDrivers.d.ts +0 -1
- package/lib/types/src/types/SupportedDatabaseEngines.d.ts +0 -1
- /package/lib/types/src/commands/{database/mssql.d.ts → debug.d.ts} +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface DatabaseEngine {
|
|
3
|
+
url: string;
|
|
4
|
+
options: TDatabaseOptions;
|
|
5
|
+
start(clean?: boolean): Promise<void>;
|
|
6
|
+
stop(prune?: boolean): Promise<void>;
|
|
7
|
+
run(sql: string | {
|
|
8
|
+
query: string;
|
|
9
|
+
values: unknown[];
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const SupportedDatabaseEngines: z.ZodEnum<["postgresql", "mysql", "mssql"]>;
|
|
13
|
+
export declare const SupportedMSSQLEditions: z.ZodEnum<["Developer", "Express", "Standard", "Enterprise", "EnterpriseCore"]>;
|
|
14
|
+
export declare const DatabaseOptions: z.ZodObject<{
|
|
15
|
+
name: z.ZodEnum<["postgresql", "mysql", "mssql"]>;
|
|
16
|
+
port: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>;
|
|
17
|
+
database: z.ZodDefault<z.ZodString>;
|
|
18
|
+
username: z.ZodDefault<z.ZodString>;
|
|
19
|
+
password: z.ZodDefault<z.ZodString>;
|
|
20
|
+
clean: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
prune: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
driver: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
database: string;
|
|
26
|
+
name: "postgresql" | "mysql" | "mssql";
|
|
27
|
+
port: number;
|
|
28
|
+
username: string;
|
|
29
|
+
password: string;
|
|
30
|
+
clean: boolean;
|
|
31
|
+
prune: boolean;
|
|
32
|
+
verbose: boolean;
|
|
33
|
+
driver: string;
|
|
34
|
+
}, {
|
|
35
|
+
name: "postgresql" | "mysql" | "mssql";
|
|
36
|
+
port: string | number;
|
|
37
|
+
driver: string;
|
|
38
|
+
database?: string | undefined;
|
|
39
|
+
username?: string | undefined;
|
|
40
|
+
password?: string | undefined;
|
|
41
|
+
clean?: boolean | undefined;
|
|
42
|
+
prune?: boolean | undefined;
|
|
43
|
+
verbose?: boolean | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const PostgreSQLOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
46
|
+
name: z.ZodEnum<["postgresql", "mysql", "mssql"]>;
|
|
47
|
+
port: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>;
|
|
48
|
+
database: z.ZodDefault<z.ZodString>;
|
|
49
|
+
username: z.ZodDefault<z.ZodString>;
|
|
50
|
+
password: z.ZodDefault<z.ZodString>;
|
|
51
|
+
clean: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
prune: z.ZodDefault<z.ZodBoolean>;
|
|
53
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
54
|
+
driver: z.ZodString;
|
|
55
|
+
}, {
|
|
56
|
+
name: z.ZodDefault<z.ZodEffects<z.ZodEnum<["postgresql", "mysql", "mssql"]>, "postgresql" | "mysql" | "mssql", "postgresql" | "mysql" | "mssql">>;
|
|
57
|
+
tag: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
58
|
+
port: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>>;
|
|
59
|
+
driver: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
60
|
+
}>, "strip", z.ZodTypeAny, {
|
|
61
|
+
database: string;
|
|
62
|
+
name: "postgresql" | "mysql" | "mssql";
|
|
63
|
+
port: number;
|
|
64
|
+
username: string;
|
|
65
|
+
password: string;
|
|
66
|
+
clean: boolean;
|
|
67
|
+
prune: boolean;
|
|
68
|
+
verbose: boolean;
|
|
69
|
+
driver: string;
|
|
70
|
+
tag: string;
|
|
71
|
+
}, {
|
|
72
|
+
database?: string | undefined;
|
|
73
|
+
name?: "postgresql" | "mysql" | "mssql" | undefined;
|
|
74
|
+
port?: string | number | undefined;
|
|
75
|
+
username?: string | undefined;
|
|
76
|
+
password?: string | undefined;
|
|
77
|
+
clean?: boolean | undefined;
|
|
78
|
+
prune?: boolean | undefined;
|
|
79
|
+
verbose?: boolean | undefined;
|
|
80
|
+
driver?: string | undefined;
|
|
81
|
+
tag?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const MySQLOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
84
|
+
name: z.ZodEnum<["postgresql", "mysql", "mssql"]>;
|
|
85
|
+
port: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>;
|
|
86
|
+
database: z.ZodDefault<z.ZodString>;
|
|
87
|
+
username: z.ZodDefault<z.ZodString>;
|
|
88
|
+
password: z.ZodDefault<z.ZodString>;
|
|
89
|
+
clean: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
+
prune: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
92
|
+
driver: z.ZodString;
|
|
93
|
+
}, {
|
|
94
|
+
name: z.ZodDefault<z.ZodEffects<z.ZodEnum<["postgresql", "mysql", "mssql"]>, "postgresql" | "mysql" | "mssql", "postgresql" | "mysql" | "mssql">>;
|
|
95
|
+
tag: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
96
|
+
port: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>>;
|
|
97
|
+
driver: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
98
|
+
}>, "strip", z.ZodTypeAny, {
|
|
99
|
+
database: string;
|
|
100
|
+
name: "postgresql" | "mysql" | "mssql";
|
|
101
|
+
port: number;
|
|
102
|
+
username: string;
|
|
103
|
+
password: string;
|
|
104
|
+
clean: boolean;
|
|
105
|
+
prune: boolean;
|
|
106
|
+
verbose: boolean;
|
|
107
|
+
driver: string;
|
|
108
|
+
tag: string;
|
|
109
|
+
}, {
|
|
110
|
+
database?: string | undefined;
|
|
111
|
+
name?: "postgresql" | "mysql" | "mssql" | undefined;
|
|
112
|
+
port?: string | number | undefined;
|
|
113
|
+
username?: string | undefined;
|
|
114
|
+
password?: string | undefined;
|
|
115
|
+
clean?: boolean | undefined;
|
|
116
|
+
prune?: boolean | undefined;
|
|
117
|
+
verbose?: boolean | undefined;
|
|
118
|
+
driver?: string | undefined;
|
|
119
|
+
tag?: string | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const MSSQLOptions: z.ZodObject<z.objectUtil.extendShape<{
|
|
122
|
+
name: z.ZodEnum<["postgresql", "mysql", "mssql"]>;
|
|
123
|
+
port: z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>;
|
|
124
|
+
database: z.ZodDefault<z.ZodString>;
|
|
125
|
+
username: z.ZodDefault<z.ZodString>;
|
|
126
|
+
password: z.ZodDefault<z.ZodString>;
|
|
127
|
+
clean: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
prune: z.ZodDefault<z.ZodBoolean>;
|
|
129
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
130
|
+
driver: z.ZodString;
|
|
131
|
+
}, {
|
|
132
|
+
name: z.ZodDefault<z.ZodEffects<z.ZodEnum<["postgresql", "mysql", "mssql"]>, "postgresql" | "mysql" | "mssql", "postgresql" | "mysql" | "mssql">>;
|
|
133
|
+
tag: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
134
|
+
edition: z.ZodDefault<z.ZodEnum<["Developer", "Express", "Standard", "Enterprise", "EnterpriseCore"]>>;
|
|
135
|
+
port: z.ZodDefault<z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>>;
|
|
136
|
+
username: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
137
|
+
password: z.ZodDefault<z.ZodString>;
|
|
138
|
+
driver: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
139
|
+
}>, "strip", z.ZodTypeAny, {
|
|
140
|
+
database: string;
|
|
141
|
+
name: "postgresql" | "mysql" | "mssql";
|
|
142
|
+
port: number;
|
|
143
|
+
username: string;
|
|
144
|
+
password: string;
|
|
145
|
+
clean: boolean;
|
|
146
|
+
prune: boolean;
|
|
147
|
+
verbose: boolean;
|
|
148
|
+
driver: string;
|
|
149
|
+
tag: string;
|
|
150
|
+
edition: "Developer" | "Express" | "Standard" | "Enterprise" | "EnterpriseCore";
|
|
151
|
+
}, {
|
|
152
|
+
database?: string | undefined;
|
|
153
|
+
name?: "postgresql" | "mysql" | "mssql" | undefined;
|
|
154
|
+
port?: string | number | undefined;
|
|
155
|
+
username?: string | undefined;
|
|
156
|
+
password?: string | undefined;
|
|
157
|
+
clean?: boolean | undefined;
|
|
158
|
+
prune?: boolean | undefined;
|
|
159
|
+
verbose?: boolean | undefined;
|
|
160
|
+
driver?: string | undefined;
|
|
161
|
+
tag?: string | undefined;
|
|
162
|
+
edition?: "Developer" | "Express" | "Standard" | "Enterprise" | "EnterpriseCore" | undefined;
|
|
163
|
+
}>;
|
|
164
|
+
export type TDatabaseOptions = z.infer<typeof DatabaseOptions>;
|
|
165
|
+
export type TPostgreSQLOptions = z.infer<typeof PostgreSQLOptions>;
|
|
166
|
+
export type TMySQLOptions = z.infer<typeof MySQLOptions>;
|
|
167
|
+
export type TMSSQLOptions = z.infer<typeof MSSQLOptions>;
|
|
168
|
+
export type TSupportedDatabaseEngines = z.infer<typeof SupportedDatabaseEngines>;
|
|
169
|
+
export type TSupportedMSSQLEditions = z.infer<typeof SupportedMSSQLEditions>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcdx",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.7",
|
|
4
4
|
"author": "Collabsoft <info@collabsoft.net>",
|
|
5
5
|
"description": "The Unofficial CLI for Atlassian Data Center Plugin Development",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"generate:versions": "node ./generateVersionList.mjs",
|
|
28
28
|
"watch": "yarn run nodemon --watch src -e '.ts' --exec 'yarn build'",
|
|
29
29
|
"start": "./lib/index.js",
|
|
30
|
-
"prepack": "yarn generate:versions && yarn build"
|
|
30
|
+
"prepack": "yarn generate:versions && yarn build",
|
|
31
|
+
"test": "yarn run vitest --coverage --disable-console-intercept --watch=false --silent=false",
|
|
32
|
+
"test:ui": "yarn run vitest --coverage --disable-console-intercept --silent=false --ui"
|
|
31
33
|
},
|
|
32
34
|
"repository": {
|
|
33
35
|
"type": "git",
|
|
@@ -49,9 +51,10 @@
|
|
|
49
51
|
"@types/js-yaml": "4",
|
|
50
52
|
"@types/node": "18.16.0",
|
|
51
53
|
"@types/pg": "8",
|
|
52
|
-
"@types/yargs": "17.0.32",
|
|
53
54
|
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
54
55
|
"@typescript-eslint/parser": "7.6.0",
|
|
56
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
57
|
+
"@vitest/ui": "^1.6.0",
|
|
55
58
|
"eslint": "9.0.0",
|
|
56
59
|
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
57
60
|
"nodemon": "3.1.0",
|
|
@@ -59,7 +62,9 @@
|
|
|
59
62
|
"rollup-plugin-executable": "1.6.3",
|
|
60
63
|
"semantic-release": "23.0.8",
|
|
61
64
|
"typescript": "5.4.4",
|
|
62
|
-
"typescript-eslint": "7.6.0"
|
|
65
|
+
"typescript-eslint": "7.6.0",
|
|
66
|
+
"vitest": "1.6.0",
|
|
67
|
+
"vitest-mock-process": "1.0.4"
|
|
63
68
|
},
|
|
64
69
|
"dependencies": {
|
|
65
70
|
"@xmldom/xmldom": "0.8.10",
|
|
@@ -77,7 +82,7 @@
|
|
|
77
82
|
"simple-git": "3.24.0",
|
|
78
83
|
"tedious": "18.1.0",
|
|
79
84
|
"xpath": "0.0.34",
|
|
80
|
-
"
|
|
85
|
+
"zod": "3.23.6"
|
|
81
86
|
},
|
|
82
87
|
"release": {
|
|
83
88
|
"branches": [
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as u,Option as t}from"commander";import{gracefulExit as n,asyncExitHook as e}from"exit-hook";import{spawn as o}from"child_process";import{upAll as s}from"docker-compose";import{stop as a,downAll as i,ps as r}from"docker-compose/dist/v2.js";import b from"events";import{dump as C}from"js-yaml";import{cwd as U}from"process";import{Sequelize as c,ConnectionError as p,TimeoutError as d,ConnectionTimedOutError as l,ConnectionRefusedError as h,ConnectionAcquireTimeoutError as m}from"sequelize";var g=["2017-CU1-ubuntu","2017-CU10","2017-CU10-ubuntu","2017-CU11","2017-CU11-ubuntu","2017-CU12","2017-CU12-ubuntu","2017-CU13","2017-CU13-ubuntu","2017-CU14","2017-CU14-ubuntu","2017-CU15","2017-CU15-GDR","2017-CU15-GDR-ubuntu","2017-CU15-GDR1-ubuntu-16.04","2017-CU15-ubuntu","2017-CU16","2017-CU16-ubuntu","2017-CU17","2017-CU17-ubuntu","2017-CU18-ubuntu-16.04","2017-CU19-ubuntu-16.04","2017-CU2-ubuntu","2017-CU20","2017-CU20-ubuntu","2017-CU20-ubuntu-16.04","2017-CU21-ubuntu-16.04","2017-CU22-GDR1-ubuntu-16.04","2017-CU22-OD1-ubuntu-16.04","2017-CU22-ubuntu-16.04","2017-CU23-ubuntu-16.04","2017-CU24-ubuntu-16.04","2017-CU25-ubuntu-16.04","2017-CU26-ubuntu-16.04","2017-CU27-ubuntu-16.04","2017-CU28-ubuntu-16.04","2017-CU29-GDR1-ubuntu-16.04","2017-CU29-ubuntu-16.04","2017-CU3-ubuntu","2017-CU30-ubuntu-18.04","2017-CU31-GDR1-ubuntu-18.04","2017-CU31-GDR2-ubuntu-18.04","2017-CU31-ubuntu-18.04","2017-CU4-ubuntu","2017-CU5-ubuntu","2017-CU6-ubuntu","2017-CU7-ubuntu","2017-CU8-ubuntu","2017-CU9-ubuntu","2017-GA-ubuntu","2017-GDR-ubuntu","2017-GDR3","2017-GDR3-ubuntu","2017-GDR4","2017-GDR4-ubuntu","2017-cu16","2017-cu16-ubuntu","2017-cu17","2017-cu17-ubuntu","2017-cu19","2017-cu19-ubuntu","2017-latest","2017-latest-ubuntu","2019-CU1-ubuntu-16.04","2019-CU10-ubuntu-16.04","2019-CU10-ubuntu-18.04","2019-CU10-ubuntu-20.04","2019-CU11-ubuntu-16.04","2019-CU11-ubuntu-18.04","2019-CU11-ubuntu-20.04","2019-CU12-ubuntu-16.04","2019-CU12-ubuntu-18.04","2019-CU12-ubuntu-20.04","2019-CU13-ubuntu-16.04","2019-CU13-ubuntu-18.04","2019-CU13-ubuntu-20.04","2019-CU14-ubuntu-16.04","2019-CU14-ubuntu-18.04","2019-CU14-ubuntu-20.04","2019-CU15-ubuntu-16.04","2019-CU15-ubuntu-18.04","2019-CU15-ubuntu-20.04","2019-CU16-GDR1-ubuntu-16.04","2019-CU16-GDR1-ubuntu-18.04","2019-CU16-GDR1-ubuntu-20.04","2019-CU16-ubuntu-16.04","2019-CU16-ubuntu-18.04","2019-CU16-ubuntu-20.04","2019-CU17-ubuntu-18.04","2019-CU17-ubuntu-20.04","2019-CU18-GDR1-ubuntu-18.04","2019-CU18-GDR1-ubuntu-20.04","2019-CU18-ubuntu-18.04","2019-CU18-ubuntu-20.04","2019-CU19-ubuntu-18.04","2019-CU19-ubuntu-20.04","2019-CU2-ubuntu-16.04","2019-CU20-ubuntu-18.04","2019-CU20-ubuntu-20.04","2019-CU21-ubuntu-20.04","2019-CU22-GDR1-ubuntu-20.04","2019-CU22-ubuntu-20.04","2019-CU23-ubuntu-20.04","2019-CU24-ubuntu-20.04","2019-CU25-GDR1-ubuntu-20.04","2019-CU25-ubuntu-20.04","2019-CU26-ubuntu-20.04","2019-CU3-ubuntu-16.04","2019-CU3-ubuntu-18.04","2019-CU4-ubuntu-16.04","2019-CU4-ubuntu-18.04","2019-CU5-ubuntu-16.04","2019-CU5-ubuntu-18.04","2019-CU6-ubuntu-16.04","2019-CU6-ubuntu-18.04","2019-CU8-GDR1-ubuntu-16.04","2019-CU8-GDR1-ubuntu-18.04","2019-CU8-OD2-ubuntu-16.04","2019-CU8-OD2-ubuntu-18.04","2019-CU8-ubuntu-16.04","2019-CU8-ubuntu-18.04","2019-CU9-ubuntu-16.04","2019-CU9-ubuntu-18.04","2019-GA-ubuntu-16.04","2019-GDR1-ubuntu-16.04","2019-GDR2-ubuntu-16.04","2019-gdr2-ubuntu-16.04","2019-gdr3-ubuntu-16.04","2019-latest","2022-CTP2.0-ubuntu","2022-CTP2.0-ubuntu-20.04","2022-CU1-ubuntu-20.04","2022-CU10-GDR1-ubuntu-20.04","2022-CU10-GDR1-ubuntu-22.04","2022-CU10-ubuntu-20.04","2022-CU10-ubuntu-22.04","2022-CU11-ubuntu-20.04","2022-CU11-ubuntu-22.04","2022-CU12-GDR1-ubuntu-20.04","2022-CU12-GDR1-ubuntu-22.04","2022-CU12-ubuntu-20.04","2022-CU12-ubuntu-22.04","2022-CU3-ubuntu-20.04","2022-CU4-ubuntu-20.04","2022-CU5-ubuntu-20.04","2022-CU6-ubuntu-20.04","2022-CU7-ubuntu-20.04","2022-CU8-GDR1-ubuntu-20.04","2022-CU8-ubuntu-20.04","2022-CU9-ubuntu-20.04","2022-RC0-ubuntu-20.04","2022-RC1-ubuntu-20.04","2022-RTM-CU1-ubuntu-20.04","2022-RTM-CU2-ubuntu-20.04","2022-RTM-GDR1-ubuntu-20.04","2022-RTM-ubuntu-20.04","2022-latest","2022-preview-ubuntu-22.04","latest","latest-ubuntu"];const D={name:"shared",driver:"bridge"};class Base extends b{options;sequelize=null;constructor(u){super(),this.options=u}async run(u,t){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(u,{logging:t})}catch(t){console.error("An error occurred while trying to run the following SQL query:",u,t),n()}return null}async start(u=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),u&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const u=await this.getServiceState();u&&await this.showDockerLogs(u.name)}}else console.log(`Failed to start database ${this.name} ⛔`),n(0)}async stop(u=this.options.prune){if(u)await this.down();else{const u=C(this.getDockerComposeConfig());await a({cwd:U(),configAsString:u,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:D}}}async up(){const u=C(this.getDockerComposeConfig());return s({cwd:U(),configAsString:u,log:!0})}async down(){const u=C(this.getDockerComposeConfig());return i({cwd:U(),configAsString:u,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const u="mssql"===this.name?"master":this.options.database;return this.sequelize=new c(u,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[p,d,l,h,m],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((u=>(console.log(u),!1)))}catch(u){return!1}}async getServiceState(){const u=C(this.getDockerComposeConfig());return(await r({configAsString:u,log:!1,commandOptions:["--all"]})).data.services.find((u=>u.name.includes(this.name)))}async showDockerLogs(u){return new Promise(((t,n)=>{o("docker",["logs","-f","-n","5000",u],{cwd:U(),stdio:"inherit"}).on("exit",(u=>0===u?t():n(new Error(`Docker exited with code ${u}`))))}))}}const w={port:1433,database:"dcdx",username:"sa",password:"DataCenterDX!",edition:"Developer",version:"2022"};class MSSQL extends Base{name="mssql";driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";options=w;version="2022";get url(){return`jdbc:sqlserver://db:${this.options.port};databaseName=${this.options.database};trustServerCertificate=true`}constructor(u=w){super({...w,...u})}async onDatabaseReady(){await this.run(`CREATE DATABASE ${this.options.database}`),await this.run(`ALTER DATABASE ${this.options.database} COLLATE SQL_Latin1_General_CP1_CS_AS`),await this.run(`ALTER DATABASE ${this.options.database} SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;`)}getService=()=>({image:`mcr.microsoft.com/mssql/server:${this.version}-latest`,ports:[`${this.options.port||1433}:1433`],environment:{ACCEPT_EULA:"y",MSSQL_SA_PASSWORD:this.options.password||"dcdx",MSSQL_PID:this.options.edition},networks:{shared:{aliases:["db","database"]}}})}(async()=>{const n=u.showHelpAfterError(!0).addOption(new t("-v, --version <version>","The version of Microsoft SQL Server").choices(g).default("latest")).addOption(new t("-e, --edition <edition>","The edition of Microsoft SQL Server").choices(["Developer","Express","Standard","Enterprise","EnterpriseCore"]).default("Developer")).addOption(new t("-p, --port <port>","The port on which the database will be accessible").default("1433")).addOption(new t("-P, --password <password>","The value passed to MSSQL_SA_PASSWORD environment variable. MS SQL Server password policy applies.").default("DataCenterDX!")).addOption(new t("--clean","Remove data files before starting the database").default(!1)).addOption(new t("--prune","Remove data files when stopping the database").default(!1)).parse(process.argv).opts(),o=new MSSQL({version:n.version,edition:n.edition,port:Number(n.port),password:n.password,clean:n.clean,prune:n.prune,logging:!0});e((async()=>{console.log(`Stopping ${o.name}... ⏳`),await o.stop(),console.log(`Stopped ${o.name} 💪`)}),{wait:3e4}),await o.start()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),n()})),setInterval((()=>{}),1<<30);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as e,Option as o}from"commander";import{gracefulExit as a,asyncExitHook as t}from"exit-hook";import{spawn as s}from"child_process";import{upAll as n}from"docker-compose";import{stop as i,downAll as r,ps as c}from"docker-compose/dist/v2.js";import l from"events";import{dump as d}from"js-yaml";import{cwd as p}from"process";import{Sequelize as m,ConnectionError as h,TimeoutError as u,ConnectionTimedOutError as b,ConnectionRefusedError as g,ConnectionAcquireTimeoutError as w}from"sequelize";var f=["latest","oraclelinux8","oracle","innovation-oraclelinux8","innovation-oracle","innovation","8.3.0-oraclelinux8","8.3.0-oracle","8.3.0","8.3-oraclelinux8","8.3-oracle","8.3","8.0.36-oraclelinux8","8.0.36-oracle","8.0.36-debian","8.0.36-bookworm","8.0.36","8.0-oraclelinux8","8.0-oracle","8.0-debian","8.0-bookworm","8.0","8-oraclelinux8","8-oracle","8","8.0.36-bullseye","8.0-bullseye","8.2.0-oraclelinux8","8.2.0-oracle","8.2.0","8.2-oraclelinux8","8.2-oracle","8.2","8.0.35-oraclelinux8","8.0.35-oracle","8.0.35","8.0.35-debian","8.0.35-bullseye","5.7.44-oraclelinux7","5.7-oraclelinux7","5-oraclelinux7","5.7.44-oracle","5.7.44","5.7-oracle","5.7","5-oracle","5","8.1.0-oracle","8.1.0","8.1-oracle","8.1","8.0.34-oracle","8.0.34","5.7.43-oracle","5.7.43","8.0.34-debian","debian","8-debian","5.7.42-debian","5.7-debian","5-debian","5.7.42-oracle","5.7.42","8.0.33-oracle","8.0.33","8.0.33-debian","8.0.32-debian","5.7.41-debian","8.0.32-oracle","8.0.32","5.7.41-oracle","5.7.41","8.0.31-debian","5.7.40-debian","8.0.31-oracle","8.0.31","5.7.40-oracle","5.7.40","8.0.30-oracle","8.0.30","5.7.39-oracle","5.7.39","8.0.30-debian","5.7.39-debian","8.0.29-oracle","8.0.29","5.7.38-oracle","5.7.38","8.0.29-debian","5.7.38-debian","8.0.28-debian","8.0.28","5.7.37-debian","5.7.37","8.0.28-oracle","5.7.37-oracle","8.0.27","5.7.36","5.6.51","5.6","8.0.26","5.7.35","8.0.25","5.7.34","8.0.24","8.0.23","5.7.33","8.0.22","5.7.32","5.6.50","8.0.21","5.7.31","5.6.49","8.0.20","5.7.30","5.6.48","8.0.19","5.7.29","5.6.47","8.0.18","5.7.28","5.6.46","8.0.17","5.7.27","5.6.45","8.0.16","5.7.26","5.6.44","5.5.62","5.5","5.6.43","5.7.25","8.0.15","8.0.14","5.6.42","5.7.24","8.0.13","5.5.61","5.6.41","5.7.23","8.0.12","5.5.60","5.6.40","5.7.22","8.0.11","5.5.59","5.6.39","5.7.21","8.0.4","8.0.4-rc","8.0.3","5.5.58","5.6.38","5.7.20","5.5.57","5.6.37","5.7.19","8.0.2","5.5.56","5.6.36","5.7.18","8.0.1","5.5.55","5.6.35","5.7.17","8.0.0","5.5.54","5.5.53","5.7.16","5.6.34","5.5.52","5.6.33","5.7.15","5.5.51","5.6.32","5.7.14","5.5.50","5.6.31","5.7.13","5.7.12","5.6.30","5.5.49","5.7.11","5.6.29","5.5.48","5.7.10","5.6.28","5.5.47","5.6.27","5.7.9","5.5.46","5.5.40","5.7.4","5.6.17","5.5.41","5.7.5-m15","5.6.21","5.6.20","5.6.22","5.7.4-m14","5.7.5","5.7.8","5.7.8-rc","5.6.26","5.5.45","5.7.7","5.7.7-rc","5.6.25","5.5.44","5.6.24","5.5.43","5.7.6","5.7.6-m16","5.6.23","5.5.42"];const v={name:"shared",driver:"bridge"};class Base extends l{options;sequelize=null;constructor(e){super(),this.options=e}async run(e,o){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(e,{logging:o})}catch(o){console.error("An error occurred while trying to run the following SQL query:",e,o),a()}return null}async start(e=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),e&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const e=await this.getServiceState();e&&await this.showDockerLogs(e.name)}}else console.log(`Failed to start database ${this.name} ⛔`),a(0)}async stop(e=this.options.prune){if(e)await this.down();else{const e=d(this.getDockerComposeConfig());await i({cwd:p(),configAsString:e,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:v}}}async up(){const e=d(this.getDockerComposeConfig());return n({cwd:p(),configAsString:e,log:!0})}async down(){const e=d(this.getDockerComposeConfig());return r({cwd:p(),configAsString:e,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const e="mssql"===this.name?"master":this.options.database;return this.sequelize=new m(e,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[h,u,b,g,w],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((e=>(console.log(e),!1)))}catch(e){return!1}}async getServiceState(){const e=d(this.getDockerComposeConfig());return(await c({configAsString:e,log:!1,commandOptions:["--all"]})).data.services.find((e=>e.name.includes(this.name)))}async showDockerLogs(e){return new Promise(((o,a)=>{s("docker",["logs","-f","-n","5000",e],{cwd:p(),stdio:"inherit"}).on("exit",(e=>0===e?o():a(new Error(`Docker exited with code ${e}`))))}))}}const y={port:3306,database:"dcdx",username:"dcdx",password:"dcdx",version:"8.0"};class MySQL extends Base{name="mysql";driver="com.mysql.jdbc.Driver";options=y;version="8.0";get url(){return`jdbc:mysql://db:${this.options.port}/${this.options.database}?sessionVariables=transaction_isolation='READ-COMMITTED'`}constructor(e=y){super({...y,...e})}async onDatabaseReady(){await this.run(`ALTER DATABASE ${this.options.database} CHARACTER SET 'utf8mb4' COLLATE utf8mb4_bin`)}getService=()=>({image:`mysql:${this.version}`,ports:[`${this.options.port||3306}:3306`],environment:{MYSQL_ROOT_PASSWORD:this.options.password||"dcdx",MYSQL_USER:this.options.username||"dcdx",MYSQL_PASSWORD:this.options.password||"dcdx",MYSQL_DATABASE:this.options.database||"dcdx"},command:["--log_bin_trust_function_creators=1"],networks:{shared:{aliases:["db","database"]}}})}(async()=>{const a=e.showHelpAfterError(!0).addOption(new o("-v, --version <version>","The version of MySQL").choices(f).default("latest")).addOption(new o("-d, --database <database>","The value passed to MYSQL_DATABASE environment variable").default("dcdx")).addOption(new o("-p, --port <port>","The port on which the database will be accessible").default("3306")).addOption(new o("-U, --username <username>","The value passed to MYSQL_USER environment variable").default("dcdx")).addOption(new o("-P, --password <password>","The value passed to MYSQL_PASSWORD environment variable").default("dcdx")).addOption(new o("--clean","Remove data files before starting the database").default(!1)).addOption(new o("--prune","Remove data files when stopping the database").default(!1)).parse(process.argv).opts(),s=new MySQL({version:a.version,database:a.database,port:Number(a.port),username:a.username,password:a.password,clean:a.clean,prune:a.prune,logging:!0});t((async()=>{console.log(`Stopping ${s.name}... ⏳`),await s.stop(),console.log(`Stopped ${s.name} 💪`)}),{wait:3e4}),await s.start()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),a()})),setInterval((()=>{}),1<<30);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as e,Option as a}from"commander";import{gracefulExit as l,asyncExitHook as n}from"exit-hook";import{spawn as i}from"child_process";import{upAll as p}from"docker-compose";import{stop as t,downAll as s,ps as o}from"docker-compose/dist/v2.js";import r from"events";import{dump as b}from"js-yaml";import{cwd as c}from"process";import{Sequelize as u,ConnectionError as d,TimeoutError as y,ConnectionTimedOutError as m,ConnectionRefusedError as h,ConnectionAcquireTimeoutError as w}from"sequelize";var g=["latest","bullseye","bookworm","alpine3.19","alpine3.18","alpine","16.2-bullseye","16.2-bookworm","16.2-alpine3.19","16.2-alpine3.18","16.2-alpine","16.2","16-bullseye","16-bookworm","16-alpine3.19","16-alpine3.18","16-alpine","16","15.6-bullseye","15.6-bookworm","15.6-alpine3.19","15.6-alpine3.18","15.6-alpine","15.6","15-bullseye","15-bookworm","15-alpine3.19","15-alpine3.18","15-alpine","15","14.11-bullseye","14.11-bookworm","14.11-alpine3.19","14.11-alpine3.18","14.11-alpine","14.11","14-bullseye","14-bookworm","14-alpine3.19","14-alpine3.18","14-alpine","14","13.14-bullseye","13.14-bookworm","13.14-alpine3.19","13.14-alpine3.18","13.14-alpine","13.14","13-bullseye","13-bookworm","13-alpine3.19","13-alpine3.18","13-alpine","13","12.18-bullseye","12.18-bookworm","12.18-alpine3.19","12.18-alpine3.18","12.18-alpine","12.18","12-bullseye","12-bookworm","12-alpine3.19","12-alpine3.18","12-alpine","12","16.1-bullseye","15.5-bullseye","15.5-bookworm","15.5","14.10-bullseye","14.10-bookworm","14.10","13.13-bullseye","13.13-bookworm","13.13","12.17-bullseye","12.17-bookworm","12.17","16.1-bookworm","16.1","16.1-alpine3.19","16.1-alpine3.18","16.1-alpine","15.5-alpine3.19","15.5-alpine3.18","15.5-alpine","14.10-alpine3.19","14.10-alpine3.18","14.10-alpine","13.13-alpine3.19","13.13-alpine3.18","13.13-alpine","12.17-alpine3.19","12.17-alpine3.18","12.17-alpine","11.22-bullseye","11.22-bookworm","11-bullseye","11-bookworm","11.22-alpine3.19","11.22-alpine","11-alpine3.19","11-alpine","12.17-alpine3.17","12-alpine3.17","11.22-alpine3.18","11.22-alpine3.17","11-alpine3.18","11-alpine3.17","alpine3.17","16.1-alpine3.17","16-alpine3.17","15.5-alpine3.17","15-alpine3.17","13.13-alpine3.17","13-alpine3.17","14.10-alpine3.17","14-alpine3.17","12.16-bullseye","11.21-bullseye","11.21-bookworm","13.12-bullseye","13.12-bookworm","13.12","12.16-bookworm","12.16","14.9-bullseye","14.9-bookworm","14.9","16.0-bullseye","15.4-bullseye","15.4-bookworm","15.4","16.0-bookworm","16.0","16.0-alpine3.18","16.0-alpine3.17","16.0-alpine","15.4-alpine3.18","15.4-alpine3.17","15.4-alpine","14.9-alpine3.18","14.9-alpine3.17","14.9-alpine","13.12-alpine3.18","13.12-alpine3.17","13.12-alpine","12.16-alpine3.18","12.16-alpine3.17","12.16-alpine","11.21-alpine3.18","11.21-alpine3.17","11.21-alpine","16rc1-bullseye","16rc1-bookworm","16rc1","16rc1-alpine3.18","16rc1-alpine3.17","16rc1-alpine","16beta3-bullseye","16beta3-bookworm","16beta3","16beta3-alpine3.18","16beta3-alpine3.17","16beta3-alpine","16beta2-alpine3.18","16beta2-alpine3.17","16beta2-alpine","15.3-alpine3.18","15.3-alpine3.17","15.3-alpine","14.8-alpine3.18","14.8-alpine3.17","14.8-alpine","13.11-alpine3.18","13.11-alpine3.17","13.11-alpine","12.15-alpine3.18","12.15-alpine3.17","12.15-alpine","11.20-alpine3.18","11.20-alpine3.17","11.20-alpine","16beta2-bullseye","16beta2-bookworm","16beta2","15.3-bullseye","15.3-bookworm","15.3","14.8-bullseye","14.8-bookworm","14.8","13.11-bullseye","13.11-bookworm","13.11","12.15-bullseye","12.15-bookworm","12.15","11.20-bullseye","11.20-bookworm","16beta1-bookworm","16beta1-alpine3.18","16beta1-alpine3.17","16beta1-alpine","16beta1","16beta1-bullseye","15.2-bullseye","15.2-alpine3.17","15.2-alpine","15.2","14.7-bullseye","14.7-alpine3.17","14.7-alpine","14.7","13.10-bullseye","13.10-alpine3.17","13.10-alpine","13.10","12.14-bullseye","12.14-alpine3.17","12.14-alpine","12.14","11.19-bullseye","11.19-alpine3.17","11.19-alpine","15.1-bullseye","15.1","14.6-bullseye","14.6","13.9-bullseye","13.9","12.13-bullseye","12.13","11.18-bullseye","15.1-alpine3.17","15.1-alpine","14.6-alpine3.17","14.6-alpine","13.9-alpine3.17","13.9-alpine","12.13-alpine3.17","12.13-alpine","11.18-alpine3.17","11.18-alpine","alpine3.16","15.1-alpine3.16","15-alpine3.16","14.6-alpine3.16","14-alpine3.16","13.9-alpine3.16","13-alpine3.16","12.13-alpine3.16","12-alpine3.16","11.18-alpine3.16","11-alpine3.16","10.23-alpine3.16","10.23-alpine","10-alpine3.16","10-alpine","10.23-bullseye","10-bullseye","15.0-bullseye","14.5-bullseye","14.5","13.8-bullseye","13.8","12.12-bullseye","12.12","11.17-bullseye","10.22-bullseye","15.0","15.0-alpine3.16","15.0-alpine","14.5-alpine3.16","14.5-alpine","13.8-alpine3.16","13.8-alpine","12.12-alpine3.16","12.12-alpine","11.17-alpine3.16","11.17-alpine","10.22-alpine3.16","10.22-alpine","15rc2-alpine3.16","15rc2-alpine","15rc2-bullseye","15rc2","15rc1-alpine3.16","15rc1-alpine","15rc1-bullseye","15rc1","15beta4-bullseye","15beta4","15beta4-alpine3.16","15beta4-alpine","15beta3-bullseye","15beta3","15beta3-alpine3.16","15beta3-alpine","15beta2-alpine3.16","15beta2-alpine","14.4-alpine3.16","14.4-alpine","13.7-alpine3.16","13.7-alpine","12.11-alpine3.16","12.11-alpine","11.16-alpine3.16","11.16-alpine","10.21-alpine3.16","10.21-alpine","12.11-bullseye","12.11","15beta2-bullseye","15beta2","14.4-bullseye","14.4","13.7-bullseye","13.7","11.16-bullseye","10.21-bullseye","15beta1-bullseye","15beta1","11.16-stretch","11.16","11-stretch","11","10.21-stretch","10.21","10-stretch","10","15beta1-alpine3.16","15beta1-alpine","14.3-alpine3.16","14.3-alpine","14.3-bullseye","14.3","15beta1-alpine3.15","alpine3.15","14.3-alpine3.15","14-alpine3.15","13.7-alpine3.15","13-alpine3.15","12.11-alpine3.15","12-alpine3.15","11.16-alpine3.15","11-alpine3.15","10.21-alpine3.15","10-alpine3.15","14.2-bullseye","14.2","13.6-bullseye","13.6","12.10-bullseye","12.10","11.15-bullseye","10.20-bullseye","11.15-stretch","11.15","10.20-stretch","10.20","14.2-alpine3.15","14.2-alpine","13.6-alpine3.15","13.6-alpine","12.10-alpine3.15","12.10-alpine","11.15-alpine3.15","11.15-alpine","10.20-alpine3.15","10.20-alpine","9.6.24-bullseye","9.6-bullseye","9-bullseye","9.6.24-stretch","9.6.24","9.6-stretch","9.6","9-stretch","9","14.1-bullseye","14.1","13.5-bullseye","13.5","12.9-bullseye","12.9","11.14-stretch","11.14-bullseye","11.14","10.19-stretch","10.19-bullseye","10.19","9.6.24-alpine3.15","9.6.24-alpine","9.6-alpine3.15","9.6-alpine","9-alpine3.15","9-alpine","14.1-alpine3.15","14.1-alpine","13.5-alpine3.15","13.5-alpine","12.9-alpine3.15","12.9-alpine","11.14-alpine3.15","11.14-alpine","10.19-alpine3.15","10.19-alpine","alpine3.14","9.6.24-alpine3.14","9.6-alpine3.14","9-alpine3.14","14.1-alpine3.14","14-alpine3.14","13.5-alpine3.14","13-alpine3.14","12.9-alpine3.14","12-alpine3.14","11.14-alpine3.14","11-alpine3.14","10.19-alpine3.14","10-alpine3.14","9.6.23-stretch","9.6.23-bullseye","9.6.23-alpine3.14","9.6.23-alpine","9.6.23","14.0-bullseye","14.0-alpine3.14","14.0-alpine","14.0","13.4-bullseye","13.4-alpine3.14","13.4-alpine","13.4","12.8-bullseye","12.8-alpine3.14","12.8-alpine","12.8","11.13-stretch","11.13-bullseye","11.13-alpine3.14","11.13-alpine","11.13","10.18-stretch","10.18-bullseye","10.18-alpine3.14","10.18-alpine","10.18","14rc1-bullseye","14rc1","14rc1-alpine3.14","14rc1-alpine","buster","9.6.23-buster","9.6-buster","9-buster","14beta3-buster","14beta3","13.4-buster","13-buster","12.8-buster","12-buster","11.13-buster","11-buster","10.18-buster","10-buster","14beta3-alpine3.14","14beta3-alpine","9.6.22-alpine3.14","9.6.22-alpine","14beta2-alpine3.14","14beta2-alpine","13.3-alpine3.14","13.3-alpine","12.7-alpine3.14","12.7-alpine","11.12-alpine3.14","11.12-alpine","10.17-alpine3.14","10.17-alpine","9.6.22-stretch","9.6.22-buster","9.6.22","14beta2-buster","14beta2","13.3-buster","13.3","12.7-buster","12.7","11.12-stretch","11.12-buster","11.12","10.17-stretch","10.17-buster","10.17","alpine3.13","9-alpine3.13","13.3-alpine3.13","13-alpine3.13","12.7-alpine3.13","12-alpine3.13","11.12-alpine3.13","11-alpine3.13","10.17-alpine3.13","10-alpine3.13","9.6.22-alpine3.13","9.6-alpine3.13","9.6.21","9.5.25","9.5","13.2","12.6","11.11","10.16","9.6.21-alpine","9.5.25-alpine","9.5-alpine","13.2-alpine","12.6-alpine","11.11-alpine","10.16-alpine","9.6.20","9.5.24","13.1","12.5","11.10","10.15","9.6.20-alpine","9.5.24-alpine","13.1-alpine","12.5-alpine","11.10-alpine","10.15-alpine","9.6.19-alpine","9.5.23-alpine","13.0-alpine","12.4-alpine","11.9-alpine","10.14-alpine","9.6.19","9.5.23","13.0","12.4","11.9","10.14","13-rc1-alpine","13-rc1","13-beta3","13-beta3-alpine","9.6.18","9.5.22","13-beta2","12.3","11.8","10.13","9.6.18-alpine","9.5.22-alpine","13-beta2-alpine","12.3-alpine","11.8-alpine","10.13-alpine","13-beta1-alpine","13-beta1","9.6.17","9.5.21","11.7","10.12","9.6.17-alpine","9.5.21-alpine","12.2-alpine","11.7-alpine","10.12-alpine","12.2","9.4.26-alpine","9.4.26","9.4-alpine","9.4","9.6.16","9.5.20","9.4.25","12.1","11.6","10.11","9.6.16-alpine","9.5.20-alpine","9.4.25-alpine","12.1-alpine","11.6-alpine","10.11-alpine","9.6.15-alpine","9.5.19-alpine","9.4.24-alpine","12.0-alpine","11.5-alpine","10.10-alpine","9.6.15","9.5.19","9.4.24","12.0","11.5","10.10","12-rc1-alpine","12-rc1","12-beta4-alpine","12-beta4","12-beta3","12-beta3-alpine","9.6.14-alpine","9.5.18-alpine","9.4.23-alpine","12-beta2-alpine","11.4-alpine","10.9-alpine","9.6.14","9.5.18","9.4.23","11.4","10.9","12-beta2","9.6.13-alpine","9.5.17-alpine","9.4.22-alpine","12-beta1-alpine","11.3-alpine","10.8-alpine","9.6.13","9.5.17","9.4.22","12-beta1","11.3","10.8","11.2","9.4.21","9.5.16","9.6.12","10.7","9.4.21-alpine","9.5.16-alpine","9.6.12-alpine","10.7-alpine","11.2-alpine","9.4.20","9.5.15","9.6.11","10.6","11.1","9.4.20-alpine","9.5.15-alpine","9.6.11-alpine","10.6-alpine","11.1-alpine","9.3","9.3.25","9.3-alpine","9.3.25-alpine","10.5-alpine","10.5","11.0","11.0-alpine","9.3.24","9.4.19","9.5.14","9.6.10","11-rc1","11-rc1-alpine","11-beta4-alpine","9.4.19-alpine","11-beta4","9.3.24-alpine","9.5.14-alpine","9.6.10-alpine","11-beta3-alpine","11-beta3","9.3.23","9.5.13","9.5.13-alpine","9.4.18","9.6.9","10.4-alpine","10.4","11-beta2-alpine","11-beta2","9.4.18-alpine","9.3.23-alpine","9.6.9-alpine","11-beta1","11-beta1-alpine","9.6.8","10.3","9.3.22-alpine","9.3.22","9.4.17-alpine","9.4.17","9.5.12-alpine","9.5.12","9.6.8-alpine","10.3-alpine","9.3.21","9.4.16","9.5.11","9.6.7","10.2-alpine","10.2","9.5.11-alpine","9.5.10","9.3.21-alpine","9.4.16-alpine","9.6.7-alpine","9.3.20-alpine","9.4.15-alpine","9.5.10-alpine","9.6.6-alpine","10.1-alpine","9.3.20","9.4.15","9.6.6","10.1","9.3.19-alpine","9.3.19","9.4.14-alpine","9.4.14","9.5.9-alpine","9.5.9","9.6.5-alpine","9.6.5","10.0-alpine","10.0","9.2","9.2.23","10-rc1","9.2-alpine","9.2.23-alpine","10-rc1-alpine","10-beta4","10-beta4-alpine","9.2.22-alpine","9.2.22","9.3.18-alpine","9.3.18","9.4.13-alpine","9.4.13","9.5.8-alpine","9.5.8","9.6.4-alpine","9.6.4","10-beta3-alpine","10-beta3","9.2.21-alpine","9.2.21","9.3.17-alpine","9.3.17","9.4.12-alpine","9.4.12","9.5.7-alpine","9.5.7","9.6.3-alpine","9.6.3","10-beta2-alpine","10-beta2","10-beta1-alpine","10-beta1","9.2.20-alpine","9.2.20","9.3.16-alpine","9.3.16","9.4.11-alpine","9.4.11","9.5.6-alpine","9.5.6","9.6.2-alpine","9.6.2","9.2.19-alpine","9.2.19","9.3.15-alpine","9.3.15","9.4.10-alpine","9.4.10","9.5.5-alpine","9.5.5","9.6.1-alpine","9.6.1","9.1.24","9.1","9.5.4","9.4.9","9.3.14","9.2.18","9.1.23","9.6.0","9.6-rc1","9.6-beta4","9.4.8","9.1.22","9.6-beta3","9.5.3","9.3.13","9.2.17","9.6-beta2","9.6-beta1","9.5.2","9.4.7","9.3.12","9.2.16","9.1.21","9.5.1","9.4.6","9.3.11","9.2.15","9.1.20","9.5.0","9.4.5","9.3.10","9.2.14","9.1.19","9.0","9.0.22","9.5-rc1","9.5-beta2","9.5-beta1","9.4-rc1","9.3.5","9.4-beta2","9.2.9","9.4.0","9.1.14","9.4-beta3","9.0.18","9.5-alpha2","9.4.4","9.3.9","9.2.13","9.1.18","9.5-alpha1","9.4.3","9.3.8","9.2.12","9.1.17","9.0.21","9.4.2","9.3.7","9.2.11","9.1.16","9.0.20","8","8.4","8.4.22","9.4.1","9.3.6","9.2.10","9.1.15","9.0.19"];const k={name:"shared",driver:"bridge"};class Base extends r{options;sequelize=null;constructor(e){super(),this.options=e}async run(e,a){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(e,{logging:a})}catch(a){console.error("An error occurred while trying to run the following SQL query:",e,a),l()}return null}async start(e=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),e&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const e=await this.getServiceState();e&&await this.showDockerLogs(e.name)}}else console.log(`Failed to start database ${this.name} ⛔`),l(0)}async stop(e=this.options.prune){if(e)await this.down();else{const e=b(this.getDockerComposeConfig());await t({cwd:c(),configAsString:e,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:k}}}async up(){const e=b(this.getDockerComposeConfig());return p({cwd:c(),configAsString:e,log:!0})}async down(){const e=b(this.getDockerComposeConfig());return s({cwd:c(),configAsString:e,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const e="mssql"===this.name?"master":this.options.database;return this.sequelize=new u(e,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[d,y,m,h,w],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((e=>(console.log(e),!1)))}catch(e){return!1}}async getServiceState(){const e=b(this.getDockerComposeConfig());return(await o({configAsString:e,log:!1,commandOptions:["--all"]})).data.services.find((e=>e.name.includes(this.name)))}async showDockerLogs(e){return new Promise(((a,l)=>{i("docker",["logs","-f","-n","5000",e],{cwd:c(),stdio:"inherit"}).on("exit",(e=>0===e?a():l(new Error(`Docker exited with code ${e}`))))}))}}const f={version:"15",database:"dcdx",port:5432,username:"dcdx",password:"dcdx"};class Postgres extends Base{name="postgresql";driver="org.postgresql.Driver";options=f;version="15";get url(){return`jdbc:postgresql://db:${this.options.port}/${this.options.database}`}constructor(e=f){super({...f,...e})}getService=()=>({image:`postgres:${this.version}`,ports:[`${this.options.port||5432}:5432`],environment:{POSTGRES_USER:this.options.username||"dcdx",POSTGRES_PASSWORD:this.options.password||"dcdx",POSTGRES_DB:this.options.database||"dcdx",POSTGRES_HOST_AUTH_METHOD:"md5",POSTGRES_INITDB_ARGS:"--encoding=UTF-8 --lc-collate=C --lc-ctype=C"},networks:{shared:{aliases:["db","database"]}}})}(async()=>{const l=e.showHelpAfterError(!0).addOption(new a("-v, --version <version>","The version of Postgres").choices(g).default("latest")).addOption(new a("-d, --database <database>","The value passed to POSTGRES_DB environment variable").default("dcdx")).addOption(new a("-p, --port <port>","The port on which the database will be accessible").default("5432")).addOption(new a("-U, --username <username>","The value passed to POSTGRES_USER environment variable").default("dcdx")).addOption(new a("-P, --password <password>","The value passed to POSTGRES_PASSWORD environment variable").default("dcdx")).addOption(new a("--clean","Remove data files before starting the database").default(!1)).addOption(new a("--prune","Remove data files when stopping the database").default(!1)).parse(process.argv).opts(),i=new Postgres({version:l.version,database:l.database,port:Number(l.port),username:l.username,password:l.password,clean:l.clean,prune:l.prune,logging:!0});n((async()=>{console.log(`Stopping ${i.name}... ⏳`),await i.stop(),console.log(`Stopped ${i.name} 💪`)}),{wait:3e4}),await i.start()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),l()})),setInterval((()=>{}),1<<30);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as t,Option as e}from"commander";import{gracefulExit as s}from"exit-hook";import o from"axios";import{dirname as a,join as n}from"path";import{spawn as i}from"child_process";import{stop as r,downAll as u,ps as c,execCompose as d,upAll as l}from"docker-compose/dist/v2.js";import p from"events";import{existsSync as m,mkdirSync as h,readFileSync as b}from"fs";import{dump as g}from"js-yaml";import{homedir as k}from"os";import{cwd as j}from"process";import w from"simple-git";import{upAll as A}from"docker-compose";import{Sequelize as S,ConnectionError as v,TimeoutError as f,ConnectionTimedOutError as E,ConnectionRefusedError as y,ConnectionAcquireTimeoutError as P}from"sequelize";import{DOMParser as D,XMLSerializer as x}from"@xmldom/xmldom";import{XMLParser as C}from"fast-xml-parser";import T from"xpath";import{hideBin as M}from"yargs/helpers";import O from"yargs/yargs";var R=["latest","9.4-ubuntu","9.4-jdk11","9.4.3-ubuntu","9.4","9.4.3","9.4.3-jdk11","ubuntu","jdk11","9-ubuntu","9-jdk11","9.5-ubuntu","9.5-jdk11","9.5.1-ubuntu","9.5.1-jdk11","9.5.1","9.5","9","9.2-ubuntu","9.2-jdk11","9.2","9.2.11-jdk11","9.2.11-ubuntu","9.2.11","9.3.3-ubuntu","9.3.3-jdk11","9.3.3","9.2.4-ubuntu","9.2.4-jdk11","9.3.2-ubuntu","9.3.2-jdk11","9.0-ubuntu","9.2.4","9.3.2","9.0-jdk11","9.0.4-ubuntu","9.0.4-jdk11","9.0.4","9.0","8.2.6-ubuntu","8.2.6","8.2.6-jdk11","8.1.11-ubuntu","8.1.11-jdk11","8.1.11","8.0.0-jdk11","8.0.0-ubuntu","8.1.8-ubuntu","9.3.4-ubuntu","8.1.8-jdk11","9.3.4-jdk11","8.1.8","8.0.0","8.0.4-ubuntu","9.3.4","8.0.4-jdk11","9.2.5-ubuntu","9.2.5-jdk11","8.0.4","9.2.5","9.1.0-ubuntu","9.1.0-jdk11","9.1.0","8.2.7-ubuntu","8.2.7-jdk11","8.2.7","8.1-ubuntu","8.1-jdk11","8.1.12-ubuntu","8.1.12-jdk11","8.1","8.1.12","8.0.5-ubuntu","8.0.5-jdk11","8.0.1-ubuntu","9.1.1-jdk11","8.1.9-ubuntu","8.0.1-jdk11","8.0.1","8.1.9-jdk11","9.1.1","8.1.9","8.2.8-ubuntu","8.2.8-jdk11","8.0.5","8.2.8","8.1.2-ubuntu","8.1.2-jdk11","8.1.2","8.0.10-ubuntu","9.3.5-ubuntu","8.0.10-jdk11","9.3.5-jdk11","8.0.10","9.3.5","9.2.6-jdk11","9.2.6-ubuntu","9.2.6","9.1.1-ubuntu","8.2.0-ubuntu","8.2.0-jdk11","9.1.2-ubuntu","8.2.0","9.1.2-jdk11","8.0.6-ubuntu","8.0.6-jdk11","9.1.2","8.0.6","8-ubuntu","8-jdk11","8.2-ubuntu","8.2-jdk11","8.2.9-ubuntu","8.2.9-jdk11","8.2.9","8.2","8.1.3-ubuntu","8.1.3-jdk11","8.1.3","8.0.11-jdk11","8.0.11-ubuntu","8.0.11","9.3-ubuntu","8","9.3-jdk11","9.3.6-ubuntu","9.3.6-jdk11","9.3.6","9.3","9.2.7-ubuntu","9.2.7-jdk11","9.2.7","8.2.1-ubuntu","8.2.1-jdk11","8.2.1","8.0.7-ubuntu","9.4.0-jdk11","8.0.7-jdk11","9.2.8-ubuntu","8.0.7","9.2.8-jdk11","9.2.8","9.1-ubuntu","9.1-jdk11","9.1.3-ubuntu","9.1.3-jdk11","9.1.3","9.1","9.0.0-jdk11","9.0.0-ubuntu","9.0.0","8.1.4-ubuntu","8.1.4-jdk11","8.1.4","8.0.8-ubuntu","8.0.8-jdk11","8.0.8","8.0.12-ubuntu","8.0.12","8.0.12-jdk11","8.2.2-ubuntu","8.2.2-jdk11","8.1.5-jdk11","8.2.2","8.1.5-ubuntu","8.1.5","8.0-ubuntu","8.0-jdk11","8.0.13-jdk11","8.0.13-ubuntu","8.0.13","9.4.1-ubuntu","8.0","9.4.1-jdk11","9.4.1","9.2.9-ubuntu","9.2.9","9.2.9-jdk11","9.2.1-ubuntu","9.2.1-jdk11","9.2.1","9.0.1-ubuntu","9.0.1-jdk11","9.0.1","8.2.3-ubuntu","8.2.3-jdk11","8.2.3","9.4.2-jdk11","8.0.9-ubuntu","8.0.9-jdk11","9.0.2-ubuntu","8.0.9","9.0.2-jdk11","9.0.2","8.1.6-ubuntu","8.1.6-jdk11","8.1.6","8.0.2-ubuntu","8.0.2-jdk11","8.0.2","7-ubuntu","7-jdk8","7.2-ubuntu","7.2-jdk8","7.2.7-jdk8","7.2.7-ubuntu","7.2.7","7.2.5-ubuntu","7.2.5-jdk8","7.2.5","7.2.3-ubuntu","7.2.3-jdk8","7.2.3","7.2.10-ubuntu","7.2.10-jdk8","7.2.10","7.2.0-ubuntu","7.2.0-jdk8","7.2.0","7.2","7.1.3-ubuntu","7.1.3-jdk8","7.1.3","7","9.3.0-ubuntu","9.3.0-jdk11","9.3.0","9.2.10-ubuntu","9.2.10-jdk11","9.2.10","8.2.4-ubuntu","8.2.4-jdk11","8.2.4","8.1.1-ubuntu","8.1.1-jdk11","8.1.1","8.1.7-ubuntu","8.1.7-jdk11","8.1.7","8.0.3-ubuntu","8.0.3-jdk11","8.0.3","jdk17","9-jdk17","9.5-jdk17","9.5.0-ubuntu","9.5.0-jdk17","9.5.0-jdk11","9.5.0","9.4-jdk17","9.4.2-ubuntu","9.4.0-ubuntu","9.4.2-jdk17","9.4.2","9.4.0","9.4.0-jdk17","9.3.1-ubuntu","9.3.1-jdk11","9.3.1","9.2.3-ubuntu","9.2.3-jdk11","9.2.3","9.0.3-ubuntu","9.0.3-jdk11","9.0.3","8.2.5-ubuntu","8.2.5-jdk11","8.2.5","8.1.10-ubuntu","8.1.10-jdk11","8.1.10","7.2.9-ubuntu","7.2.9","7.2.9-jdk8","7.2.6-ubuntu","7.2.6-jdk8","7.2.6","7.2.4-ubuntu","7.2.4-jdk8","7.2.4","7.2.2-ubuntu","7.2.2-jdk8","7.2.2","7.2.1-ubuntu","7.2.1-jdk8","7.2.1","7.1-ubuntu","7.1-jdk8","7.1.4-ubuntu","7.1.4-jdk8","7.1.4","7.1.2-ubuntu","7.1.2-jdk8","7.1.2","7.1.1-ubuntu","7.1.1-jdk8","7.1.1","7.1","9.4.1-jdk17","eap-jdk8","9.0.0-rc1-ubuntu","9.0.0-rc1-jdk11","9.0.0-rc1","eap-jdk11","eap-ubuntu","9.0.0-rc1-jdk8","eap","8.0.0-rc4","8.0.0-rc1","7.0.6","7.0","7.1.0-rc1","7.0.4","6.10","6.10.6","7.0.3","6.10.5","7.0.2","7.0.1","7.0.0-rc2","7.0.0-rc1","6.10.4","6.10.3","6.10.2","6.9.2","6.9","6.8.3","6.8","6.9.1","6.8.2","6.9.0","6.9.0-rc1","6.7","6.7.3","6.8.1","6.8.0","6.7.2","6.7.1","6.6.3","6.6","6.7.0-rc2","6.6.2","6.6.1","6.6.0"];const L="AAAB3w0ODAoPeNp9Ultr2zAYffevEOwtoMR10qYLGJbYWsno7GA7g90eZPlrotWWjCSnzX79FF8IYWkfDPJ3Oedwzvch2zdoWSvkzpF7v5jdLrwpCkiaIc/1POeRMxAasmMNEa3Az2xnHT04gQJquBQhNeB77vQGuzPs3jk5rXIpx5QZfgDfqAaGUtRUOaj4adX+PkpGy+UOhNE+vnGG5laDags9L3mtuToOJF5Pkja5ZorXJwEXHG+pJQdaNvS/cYtLAysBVFfu19ehvxXPQr4IJwV1AGULKzIneBb+8PBd/GWOH6Yf751No9ieaujleYMHKYl8++Fb13VGo1EUZ/hznOBNEofbIFvHEd6mxDb81kQoUH5EZg+op0dEMFmAQrWSf4AZ9HNvTP1rMZnsrLGmpFpzKsZMVpOy28DQbfweo1AiIQ0quDaK540Bi8w1MhKxRhtZWXvHTghn+zLQBvU46Ela1rLZcYEKOEApazvvfKXceiSoYG/kcTXhTUlFG+XVbgKVNHA+gF7BN8t3UuU5sdpRwXUXGnmlVV0CCmRVU3G8Evf5MKUw9vqIFV36tX7moNjfo7CPTxfenZIJErLMSIhX309pvDd8SUgK3smKMpJsknVKBtr26t4D+gd3AC5qMCwCFHOaTWfFvLCLJPft3qktVo3FafmZAhRojb9IAxj8KEqPDQy0stos394SQQ==X02mq",toAbsolutePath=t=>{const[,e]=process.argv,s=a(e),o=s.substring(0,s.indexOf("dcdx")+4);return n(o,t.replaceAll("../",""))};var $;!function(t){t.JIRA="jira",t.CONFLUENCE="confluence",t.BITBUCKET="bitbucket",t.BAMBOO="bamboo"}($||($={}));const _={name:"shared",driver:"bridge"};let q=class Base extends p{options;sequelize=null;constructor(t){super(),this.options=t}async run(t,e){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(t,{logging:e})}catch(e){console.error("An error occurred while trying to run the following SQL query:",t,e),s()}return null}async start(t=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),t&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const t=await this.getServiceState();t&&await this.showDockerLogs(t.name)}}else console.log(`Failed to start database ${this.name} ⛔`),s(0)}async stop(t=this.options.prune){if(t)await this.down();else{const t=g(this.getDockerComposeConfig());await r({cwd:j(),configAsString:t,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:_}}}async up(){const t=g(this.getDockerComposeConfig());return A({cwd:j(),configAsString:t,log:!0})}async down(){const t=g(this.getDockerComposeConfig());return u({cwd:j(),configAsString:t,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const t="mssql"===this.name?"master":this.options.database;return this.sequelize=new S(t,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[v,f,E,y,P],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((t=>(console.log(t),!1)))}catch(t){return!1}}async getServiceState(){const t=g(this.getDockerComposeConfig());return(await c({configAsString:t,log:!1,commandOptions:["--all"]})).data.services.find((t=>t.name.includes(this.name)))}async showDockerLogs(t){return new Promise(((e,s)=>{i("docker",["logs","-f","-n","5000",t],{cwd:j(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}};const U={port:1433,database:"dcdx",username:"sa",password:"DataCenterDX!",edition:"Developer",version:"2022"};class MSSQL extends q{name="mssql";driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";options=U;version="2022";get url(){return`jdbc:sqlserver://db:${this.options.port};databaseName=${this.options.database};trustServerCertificate=true`}constructor(t=U){super({...U,...t})}async onDatabaseReady(){await this.run(`CREATE DATABASE ${this.options.database}`),await this.run(`ALTER DATABASE ${this.options.database} COLLATE SQL_Latin1_General_CP1_CS_AS`),await this.run(`ALTER DATABASE ${this.options.database} SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;`)}getService=()=>({image:`mcr.microsoft.com/mssql/server:${this.version}-latest`,ports:[`${this.options.port||1433}:1433`],environment:{ACCEPT_EULA:"y",MSSQL_SA_PASSWORD:this.options.password||"dcdx",MSSQL_PID:this.options.edition},networks:{shared:{aliases:["db","database"]}}})}const B={port:3306,database:"dcdx",username:"dcdx",password:"dcdx",version:"8.0"};class MySQL extends q{name="mysql";driver="com.mysql.jdbc.Driver";options=B;version="8.0";get url(){return`jdbc:mysql://db:${this.options.port}/${this.options.database}?sessionVariables=transaction_isolation='READ-COMMITTED'`}constructor(t=B){super({...B,...t})}async onDatabaseReady(){await this.run(`ALTER DATABASE ${this.options.database} CHARACTER SET 'utf8mb4' COLLATE utf8mb4_bin`)}getService=()=>({image:`mysql:${this.version}`,ports:[`${this.options.port||3306}:3306`],environment:{MYSQL_ROOT_PASSWORD:this.options.password||"dcdx",MYSQL_USER:this.options.username||"dcdx",MYSQL_PASSWORD:this.options.password||"dcdx",MYSQL_DATABASE:this.options.database||"dcdx"},command:["--log_bin_trust_function_creators=1"],networks:{shared:{aliases:["db","database"]}}})}const N={version:"15",database:"dcdx",port:5432,username:"dcdx",password:"dcdx"};class Postgres extends q{name="postgresql";driver="org.postgresql.Driver";options=N;version="15";get url(){return`jdbc:postgresql://db:${this.options.port}/${this.options.database}`}constructor(t=N){super({...N,...t})}getService=()=>({image:`postgres:${this.version}`,ports:[`${this.options.port||5432}:5432`],environment:{POSTGRES_USER:this.options.username||"dcdx",POSTGRES_PASSWORD:this.options.password||"dcdx",POSTGRES_DB:this.options.database||"dcdx",POSTGRES_HOST_AUTH_METHOD:"md5",POSTGRES_INITDB_ARGS:"--encoding=UTF-8 --lc-collate=C --lc-ctype=C"},networks:{shared:{aliases:["db","database"]}}})}const I=n(k(),".dcdx");class Base extends p{options;constructor(t){super(),this.options=t}get baseUrl(){let t="http://localhost";return this.options.port&&(t+=`:${this.options.port}`),this.options.contextPath?`${t}/${this.options.contextPath}`:t}getDatabaseEngine(t){switch(t){case"postgresql":return new Postgres;case"mssql":return new MSSQL;case"mysql":return new MySQL}}async start(){this.options.clean&&await this.down(),await this.build(this.options.version),await this.database.start(this.options.clean),await this.up()}async stop(){if(await this.database.stop(this.options.prune),this.options.prune)await this.down();else{const t=g(this.getDockerComposeConfig());await r({cwd:j(),configAsString:t,log:!0})}this.emit(`${this.name}:stopped`)}async reset(){await this.database.stop(!0),await this.down()}async cp(t){const e=await this.getServiceState();if(e&&e.state.toLowerCase().startsWith("up")){const e=this.getDockerComposeConfig(),s=g(e);await d("cp",[t,`${this.name}:/opt/quickreload/`],{cwd:j(),configAsString:s,log:!1})}}getJVMArgs(){const t=[];return t.push("-Dupm.plugin.upload.enabled=true"),this.options.devMode&&(t.push("-Djira.dev.mode=true"),t.push("-Datlassian.dev.mode=true")),this.options.quickReload&&t.push("-Dquickreload.dirs=/opt/quickreload"),t}async isApplicationReady(){try{const t=await o.get(`${this.baseUrl}/status`,{validateStatus:()=>!0}).catch((()=>null));if(t&&200===t.status){const{data:e}=t;if("FIRST_RUN"===e.state||"RUNNING"===e.state)return console.log(`The application ${this.name} is ready on ${this.baseUrl} 🎉`),!0}return!1}catch(t){return!1}}getDockerComposeConfig(){return{version:"3.8",services:{[this.name]:this.getService()},networks:{shared:_}}}async up(){const t=this.getDockerComposeConfig(),e=g(t);await l({cwd:j(),configAsString:e,log:!0}),this.emit(`${this.name}:up`);await this.waitUntilReady()?(this.emit(`${this.name}:ready`),await this.tailApplicationLogs()):console.log(`Failed to start ${this.name} ⛔`),s(0)}async down(){const t=g(this.getDockerComposeConfig());await u({cwd:j(),configAsString:t,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async getServiceState(){const t=g(this.getDockerComposeConfig());return(await c({configAsString:t,log:!1,commandOptions:["--all"]})).data.services.find((t=>t.name.includes(this.name)))}async waitUntilReady(t=0){console.log(`Waiting for ${this.name} to become available... ${t}s`);const e=await this.getServiceState();return!!(e&&e.state.toLowerCase().startsWith("up")&&await this.isApplicationReady())||(t>=300?(console.error(`A timeout occurred while waiting for ${this.name} to become available ⛔`),e&&await this.showDockerLogs(e.name),!1):(await new Promise((t=>setTimeout(t,1e3))),this.waitUntilReady(t+1)))}getDockerRepositoryUrl(){return`https://bitbucket.org/atlassian-docker/docker-${"jira"===this.name?"atlassian-jira":"bamboo"===this.name?`${this.name}-server`:`atlassian-${this.name}-server`}.git`}async build(t){const e=this.getDockerRepositoryUrl(),s=n(I,this.name,"source");m(s)?await w({baseDir:s}).pull({"--recurse-submodule":null}):(h(n(I,this.name),{recursive:!0}),await w().clone(e,s,{"--recurse-submodule":null})),await new Promise(((e,o)=>{i("docker",["build","-t",`dcdx/${this.name}:${t}`,"--build-arg",`${this.name.toUpperCase()}_VERSION=${t}`,"."],{cwd:s,stdio:"inherit"}).on("exit",(t=>0===t?e():o(new Error(`Docker exited with code ${t}`))))}))}async tailApplicationLogs(){const t=await this.getServiceState();t&&t.state.toLowerCase().startsWith("up")&&await this.showApplicationLogs(t.name).catch((()=>null))}async showDockerLogs(t){return new Promise(((e,s)=>{i("docker",["logs","-f","-n","5000",t],{cwd:j(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}async showApplicationLogs(t){return new Promise(((e,s)=>{i("docker",["exec","-i",t,"tail","-F","-n","5000",this.logFilePath],{cwd:j(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}}class Bamboo extends Base{name=$.BAMBOO;database;logFilePath="/var/atlassian/application-data/bamboo/logs/atlassian-bamboo.log";constructor(t){super(t),this.database=this.getDatabaseEngine(t.database)}getService(){const t=this.getVolumes(),e=this.getEnvironmentVariables();return{build:{context:toAbsolutePath("../../assets"),dockerfile_inline:`\nFROM dcdx/${this.name}:${this.options.version}\nCOPY ./mysql-connector-j-8.3.0.jar /opt/atlassian/bamboo/lib/mysql-connector-j-8.3.0.jar\nCOPY ./quickreload-5.0.2.jar /var/atlassian/application-data/bamboo/shared/plugins/quickreload-5.0.2.jar\nRUN echo "/opt/quickreload" > /var/atlassian/application-data/bamboo/quickreload.properties; mkdir -p /opt/quickreload; chown -R bamboo:bamboo /opt/quickreload;\n\nRUN chown -R bamboo:bamboo /var/atlassian/application-data/bamboo`},ports:[`${this.options.port||80}:8085`,...this.options.debug?["5005:5005"]:[]],environment:Object.keys(e).length>0?e:void 0,volumes:t.length>0?t:void 0,networks:["shared"]}}getJVMArgs(){const t=super.getJVMArgs();return this.options.debug&&(t.push("-Xdebug"),t.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005")),t}async isApplicationReady(){try{const t=await o.get(`${this.baseUrl}/setup/setupGeneralConfiguration.action`,{validateStatus:()=>!0}).catch((()=>null));return 200===t?.status}catch(t){return!1}}getEnvironmentVariables(){return{...this.options.contextPath?{ATL_TOMCAT_CONTEXTPATH:this.options.contextPath}:"",JVM_SUPPORT_RECOMMENDED_ARGS:this.getJVMArgs().join(" "),ATL_BAMBOO_ENABLE_UNATTENDED_SETUP:"true",ATL_LICENSE:this.options.license||L,ATL_JDBC_URL:this.database.url,ATL_JDBC_USER:this.database.options.username,ATL_JDBC_PASSWORD:this.database.options.password,ATL_DB_TYPE:`${this.database.name}`}}getVolumes(){return[...this.options.quickReload?[`${this.options.quickReload}:/opt/quickreload`]:""]}}const{P:F,activeProfiles:G}=O(M(process.argv)).parseSync(),Q=F||G||void 0;class AMPS{static maven;static stop(){AMPS.maven&&S.maven.kill(0)}static async build(t){return new Promise(((e,s)=>{if(AMPS.maven){AMPS.maven.kill(0)||s(new Error("Failed to terminate existing Maven process"))}AMPS.maven=i("mvn",["package",...t],{cwd:j(),stdio:"inherit"}),AMPS.maven.on("exit",(t=>{AMPS.maven=null,0===t||130===t?e():s(new Error(`Maven exited with code ${t}`))}))}))}static isAtlassianPlugin=()=>{try{return AMPS.getNodes("//*[local-name()='packaging']").some((t=>"atlassian-plugin"===t.textContent))}catch(t){return!1}};static getApplicationVersion(){const t=Q?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${Q}']/..//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']`,!0):AMPS.getNodes("//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']",!0);if(t){const e=t.parentNode;if(e){const{plugin:t}=AMPS.toObject(e),s=t?.configuration?.productVersion;return s?this.doPropertyReplacement(s):void 0}}}static getApplication(){const t=AMPS.getApplications();if(1===t.length)return t[0];if(Q){const t=AMPS.getApplications(Q);if(1===t.length)return t[0]}return null}static getApplications(t){const e=new Set;return(t?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${t}']/..//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']`):AMPS.getNodes("//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']")).forEach((t=>{const s=t.parentNode;if(s){const{plugin:t}=AMPS.toObject(s);t?.artifactId?.includes($.JIRA)?e.add($.JIRA):t?.artifactId?.includes($.CONFLUENCE)?e.add($.CONFLUENCE):t?.artifactId?.includes($.BAMBOO)?e.add($.BAMBOO):t?.artifactId?.includes($.BITBUCKET)&&e.add($.BITBUCKET)}})),Array.from(e)}static doPropertyReplacement(t){let e=t;const s=Q?AMPS.getProperties(Q):{};Object.entries(s).forEach((([t,s])=>{e=e.replaceAll(`\${${t}}`,s)}));const o=AMPS.getProperties();return Object.entries(o).forEach((([t,s])=>{e=e.replaceAll(`\${${t}}`,s)})),e}static getProperties(t){const e={};return(t?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${t}']/..//*[local-name()='properties']`):AMPS.getNodes("//*[local-name()='properties']")).forEach((t=>{const{properties:s}=AMPS.toObject(t);Object.entries(s).forEach((([t,s])=>e[t]=s))})),e}static getNodes(t,e){if(m("./pom.xml")){const s=b("./pom.xml","utf8"),o=(new D).parseFromString(s,"text/xml"),a=e?T.select(t,o,!0):T.select(t,o,!1);return Array.isArray(a)||e?a:[]}return[]}static toObject(t){try{return(new C).parse((new x).serializeToString(t))}catch(t){return null}}}const V=AMPS.getApplicationVersion()||"latest";(async()=>{const s=t.showHelpAfterError(!0).addOption(new e("-v, --version <version>","The version of the host application").choices(R).default(V)).addOption(new e("-d, --database <name>","The database engine to remove data from").choices(["postgresql","mysql","mssql"]).default("postgresql")).parse(process.argv).opts(),o=new Bamboo({version:s.version,database:s.database});await o.reset()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),s()}));
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{program as u,Option as t}from"commander";import{gracefulExit as d}from"exit-hook";import{dirname as n,join as k}from"path";import j from"axios";import{spawn as e}from"child_process";import{stop as b,downAll as a,ps as i,execCompose as s,upAll as o}from"docker-compose/dist/v2.js";import r from"events";import{existsSync as l,mkdirSync as p,readFileSync as c}from"fs";import{dump as h}from"js-yaml";import{homedir as m}from"os";import{cwd as g}from"process";import w from"simple-git";import{upAll as S}from"docker-compose";import{Sequelize as A,ConnectionError as v,TimeoutError as f,ConnectionTimedOutError as y,ConnectionRefusedError as R,ConnectionAcquireTimeoutError as P}from"sequelize";import{DOMParser as D,XMLSerializer as C}from"@xmldom/xmldom";import{XMLParser as E}from"fast-xml-parser";import x from"xpath";import{hideBin as M}from"yargs/helpers";import O from"yargs/yargs";var $=["8.2.1-ubuntu-jdk11","8.2.1-jdk11","8.2.1","8.16.2-ubuntu-jdk17","8.16.2-jdk17","8.16.2","8.1.1-ubuntu-jdk11","8.1.1-jdk11","8.1.1","8.8-ubuntu-jdk17","8.8-jdk17","8.8.7-ubuntu-jdk17","8.8.7-jdk17","8.8.7","8.8","8.3.2-ubuntu-jdk11","7.21.5-ubuntu-jdk11","8.3.2-jdk11","7.21.5-jdk11","8.3.2","8.2.2-ubuntu-jdk11","7.21.5","8.2.2-jdk11","8.2.2","8.1.2-ubuntu-jdk11","8.1.2-jdk11","8.1.2","7.21.2-ubuntu-jdk11","7.21.2-jdk11","7.21.2","8.3.3-ubuntu-jdk11","8.3.3-jdk11","8.3.3","8.16-ubuntu-jdk17","8.16-jdk17","8.16.3-ubuntu-jdk17","8.16.3-jdk17","8.16.3","8.16","8.14.2-ubuntu-jdk17","8.15.1-ubuntu-jdk17","8.15.1-jdk17","8.14.2-jdk17","8.14.3-ubuntu-jdk17","8.15.1","8.14.2","8.14.3-jdk17","8.9.4-ubuntu-jdk17","8.9.4-jdk17","8.14.4-ubuntu-jdk17","8.14.3","8.9.4","8.14.4-jdk17","8.14.5-ubuntu-jdk17","8.14.4","8.8.1-ubuntu-jdk17","8.8.1-jdk17","8.14-ubuntu-jdk17","8.8.1","8.14-jdk17","8.14.5-jdk17","8.11.3-ubuntu-jdk17","8.11.3-jdk17","8.15.0-ubuntu-jdk17","8.14.5","8.15.0-jdk17","8.11.3","8.14","8.0.1-ubuntu-jdk11","8.15.0","8.0.1-jdk11","8.0.1","8.7.0-ubuntu-jdk11","8.7.0-jdk11","8.7.0","8.10.5-ubuntu-jdk17","8.10.5-jdk17","8.10.5","7.21.14-ubuntu-jdk11","7.21.14-jdk11","8.9.0-ubuntu-jdk17","7.21.14","8.9.0-jdk17","8.9.0","8.5-ubuntu-jdk11","8.5-jdk11","8.5.4-ubuntu-jdk11","8.5.4-jdk11","8.5.4","8.5","8.4.3-ubuntu-jdk11","8.4.3-jdk11","8.4.3","7.21.6-ubuntu-jdk11","7.21.6-jdk11","7.21.6","7.21.20-ubuntu-jdk11","7.21.20-jdk11","7.21.20","7.21.1-ubuntu-jdk11","7.21.1-jdk11","7.21.1","8.3-ubuntu-jdk11","8.3-jdk11","8.3.4-ubuntu-jdk11","8.3.4-jdk11","8.3.4","8.3","8.2.3-ubuntu-jdk11","8.2.3-jdk11","8.2.3","8.15.2-ubuntu-jdk17","8.15.2-jdk17","8.15.2","8.1.3-ubuntu-jdk11","8.1.3-jdk11","8.1.3","8.9.5-ubuntu-jdk17","8.9.5-jdk17","8.10.0-ubuntu-jdk17","8.10.0-jdk17","8.10.0","8.0.2-ubuntu-jdk11","8.0.2-jdk11","8.0.2","7.20.0-ubuntu-jdk11","7.20.0-jdk11","7.20.0","8.9.5","8.8.2-ubuntu-jdk17","8.8.2-jdk17","8.8.2","8.17.0-ubuntu-jdk17","8.17.0-jdk17","8.17.0","8.11.4-ubuntu-jdk17","8.11.4-jdk17","8.11.4","8.10-ubuntu-jdk17","8.10-jdk17","8.10.6-ubuntu-jdk17","8.10.6-jdk17","8.10.6","8.10","8.9.1-ubuntu-jdk17","8.9.1-jdk17","8.7.1-ubuntu-jdk11","8.9.1","8.7.1-jdk11","8.7.1","8.4-ubuntu-jdk11","8.4-jdk11","8.4.4-ubuntu-jdk11","8.4.4-jdk11","8.4.4","8.4","8.12.1-ubuntu-jdk17","8.12.1-jdk17","8.12.1","7.21.7-ubuntu-jdk11","7.21.7-jdk11","7.21.7","7.21.21-ubuntu-jdk11","7.21.21-jdk11","7.21.21","7.21.15-ubuntu-jdk11","7.21.15-jdk11","7.21.15","7.21.10-jdk11","7.21.10-ubuntu-jdk11","7.21.10","8.2-ubuntu-jdk11","8.2-jdk11","8.2.4-ubuntu-jdk11","8.2.4-jdk11","8.2.4","8.2","8.15.3-ubuntu-jdk17","8.15.3-jdk17","8.15.3","8.12-ubuntu-jdk17","8.12-jdk17","8.12.6-ubuntu-jdk17","8.12.6-jdk17","8.12.6","8.12","8.6.0-ubuntu-jdk11","8.6.0","8.6.0-jdk11","8.1.4-ubuntu-jdk11","8.1.4-jdk11","8.1.4","8.13.4-ubuntu-jdk17","8.13.4-jdk17","8.13.4","8.0.3-ubuntu-jdk11","8.0.3-jdk11","8.0.3","7.20.1-ubuntu-jdk11","8.9.6-ubuntu-jdk17","7.20.1-jdk11","8.9.6-jdk17","7.20.1","8.9.6","8.17-ubuntu-jdk17","8.17-jdk17","8.17.1-ubuntu-jdk17","8.17.1-jdk17","8.17.1","8.17","8.11.5-ubuntu-jdk17","8.11.5-jdk17","8.11.5","8.10.1-ubuntu-jdk17","8.10.1-jdk17","8.10.1","8.8.3-ubuntu-jdk17","8.8.3-jdk17","8.8.3","8.7.2-ubuntu-jdk11","8.7.2-jdk11","8.7.2","7-ubuntu-jdk11","7-jdk11","7.21-ubuntu-jdk11","7.21-jdk11","7.21.8-ubuntu-jdk11","7.21.8-jdk11","7.21.8","7.21.22-ubuntu-jdk11","7.21.22-jdk11","7.21.22","7.21","7","8.9-ubuntu-jdk17","8.9-jdk17","8.9.10-ubuntu-jdk17","8.9.10-jdk17","8.9.10","8.9","8.12.2-ubuntu-jdk17","8.12.2-jdk17","8.12.2","7.21.16-ubuntu-jdk11","7.21.16-jdk11","7.21.16","8.6.1-ubuntu-jdk11","8.6.1-jdk11","8.6.1","8.4.0-ubuntu-jdk11","8.4.0-jdk11","8.4.0","8.15-ubuntu-jdk17","8.15-jdk17","8.15.4-ubuntu-jdk17","8.15.4-jdk17","8.15.4","8.15","8.13.5-ubuntu-jdk17","8.13.5-jdk17","8.13.5","8.0.4-ubuntu-jdk11","8.0.4-jdk11","8.0.4","7.21.11-ubuntu-jdk11","7.21.11-jdk11","7.21.11","7.20.2-ubuntu-jdk11","7.20.2-jdk11","7.20.2","8.9.7-ubuntu-jdk17","8.9.7-jdk17","8.9.7","8.5.0-ubuntu-jdk11","8.5.0-jdk11","8.5.0","8.1-ubuntu-jdk11","8.1-jdk11","8.1.5-ubuntu-jdk11","8.1.5-jdk11","8.1.5","8.11.0-ubuntu-jdk17","8.11.0-jdk17","8.11.0","8.1","8.8.4-ubuntu-jdk17","8.8.4-jdk17","8.8.4","8.7.3-ubuntu-jdk11","8.13.0-ubuntu-jdk17","8.13.0-jdk17","8.13.0","8.11-ubuntu-jdk17","8.11-jdk17","8.11.6-ubuntu-jdk17","8.11.6-jdk17","8.11.6","8.11","8.10.2-ubuntu-jdk17","8.10.2-jdk17","latest","8.10.2","jdk17","8-ubuntu-jdk17","8-jdk17","8.7.3-jdk11","8.7.3","8.18.0-ubuntu-jdk17","8.12.3-ubuntu-jdk17","8.12.3-jdk17","8.12.3","8","7.21.9-ubuntu-jdk11","7.21.9-jdk11","7.21.9","ubuntu-jdk17","7.21.17-ubuntu-jdk11","8.6.2-ubuntu-jdk11","8.6.2-jdk11","8.6.2","8.4.1-ubuntu-jdk11","8.4.1-jdk11","8.4.1","8.3.0-ubuntu-jdk11","8.3.0-jdk11","8.3.0","8.18-ubuntu-jdk17","8.18-jdk17","8.18.0-jdk17","8.18.0","8.18","8.13-ubuntu-jdk17","8.13-jdk17","8.13.6-ubuntu-jdk17","8.13.6-jdk17","8.13.6","8.13","8.0-ubuntu-jdk11","8.0-jdk11","8.0.5-ubuntu-jdk11","8.0.5-jdk11","8.0.5","8.0","7.21.17-jdk11","7.21.17","7.20-ubuntu-jdk11","7.20-jdk11","7.20.3-ubuntu-jdk11","7.20.3-jdk11","7.20.3","7.20","8.9.8-ubuntu-jdk17","8.9.8-jdk17","8.9.8","8.5.1-ubuntu-jdk11","8.5.1-jdk11","8.5.1","8.11.1-ubuntu-jdk17","8.11.1-jdk17","8.11.1","7.21.3-ubuntu-jdk11","7.21.3-jdk11","7.21.3","7.21.12-ubuntu-jdk11","7.21.12-jdk11","7.21.12","8.9.2-ubuntu-jdk17","8.9.2-jdk17","8.9.2","8.8.5-ubuntu-jdk17","8.8.5-jdk17","8.8.5","8.7.4-ubuntu-jdk11","8.7.4-jdk11","8.7.4","8.13.1-ubuntu-jdk17","8.13.1-jdk17","8.13.1","8.10.3-ubuntu-jdk17","8.6.3-ubuntu-jdk11","8.10.3-jdk17","8.6.3-jdk11","8.10.3","8.6.3","8.16.0-ubuntu-jdk17","8.16.0-jdk17","8.16.0","8.12.4-ubuntu-jdk17","8.12.4-jdk17","8.12.4","8.0.0","7.21.18-ubuntu-jdk11","7.21.18","8.2.0-ubuntu-jdk11","8.2.0-jdk11","8.2.0","8.12.0-ubuntu-jdk17","8.12.0-jdk17","8.12.0","8.0.0-ubuntu-jdk11","8.0.0-jdk11","7.21.4-ubuntu-jdk11","7.21.4-jdk11","7.21.4","7.21.18-jdk11","8.9.9","8.5.2-ubuntu-jdk11","8.5.2-jdk11","8.5.2","8.4.2-ubuntu-jdk11","8.4.2-jdk11","8.4.2","8.3.1-ubuntu-jdk11","8.3.1-jdk11","8.3.1","8.11.2-ubuntu-jdk17","8.11.2-jdk17","8.11.2","8.9.9-ubuntu-jdk17","8.9.9-jdk17","8.14.0-ubuntu-jdk17","8.14.0-jdk17","8.14.0","8.13.2-ubuntu-jdk17","8.13.2-jdk17","8.13.2","7.21.13-ubuntu-jdk11","7.21.13-jdk11","7.21.13","8.7-ubuntu-jdk11","8.7-jdk11","8.7.5-ubuntu-jdk11","8.7.5-jdk11","8.7.5","8.7","8.6-ubuntu-jdk11","8.6-jdk11","8.6.4-ubuntu-jdk11","8.6.4-jdk11","8.6.4","8.6","7.21.0-ubuntu-jdk11","7.21.0-jdk11","7.21.0","8.9.3-ubuntu-jdk17","8.9.3-jdk17","8.9.3","8.8.6-ubuntu-jdk17","8.8.6-jdk17","8.8.6","8.8.0-ubuntu-jdk17","8.8.0-jdk17","8.8.0","8.16.1-ubuntu-jdk17","8.16.1-jdk17","8.16.1","8.12.5-ubuntu-jdk17","8.12.5-jdk17","8.12.5","8.1.0-ubuntu-jdk11","8.1.0-jdk11","8.10.4-ubuntu-jdk17","8.10.4-jdk17","8.10.4","8.1.0","7.21.19-ubuntu-jdk11","7.21.19-jdk11","7.21.19","8.5.3-ubuntu-jdk11","8.5.3-jdk11","8.5.3","8.14.1-ubuntu-jdk17","8.14.1-jdk17","8.14.1","8.13.3-ubuntu-jdk17","8.13.3-jdk17","8.13.3","8.15-ubuntu-jdk11","8.15-jdk11","8.15.3-ubuntu-jdk11","8.15.3-jdk11","8.8.0-ubuntu-jdk11","8.8.0-jdk11","8.16.0-ubuntu-jdk11","8.16.0-jdk11","8.8.1-jdk11","8.12.3-ubuntu-jdk11","8.12.3-jdk11","8.8.1-ubuntu-jdk11","8.16.1-ubuntu-jdk11","8.10.0-ubuntu-jdk11","8.10.0-jdk11","8.16.1-jdk11","7.6.9-ubuntu-jdk11","7.6.9-jdk11","8.12.4-ubuntu-jdk11","8.12.4-jdk11","7.6.9","8.8.2-ubuntu-jdk11","8.8.2-jdk11","7.19-ubuntu-jdk11","7.19-jdk11","7.19.5-ubuntu-jdk11","7.19.5-jdk11","7.19.5","7.19","7.7.0-ubuntu-jdk11","8.16-ubuntu-jdk11","8.16-jdk11","8.16.2-ubuntu-jdk11","7.7.0","8.16.2-jdk11","8.10.1-ubuntu-jdk11","8.10.1-jdk11","7.7.0-jdk11","8.12.5-ubuntu-jdk11","8.8.3-ubuntu-jdk11","8.12.5-jdk11","8.8.3-jdk11","7.7-ubuntu-jdk11","7.7-jdk11","7.7.1-ubuntu-jdk11","7.7.1-jdk11","7.7.1","7.7","7.10.0-ubuntu-jdk11","7.10.0-jdk11","7.10.0","8.10.2-ubuntu-jdk11","8.10.2-jdk11","ubuntu-jdk11","jdk11","8-jdk11","8-ubuntu-jdk11","8.17-ubuntu-jdk11","8.17-jdk11","8.17.0-ubuntu-jdk11","8.17.0-jdk11","8.12-ubuntu-jdk11","8.12-jdk11","8.12.6-ubuntu-jdk11","8.12.6-jdk11","7.16.2-ubuntu-jdk11","7.16.2-jdk11","7.16.2","8.8.4-ubuntu-jdk11","8.8.4-jdk11","7.10-ubuntu-jdk11","7.10-jdk11","7.10.1-ubuntu-jdk11","7.10.1-jdk11","7.10.1","7.10","7.17.3-ubuntu-jdk11","7.17.3-jdk11","8.10.3-ubuntu-jdk11","7.17.3","8.10.3-jdk11","7.8.0-ubuntu-jdk11","7.8.0-jdk11","7.8.0","7.16-jdk11","7.16-ubuntu-jdk11","7.16.3-jdk11","7.16.3-ubuntu-jdk11","7.16.3","7.16","8.13.0-ubuntu-jdk11","8.13.0-jdk11","8.8.5-ubuntu-jdk11","8.8.5-jdk11","7.11.1","7.6.13-ubuntu-jdk11","7.6.13-jdk11","7.17.4-ubuntu-jdk11","7.6.13","7.17.4-jdk11","7.17.4","7.11.1-ubuntu-jdk11","7.11.1-jdk11","7.8-ubuntu-jdk11","8.10.4-ubuntu-jdk11","7.8-jdk11","7.8.1-jdk11","7.8.1-ubuntu-jdk11","7.8.1","7.8","8.10.4-jdk11","7.17.0-ubuntu-jdk11","7.17.0-jdk11","7.17.0","8.13.1-ubuntu-jdk11","8.13.1-jdk11","7.6.14-ubuntu-jdk11","7.6.14-jdk11","7.6.14","7.11-ubuntu-jdk11","7.11-jdk11","7.11.2-ubuntu-jdk11","7.11.2-jdk11","8.8.6-ubuntu-jdk11","8.8.6-jdk11","7.11.2","7.11","7.17.5-ubuntu-jdk11","7.17.5-jdk11","7.17.5","7.9.0-ubuntu-jdk11","7.9.0-jdk11","7.9.0","8.10.5-ubuntu-jdk11","8.10.5-jdk11","7.6.15-ubuntu-jdk11","7.6.15-jdk11","7.6.15","7.17.1-ubuntu-jdk11","7.17.1-jdk11","7.17.1","8.13.2-ubuntu-jdk11","8.13.2-jdk11","7.17.6-ubuntu-jdk11","7.17.6-jdk11","7.17.6","7.12.0-jdk11","7.12.0","8.8-ubuntu-jdk11","8.8-jdk11","7.12.0-ubuntu-jdk11","8.8.7-ubuntu-jdk11","8.8.7-jdk11","7.9-ubuntu-jdk11","7.9-jdk11","7.9.1-ubuntu-jdk11","7.9.1-jdk11","7.9.1","7.9","8.10-ubuntu-jdk11","8.10-jdk11","8.10.6-ubuntu-jdk11","8.10.6-jdk11","7.6.16-ubuntu-jdk11","7.6.16-jdk11","7.6.16","7.17.10-ubuntu-jdk11","7.17.10-jdk11","7.17.10","7.17.7-ubuntu-jdk11","7.17.7-jdk11","7.17.7","7.12-ubuntu-jdk11","7.12-jdk11","7.12.1-ubuntu-jdk11","7.12.1-jdk11","7.12","8.13.3-ubuntu-jdk11","8.13.3-jdk11","7.12.1","7.6.17-ubuntu-jdk11","7.6.17-jdk11","7.6.17","7.17.11-ubuntu-jdk11","7.17.11-jdk11","7.17.11","7.17.8-ubuntu-jdk11","7.17.8-jdk11","7.17.8","8.9.0-ubuntu-jdk11","8.9.0-jdk11","8.13.4-ubuntu-jdk11","8.13.4-jdk11","8.11.0-ubuntu-jdk11","8.11.0-jdk11","7.6.18-ubuntu-jdk11","7.6.18-jdk11","7.6.18","7.13.0-ubuntu-jdk11","7.13.0-jdk11","7.13.0","7.17.12-ubuntu-jdk11","7.17.12-jdk11","7.17.12","7.17.9-ubuntu-jdk11","7.17.9-jdk11","7.17.9","8.13-ubuntu-jdk11","8.13-jdk11","8.13.5-ubuntu-jdk11","8.13.5-jdk11","7.6.19-ubuntu-jdk11","7.6.19-jdk11","7.6.19","7.13-ubuntu-jdk11","7.13-jdk11","7.13.1-ubuntu-jdk11","7.13.1-jdk11","7.13.1","7.13","8.9.1-ubuntu-jdk11","8.9.1-jdk11","8.11.1-ubuntu-jdk11","8.11.1-jdk11","7.17.13-ubuntu-jdk11","7.17.13-jdk11","7.17.13","7.18.0-ubuntu-jdk11","7.18.0-jdk11","7.18.0","7.6.2-ubuntu-jdk11","7.6.2-jdk11","8.9.2-ubuntu-jdk11","7.6.2","8.9.2-jdk11","8.14.0-ubuntu-jdk11","8.14.0-jdk11","8.11.2-ubuntu-jdk11","8.11.2-jdk11","7.17.14-ubuntu-jdk11","7.17.14-jdk11","7.17.14","7.14.0-ubuntu-jdk11","7.14.0-jdk11","7.14.0","7.6.20-ubuntu-jdk11","7.6.20-jdk11","7.6.20","7.18.1-ubuntu-jdk11","7.18.1-jdk11","7.18.1","7.14.1-ubuntu-jdk11","7.14.1","7.18.2-ubuntu-jdk11","7.17.15-ubuntu-jdk11","7.17.15-jdk11","7.17.15","7.14.1-jdk11","8.9.3-ubuntu-jdk11","8.9.3-jdk11","8.14.1-ubuntu-jdk11","8.14.1-jdk11","8.11.3-ubuntu-jdk11","8.11.3-jdk11","7.6.21-ubuntu-jdk11","7.6.21-jdk11","7.6.21","7.18.2-jdk11","7.18.2","7.14-ubuntu-jdk11","7.14.2-ubuntu-jdk11","7.14.2-jdk11","7.6.22-ubuntu-jdk11","7.6.22-jdk11","7.6.22","7.5.0-ubuntu-jdk11","7.5.0-jdk11","7.5.0","7.18.3","7.17.16-ubuntu-jdk11","7.17.16-jdk11","7.17.16","7.14-jdk11","7.14.2","7.14","8.14.2-ubuntu-jdk11","8.14.2-jdk11","7.18.3-ubuntu-jdk11","7.18.3-jdk11","8.9.4-ubuntu-jdk11","8.9.4-jdk11","8.11.4-ubuntu-jdk11","8.11.4-jdk11","7.6-ubuntu-jdk11","7.6-jdk11","7.6.23-ubuntu-jdk11","7.6.23-jdk11","7.6.23","7.6","7.5.1-ubuntu-jdk11","7.5.1-jdk11","7.5.1","7.17.17-ubuntu-jdk11","7.17.17-jdk11","7.17.17","7.18-ubuntu-jdk11","7.18-jdk11","7.18.4-ubuntu-jdk11","7.18.4-jdk11","7.18.4","7.18","8.14.3-ubuntu-jdk11","7.15.0-jdk11","8.14.3-jdk11","8.11.5-ubuntu-jdk11","8.11.5-jdk11","7.15.0-ubuntu-jdk11","7.15.0","8.9.5-ubuntu-jdk11","8.9.5-jdk11","7.5-ubuntu-jdk11","7.5-jdk11","7.5.2-ubuntu-jdk11","7.5.2-jdk11","7.5.2","7.5","7.17.18-ubuntu-jdk11","7.17.18-jdk11","7.17.18","7.15.1-ubuntu-jdk11","7.15.1-jdk11","7.15.1","8.14-jdk11","8.14.4-jdk11","8.9.6-ubuntu-jdk11","7.6.3-ubuntu-jdk11","7.6.3-jdk11","8.9.6-jdk11","7.6.3","8.14-ubuntu-jdk11","8.14.4-ubuntu-jdk11","8.11-ubuntu-jdk11","8.11-jdk11","8.11.6-ubuntu-jdk11","8.11.6-jdk11","7.19.0-ubuntu-jdk11","7.19.0-jdk11","7.19.0","7.17.19-ubuntu-jdk11","7.17.19-jdk11","7.17.19","7.15.2-ubuntu-jdk11","7.15.2-jdk11","7.15.2","7.6.4-ubuntu-jdk11","7.6.4-jdk11","7.6.4","7.6.0-ubuntu-jdk11","7.6.0-jdk11","7.6.0","8.9.7-ubuntu-jdk11","8.9.7-jdk11","7.19.1-ubuntu-jdk11","7.19.1-jdk11","7.19.1","7.17.2-ubuntu-jdk11","7.17.2","7.17.2-jdk11","7.15-ubuntu-jdk11","7.15-jdk11","7.15.3-ubuntu-jdk11","7.15.3-jdk11","7.15.3","7.15","8.15.0-ubuntu-jdk11","8.15.0-jdk11","8.12.0-ubuntu-jdk11","8.12.0-jdk11","7.6.5-ubuntu-jdk11","7.6.5-jdk11","7.6.5","7.6.1-ubuntu-jdk11","7.6.1-jdk11","7.6.1","8.9.8-ubuntu-jdk11","8.9.8-jdk11","7.19.2-ubuntu-jdk11","7.19.2-jdk11","7.19.2","7.17.20-ubuntu-jdk11","7.17.20-jdk11","7.17.20","7.6.6-ubuntu-jdk11","7.6.6-jdk11","7.6.6","7.6.10-ubuntu-jdk11","7.6.10-jdk11","7.6.10","8.15.1-ubuntu-jdk11","8.15.1-jdk11","8.12.1-ubuntu-jdk11","8.12.1-jdk11","7.19.3-ubuntu-jdk11","7.19.3-jdk11","7.19.3","7.16.0-ubuntu-jdk11","7.16.0-jdk11","8.9-ubuntu-jdk11","7.16.0","8.9-jdk11","8.9.9-ubuntu-jdk11","8.9.9-jdk11","7.6.7-ubuntu-jdk11","7.6.7-jdk11","7.6.7","7.6.11-ubuntu-jdk11","7.6.11-jdk11","7.6.11","7.17-ubuntu-jdk11","7.17-jdk11","7.17.21-ubuntu-jdk11","7.17.21-jdk11","7.17.21","7.17","8.15.2-ubuntu-jdk11","8.15.2-jdk11","8.12.2-ubuntu-jdk11","8.12.2-jdk11","7.19.4-ubuntu-jdk11","7.19.4-jdk11","7.19.4","7.16.1-ubuntu-jdk11","7.16.1-jdk11","7.16.1","7.6.8-ubuntu-jdk11","7.6.8-jdk11","7.6.8","7.6.12-ubuntu-jdk11","7.6.12-jdk11","7.6.12","8.14.0-eap01","8.14.0-eap01-ubuntu-jdk11","8.14.0-eap01-jdk11","7.4-ubuntu-jdk11","7.4-jdk11","7.4.1-ubuntu-jdk11","7.4.1-jdk11","7.4.1","7.4.0-ubuntu-jdk11","7.4.0-jdk11","7.4.0","7.3-ubuntu-jdk11","7.3-jdk11","7.3.2-ubuntu-jdk11","7.3.2-jdk11","7.3.2","7.3","7.4.2-ubuntu-jdk11","7.4.2-jdk11","7.4.2","7.4","7.3.1-ubuntu-jdk11","7.3.1-jdk11","7.3.1","7.3.0-ubuntu-jdk11","7.3.0-jdk11","7.3.0","7.2.5-ubuntu-jdk11","7.2.5-jdk11","7.2.5","7.2.4-ubuntu-jdk11","7.2.4-jdk11","7.2.4","7.2.3-ubuntu-jdk11","7.2.3-jdk11","7.2.3","7.2.2-ubuntu-jdk11","7.2.2-jdk11","7.2.2","7.2.1-ubuntu-jdk11","7.2.1-jdk11","7.2.1","7.2.0-ubuntu-jdk11","7.2.0-jdk11","7.2.0","7.1-ubuntu-jdk11","7.1-jdk11","7.1.4-ubuntu-jdk11","7.1.4-jdk11","7.1.4","7.1.3-ubuntu-jdk11","7.1.3-jdk11","7.1.3","7.1.2-ubuntu-jdk11","7.1.2-jdk11","7.1.2","7.1.1-ubuntu-jdk11","7.1.1-jdk11","7.1.1","7.1.0-ubuntu-jdk11","7.1.0-jdk11","7.1.0","7.1","7.2-ubuntu-jdk11","7.2-jdk11","7.2.6-ubuntu-jdk11","7.2.6-jdk11","7.2.6","7.2","eap-ubuntu-jdk11","eap-jdk11","eap","8.0.0-eap05-ubuntu-jdk11","8.0.0-eap05-jdk11","8.0.0-eap05","7.0-jdk11","7.0-ubuntu-jdk11","7.0.5-ubuntu-jdk11","7.0.5-jdk11","7.0.5","7.0","6.10.17-ubuntu-jdk11","6.10.17","6.10.17-jdk11","6.10","6","6-ubuntu-jdk11","6-jdk11","6.10-ubuntu-jdk11","6.10-jdk11","6.8.2-jdk11","6.10.11-jdk11","6.8.2","6.10.11","6.8.2-ubuntu-jdk11","6.10.11-ubuntu-jdk11","7.0.0-jdk11","7.0.0-ubuntu-jdk11","7.0.0","6.8.3","6.7.1","6.7.1-ubuntu-jdk11","6.10.12-jdk11","6.8.3-ubuntu-jdk11","6.7.1-jdk11","6.10.12","6.8.3-jdk11","6.10.12-ubuntu-jdk11","7.0.1-ubuntu-jdk11","7.0.1-jdk11","7.0.1","6.7.2-jdk11","6.10.3","6.8.4-jdk11","6.7.2","6.10.3-jdk11","6.8","6.10.13-jdk11","6.7.2-ubuntu-jdk11","6.10.3-ubuntu-jdk11","6.8-ubuntu-jdk11","6.10.13-ubuntu-jdk11","6.8-jdk11","6.10.13","6.8.4-ubuntu-jdk11","7.0.2-ubuntu-jdk11","6.8.4","7.0.2","6.7.3-ubuntu-jdk11","7.0.2-jdk11","6.10.4-jdk11","6.7.3","6.10.4-ubuntu-jdk11","6.7.3-jdk11","6.10.14-ubuntu-jdk11","6.10.4","6.10.14","6.10.14-jdk11","7.0.3-jdk11","6.9.0-ubuntu-jdk11","7.0.3","6.7.4-ubuntu-jdk11","6.10.5-jdk11","6.9.0","7.0.3-ubuntu-jdk11","6.7.4","6.10.5-ubuntu-jdk11","6.9.0-jdk11","6.7.4-jdk11","6.10.15-jdk11","6.10.5","6.10.15","6.10.15-ubuntu-jdk11","7.0.4-jdk11","6.9.1-jdk11","6.7-jdk11","7.0.4-ubuntu-jdk11","6.10.7-jdk11","6.9.1","6.7","7.0.4","6.10.7","6.9.1-ubuntu-jdk11","6.7-ubuntu-jdk11","6.10.7-ubuntu-jdk11","6.7.5","6.10.16-jdk11","6.7.5-jdk11","6.7.5-ubuntu-jdk11","6.10.16","6.9.2-ubuntu-jdk11","6.10.16-ubuntu-jdk11","6.10.8","6.9.2-jdk11","6.10.8-ubuntu-jdk11","6.9.2","6.10.8-jdk11","6.9.3-ubuntu-jdk11","6.10.9","6.8.0-jdk11","6.9-jdk11","6.10.9-jdk11","6.8.0-ubuntu-jdk11","6.9.3","6.10.9-ubuntu-jdk11","6.8.0","6.9.3-jdk11","6.9","6.9-ubuntu-jdk11","6.10.2","6.7.0-jdk11","6.8.1-jdk11","6.10.2-jdk11","6.7.0-ubuntu-jdk11","6.8.1","6.10.2-ubuntu-jdk11","6.7.0","6.8.1-ubuntu-jdk11","6.10.0-jdk11","6.10.0-ubuntu-jdk11","6.10.0","6.10.1-jdk11","6.10.1-ubuntu-jdk11","6.10.1","6.10.10-jdk11","6.10.10","6.10.10-ubuntu-jdk11","7.14-ubuntu","7.14-jdk8","7.14.1-ubuntu","7.14-ubuntu-jdk8","7.14.1-jdk8","7.14.1-ubuntu-jdk8","7.11.2-jdk8","7.11-ubuntu","7.11.2-ubuntu","7.11-ubuntu-jdk8","7.11-jdk8","7.11.2-ubuntu-jdk8","7.15.0-jdk8","7.1.2-ubuntu","7.15.0-ubuntu","7.1.2-jdk8","7.15.0-ubuntu-jdk8","7.1.2-ubuntu-jdk8","7.6.4-ubuntu","6.7-jdk8","7.2.2-jdk8","7.6.4-jdk8","7.12.0-jdk8","6.7.5-ubuntu","7.5.1-ubuntu","7.6.4-ubuntu-jdk8","6.7.5-ubuntu-jdk8","7.2.2-ubuntu-jdk8","6.9.0-ubuntu","7.15-ubuntu-jdk8","7.12.0-ubuntu","7.5.1-jdk8","7.1.3-jdk8","7.2.2-ubuntu","6.9.0-jdk8","6.7-ubuntu","7.15.1-ubuntu","7.12.0-ubuntu-jdk8","7.5.1-ubuntu-jdk8","6.9.0-ubuntu-jdk8","6.7.5-jdk8","7.15-ubuntu","7.0.2-ubuntu-jdk8","7.1.3-ubuntu-jdk8","6.7-ubuntu-jdk8","7.15-jdk8","7.0.2-jdk8","7.1.3-ubuntu","7.0.2-ubuntu","7.15.1-jdk8","7.15.1-ubuntu-jdk8","7.2.3-jdk8","7.12.1-ubuntu","7.5.2-ubuntu-jdk8","7.6.5-jdk8","7.2.3-ubuntu","6.9.1-ubuntu","7.5-ubuntu-jdk8","7.6.5-ubuntu-jdk8","7.12.1-jdk8","6.9.1-ubuntu-jdk8","7.1.4-jdk8","7.5-jdk8","7.2.3-ubuntu-jdk8","7.12-jdk8","7.1.4-ubuntu","7.5.2-ubuntu","7.6.5-ubuntu","6.9.1-jdk8","7.0.3-ubuntu-jdk8","7.12-ubuntu-jdk8","6.10.2-jdk8","6.8.0-jdk8","7.12-ubuntu","7.1-ubuntu","7.5.2-jdk8","6.8.0-ubuntu-jdk8","6.10.9-ubuntu-jdk8","7.0.3-jdk8","6.10.2-ubuntu","7.12.1-ubuntu-jdk8","7.1-ubuntu-jdk8","7.5-ubuntu","6.10.9-jdk8","7.0.3-ubuntu","6.10.2-ubuntu-jdk8","7.1.4-ubuntu-jdk8","6.8.0-ubuntu","7.2.4-ubuntu","7.16.0-ubuntu","6.10.9-ubuntu","7.6.6-ubuntu","7.16-jdk8","6.9.2-jdk8","7.1-jdk8","7.16.0-jdk8","7.2.4-ubuntu-jdk8","7.6.6-ubuntu-jdk8","6.9.2-ubuntu-jdk8","7.2.4-jdk8","7.0.4-jdk8","7.6.6-jdk8","6.10.3-ubuntu","6.9.2-ubuntu","7.16.0-ubuntu-jdk8","6.8.1-ubuntu","6.10.3-ubuntu-jdk8","6.7.0-jdk8","7.0.4-ubuntu","6.8.1-ubuntu-jdk8","6.7.0-ubuntu-jdk8","7-ubuntu-jdk8","7.0.4-ubuntu-jdk8","6.10.3-jdk8","6.8.1-jdk8","7-jdk8","7.13.0-jdk8","6.7.0-ubuntu","ubuntu","7.2.5-jdk8","7.6.0-jdk8","7.13.0-ubuntu-jdk8","7.6.7-jdk8","6.9-ubuntu","7.6.0-ubuntu","7.2.5-ubuntu-jdk8","6.10.11-jdk8","7.13.0-ubuntu","7.10.0-ubuntu-jdk8","6.9-jdk8","jdk8","7.10.0-jdk8","6.9.3-ubuntu-jdk8","7.6.7-ubuntu","7.0.5-ubuntu","6.10.4-ubuntu-jdk8","6.8.2-ubuntu-jdk8","ubuntu-jdk8","7.2.5-ubuntu","7.6.0-ubuntu-jdk8","7.10.0-ubuntu","6.9.3-ubuntu","7.6.7-ubuntu-jdk8","6.10.4-ubuntu","6.8.2-ubuntu","7.0-ubuntu","7.16-ubuntu","6.10.4-jdk8","7.0-ubuntu-jdk8","6.7.1-ubuntu-jdk8","6.8.2-jdk8","7.0-jdk8","6.7.1-jdk8","7-ubuntu","6.9-ubuntu-jdk8","6.7.1-ubuntu","6.10.12-jdk8","7.16-ubuntu-jdk8","6.9.3-jdk8","7.13.1-ubuntu-jdk8","6.10.12-ubuntu","7.2.6-jdk8","7.6.1-jdk8","7.10-ubuntu-jdk8","7.6.8-jdk8","7.0.5-jdk8","6.10.12-ubuntu-jdk8","7.2-ubuntu-jdk8","7.10-ubuntu","7.6.8-ubuntu","7.13.1-ubuntu","7.0.5-ubuntu-jdk8","7.2-ubuntu","7.6.1-ubuntu","7.10.1-ubuntu-jdk8","6.8.3-jdk8","7.13-jdk8","6.10.5-ubuntu","7.2.6-ubuntu","7.6.1-ubuntu-jdk8","7.10.1-ubuntu","6.8.3-ubuntu-jdk8","6.7.2-ubuntu-jdk8","7.6.8-ubuntu-jdk8","7.13-ubuntu","7.2-jdk8","6.8.3-ubuntu","6.7.2-ubuntu","7.4.2-jdk8","6.10.5-jdk8","7.13-ubuntu-jdk8","7.2.6-ubuntu-jdk8","7.10-jdk8","7.4-ubuntu-jdk8","6.10.5-ubuntu-jdk8","7.13.1-jdk8","6-ubuntu","6.7.2-jdk8","7.10.1-jdk8","7.4-jdk8","7.4.2-ubuntu","7.6.2-jdk8","7.6-jdk8","7.0.0-ubuntu-jdk8","7.2.0-ubuntu","7.6.2-ubuntu-jdk8","7.0.0-ubuntu","6.10-ubuntu-jdk8","7.6.2-ubuntu","7.1.0-ubuntu","7.2.0-jdk8","6.10.7-jdk8","7.6.9-jdk8","7.0.0-jdk8","6.7.3-jdk8","6.10-ubuntu","7.1.0-ubuntu-jdk8","7.6-ubuntu-jdk8","7.2.0-ubuntu-jdk8","6.7.3-ubuntu-jdk8","6.10-jdk8","6.8-ubuntu-jdk8","7.1.0-jdk8","6.10.7-ubuntu","7.6-ubuntu","6.7.3-ubuntu","6-jdk8","6.8.4-jdk8","6.10.7-ubuntu-jdk8","6.10.13-jdk8","6.8-ubuntu","7.9.1-ubuntu-jdk8","7.6.9-ubuntu","6.10.13-ubuntu-jdk8","6.8.4-ubuntu","7.6.9-ubuntu-jdk8","6.10.13-ubuntu","6.8-jdk8","7.3.0-ubuntu-jdk8","7.6.3-jdk8","7.2.1-ubuntu","7.0.1-ubuntu-jdk8","7.5.0-ubuntu","6-ubuntu-jdk8","6.8.4-ubuntu-jdk8","7.14.0-ubuntu","7.11.1-ubuntu-jdk8","7.6.3-ubuntu-jdk8","7.3.0-ubuntu","7.0.1-jdk8","7.2.1-ubuntu-jdk8","7.5.0-jdk8","6.7.4-ubuntu","7.14.0-jdk8","7.11.1-jdk8","7.6.3-ubuntu","7.0.1-ubuntu","7.5.0-ubuntu-jdk8","7.1.1-ubuntu-jdk8","6.10.8-jdk8","7.14.0-ubuntu-jdk8","7.11.1-ubuntu","7.3.0-jdk8","7.2.1-jdk8","7.1.1-ubuntu","6.7.4-jdk8","6.10.8-ubuntu-jdk8","7.1.1-jdk8","6.7.4-ubuntu-jdk8","6.10.8-ubuntu","7.7.0-ubuntu-jdk8","7.7.0-ubuntu","7.7.0-jdk8","7.7.1-jdk8","7.7.1-ubuntu","7.7-jdk8","7.7-ubuntu","7.7-ubuntu-jdk8","6.10.0-ubuntu","7.7.1-ubuntu-jdk8","6.10.0-jdk8","6.10.0-ubuntu-jdk8","6.10.1-jdk8","6.10.1-ubuntu","7.8.0-ubuntu","6.10.1-ubuntu-jdk8","7.8.0-ubuntu-jdk8","7.8.0-jdk8","6.10.10-ubuntu","6.10.10-ubuntu-jdk8","7.8-ubuntu","6.10.10-jdk8","7.8.1-ubuntu","7.8.1-ubuntu-jdk8","7.8-ubuntu-jdk8","7.8-jdk8","6.10.11-ubuntu-jdk8","7.8.1-jdk8","6.10.11-ubuntu","7.9.0-jdk8","7.9.0-ubuntu","7.9.0-ubuntu-jdk8","7.9.1-jdk8","7.9-ubuntu-jdk8","7.9.1-ubuntu","7.9-ubuntu","7.9-jdk8","7.3.1-ubuntu-jdk8","7.3.1-ubuntu","7.3.1-jdk8","7.3.2-jdk8","7.3.2-ubuntu-jdk8","7.3-ubuntu","7.3-ubuntu-jdk8","7.3-jdk8","7.3.2-ubuntu","7.4.0-ubuntu-jdk8","7.4.0-ubuntu","7.4.0-jdk8","7.4.1-ubuntu-jdk8","7.4.1-ubuntu","7.4.1-jdk8","7.4.2-ubuntu-jdk8","7.4-ubuntu","6.5.0-ubuntu","6.5.0","6.5.0-jdk8","6.5.0-ubuntu-jdk8","6.5.1","6.6.3","6.5.1-ubuntu","6.6.3-ubuntu","6.5.1-ubuntu-jdk8","6.6.3-ubuntu-jdk8","6.5.1-jdk8","6.6.3-jdk8","6.5.2-jdk8","6.6.4-ubuntu","6.5.2-ubuntu-jdk8","6.6-ubuntu-jdk8","6.5.2-ubuntu","6.6","6.5.2","6.6.4-jdk8","6.6.4","6.6.4-ubuntu-jdk8","6.6-jdk8","6.5.1-ubuntu-jdk11","6.6.3-jdk11","6.6-ubuntu","6.5.1-jdk11","6.5-ubuntu","6.6.3-ubuntu-jdk11","6.5.3-jdk8","6.5.3-ubuntu-jdk8","6.5-ubuntu-jdk8","6.5","6.6-ubuntu-jdk11","6.5.2-jdk11","6.5.3-ubuntu","6.5.2-ubuntu-jdk11","6.6.4-jdk11","6.5.3","6.6.4-ubuntu-jdk11","6.5-jdk8","6.6-jdk11","6.5-jdk11","6.5.3-ubuntu-jdk11","6.5-ubuntu-jdk11","6.5.3-jdk11","6.6.0-ubuntu","6.6.0-jdk8","6.6.0-ubuntu-jdk8","6.6.0","6.6.0-jdk11","6.6.0-ubuntu-jdk11","6.6.1-jdk8","6.6.1","6.6.1-ubuntu","6.6.1-ubuntu-jdk8","6.6.1-jdk11","6.6.1-ubuntu-jdk11","6.6.2","6.6.2-ubuntu-jdk8","6.5.0-jdk11","6.6.2-ubuntu-jdk11","6.6.2-jdk8","6.5.0-ubuntu-jdk11","6.6.2-jdk11","6.6.2-ubuntu","6.4.0-ubuntu","6.4.0","6.4.0-ubuntu-jdk8","6.4.0-jdk8","6.0-ubuntu-jdk8","6.4.1-jdk8","6.0.11","6.4.1-ubuntu-jdk8","6.0-jdk8","6.4.1","6.0-ubuntu","6.4.1-ubuntu","6.0.11-ubuntu-jdk8","6.0","6.0.11-jdk8","6.0.11-ubuntu","6.4.2-jdk8","6.4.2-ubuntu-jdk8","6.4.2-ubuntu","6.4.2","6.0.2","6.4.3-jdk8","6.0.2-ubuntu","6.4.3-ubuntu","6.0.2-jdk8","6.4.3","6.0.2-ubuntu-jdk8","6.4.3-ubuntu-jdk8","6.0.3-ubuntu-jdk8","6.4.4-ubuntu","6.0.3","6.4.4-jdk8","6.0.3-jdk8","6.4-jdk8","6.0.3-ubuntu","6.4-ubuntu","6.4","6.4.4-ubuntu-jdk8","6.4-ubuntu-jdk8","6.4.4","6.0.4-jdk8","6.0.4","6.0.4-ubuntu","6.0.4-ubuntu-jdk8","6.0.5-jdk8","6.0.5-ubuntu-jdk8","6.0.5-ubuntu","6.0.5","6.0.6-jdk8","6.0.6-ubuntu-jdk8","6.0.6","6.0.6-ubuntu","6.0.7-ubuntu-jdk8","6.0.7","6.0.7-ubuntu","6.0.7-jdk8","6.0.9-ubuntu","6.0.9","6.0.9-jdk8","6.0.9-ubuntu-jdk8","6.1.0-ubuntu-jdk8","6.1.0-ubuntu","6.1.0","6.1.0-jdk8","6.2.6","6.2.6-ubuntu-jdk8","6.2.6-jdk8","6.2.6-ubuntu","6.2","6.2.7-ubuntu-jdk8","6.2-ubuntu","6.2.7-jdk8","6.2-ubuntu-jdk8","6.2-jdk8","6.2.7-ubuntu","6.2.7","6.3.0-jdk8","6.3.0-ubuntu-jdk8","6.3.0","6.3.0-ubuntu","6.3.1","6.3.1-jdk8","6.3.1-ubuntu-jdk8","6.3.1-ubuntu","6.3.2-ubuntu","6.3.2-jdk8","6.3.2-ubuntu-jdk8","6.3.2","6.3.3","6.3.3-jdk8","6.3.3-ubuntu-jdk8","6.3.3-ubuntu","6.3.4-ubuntu-jdk8","6.3.4-ubuntu","6.3.4","6.3.4-jdk8","6.3.5","6.3.5-ubuntu-jdk8","6.3.5-jdk8","6.3.5-ubuntu","6.3-ubuntu","6.3.6-ubuntu","6.3.6-ubuntu-jdk8","6.3.6","6.3","6.3.6-jdk8","6.3-ubuntu-jdk8","6.3-jdk8","6.1.1-ubuntu","6.1.1","6.1.1-jdk8","6.1.1-ubuntu-jdk8","6.1.2-jdk8","6.1.2","6.1.2-ubuntu","6.1.2-ubuntu-jdk8","6.1.3-ubuntu-jdk8","6.1.3","6.4.0-ubuntu-jdk11","6.2.6-jdk11","6.1.3-jdk8","6.4.0-jdk11","6.2.6-ubuntu-jdk11","6.1.3-ubuntu","6.0-jdk11","6.1.1-ubuntu-jdk11","6.4.1-jdk11","6.0.11-jdk11","6.1.4","6.2.7-ubuntu-jdk11","6.4.1-ubuntu-jdk11","6.0-ubuntu-jdk11","6.1.4-ubuntu-jdk8","6.1.1-jdk11","6.2-ubuntu-jdk11","6.0.11-ubuntu-jdk11","6.1.4-jdk8","6.2-jdk11","6.1.4-ubuntu","6.2.7-jdk11","6.4.2-ubuntu-jdk11","6.1.2-jdk11","6.4.2-jdk11","6.1.2-ubuntu-jdk11","6.2.0-ubuntu-jdk8","6.1.5-jdk8","6.2.0-jdk8","6.1.5-ubuntu","6.2.0-ubuntu","6.1.5","6.2.0","6.0.2-jdk11","6.3.0-ubuntu-jdk11","6.1.5-ubuntu-jdk8","6.4.3-jdk11","6.1.3-ubuntu-jdk11","6.0.2-ubuntu-jdk11","6.3.0-jdk11","6.1.3-jdk11","6.4.3-ubuntu-jdk11","6.2.1","6.1.6-ubuntu-jdk8","6.2.1-ubuntu-jdk8","6.0.3-ubuntu-jdk11","6.1.6-ubuntu","6.3.1-jdk11","6.2.1-ubuntu","6.1.4-ubuntu-jdk11","6.0.3-jdk11","6.1.6","6.3.1-ubuntu-jdk11","6.4.4-ubuntu-jdk11","6.2.1-jdk8","6.1.4-jdk11","6.1.6-jdk8","6.4.4-jdk11","6.4-ubuntu-jdk11","6.4-jdk11","6.0.4-ubuntu-jdk11","6.3.2-ubuntu-jdk11","6.2.0-jdk11","6.1.5-jdk11","6.2.2-ubuntu","6.0.4-jdk11","6.1.7","6.3.2-jdk11","6.2.0-ubuntu-jdk11","6.1.5-ubuntu-jdk11","6.2.2-ubuntu-jdk8","6.1.7-ubuntu-jdk8","6.2.2","6.1.7-ubuntu","6.2.2-jdk8","6.1.7-jdk8","6.0.5-jdk11","6.3.3-ubuntu-jdk11","6.2.1-jdk11","6.1.6-ubuntu-jdk11","6.0.5-ubuntu-jdk11","6.3.3-jdk11","6.2.1-ubuntu-jdk11","6.1.6-jdk11","6.2.3-ubuntu","6.1.8-jdk8","6.0.0-ubuntu","6.2.3-ubuntu-jdk8","6.1.8-ubuntu-jdk8","6.0.0-ubuntu-jdk8","6.2.3","6.1.8-ubuntu","6.0.0-jdk8","6.0.6-ubuntu-jdk11","6.3.4-ubuntu-jdk11","6.2.2-ubuntu-jdk11","6.1.8","6.2.3-jdk8","6.0.0","6.1.7-jdk11","6.0.6-jdk11","6.3.4-jdk11","6.2.2-jdk11","6.1.7-ubuntu-jdk11","6.2.3-ubuntu-jdk11","6.3.5-ubuntu-jdk11","6.0.7-ubuntu-jdk11","6.0.0-ubuntu-jdk11","6.1.8-jdk11","6.2.3-jdk11","6.0.7-jdk11","6.3.5-jdk11","6.0.0-jdk11","6.1.8-ubuntu-jdk11","6.1.9-ubuntu","6.2.4-jdk8","6.0.1-ubuntu-jdk8","6.1-ubuntu-jdk8","6.2.4-ubuntu-jdk8","6.0.1-jdk8","6.1.9-jdk8","6.2.4","6.0.1-ubuntu","6.1-ubuntu","6.2.4-ubuntu","6.0.1","6.0.9-jdk11","6.2.4-ubuntu-jdk11","6.1-jdk8","6.3-jdk11","6.0.1-ubuntu-jdk11","6.1.9-ubuntu-jdk11","6.0.9-ubuntu-jdk11","6.1.9-ubuntu-jdk8","6.2.4-jdk11","6.3.6-jdk11","6.0.1-jdk11","6.1-jdk11","6.1","6.3-ubuntu-jdk11","6.1-ubuntu-jdk11","6.1.9","6.3.6-ubuntu-jdk11","6.1.9-jdk11","6.2.5","6.0.10-ubuntu-jdk8","6.2.5-ubuntu","6.0.10-jdk8","6.1.0-ubuntu-jdk11","6.2.5-jdk11","6.2.5-jdk8","6.0.10-jdk11","6.0.10-ubuntu","6.2.5-ubuntu-jdk8","6.2.5-ubuntu-jdk11","6.1.0-jdk11","6.0.10-ubuntu-jdk11","6.0.10","7-eap","5.16.11-alpine","5-alpine","5.16.11","5.16","5","5.16-alpine","5.16.10","5.16.10-alpine","5.16.9","5.16.9-alpine","5.16.8","5.16.8-alpine","5.16.7-alpine","5.16.7","5.16.6-alpine","5.16.6","5.16.5-alpine","5.16.5","5.9.2-alpine","5.9.2","5.9-alpine","5.9","5.9.1-alpine","5.9.1","5.9.0-alpine","5.9.0","5.8.3-alpine","5.8.3","5.8.2-alpine","5.8.2","5.8.1-alpine","5.8.1","5.8.0-alpine","5.8.0","5.7.4-alpine","5.7.4","5.7-alpine","5.7","5.7.3-alpine","5.7.3","5.7.2-alpine","5.7.2","5.7.1-alpine","5.7.1","5.7.0-alpine","5.7.0","5.6.6-alpine","5.6.6","5.6-alpine","5.6","5.6.5-alpine","5.6.5","5.6.4-alpine","5.6.4","5.6.3-alpine","5.6.3","5.6.2-alpine","5.6.2","5.6.1-alpine","5.6.1","5.6.0-alpine","5.6.0","5.5.9-alpine","5.5.9","5.5-alpine","5.5","5.5.8-alpine","5.5.8","5.5.7-alpine","5.5.7","5.5.6-alpine","5.5.6","5.5.5-alpine","5.5.5","5.5.4-alpine","5.5.4","5.5.3-alpine","5.5.3","5.5.2-alpine","5.5.2","5.5.1-alpine","5.5.1","5.5.0-alpine","5.5.0","5.4.9-alpine","5.4.9","5.4-alpine","5.4","5.4.8-alpine","5.4.8","5.4.7-alpine","5.4.7","5.4.6-alpine","5.4.6","5.4.4-alpine","5.4.4","5.4.3-alpine","5.4.3","5.4.2-alpine","5.4.2","5.4.1-alpine","5.4.1","5.4.0-alpine","5.4.0","5.3.7-alpine","5.3.7","5.3-alpine","5.3","5.3.6-alpine","5.3.6","5.3.5-alpine","5.3.5","5.3.4-alpine","5.3.4","5.3.3-alpine","5.3.3","5.3.2-alpine","5.3.2","5.3.1-alpine","5.3.1","5.3.0-alpine","5.3.0","5.2.8-alpine","5.2.8","5.2-alpine","5.2","5.2.7-alpine","5.2.7","5.2.6-alpine","5.2.6","5.2.5-alpine","5.2.5","5.2.4-alpine","5.2.4","5.2.3-alpine","5.2.3","5.2.2-alpine","5.2.2","5.2.1-alpine","5.2.1","5.2.0-alpine","5.2.0","5.16.4-alpine","5.16.4","5.16.3-alpine","5.16.3","5.16.2-alpine","5.16.2","5.16.1-alpine","5.16.1","5.16.0-alpine","5.16.0","5.15.3-alpine","5.15.3","5.15-alpine","5.15","5.15.2-alpine","5.15.2","5.15.1-alpine","5.15.1","5.15.0-alpine","5.15.0","5.14.4-alpine","5.14.4","5.14-alpine","5.14","5.14.3-alpine","5.14.3","5.14.2-alpine","5.14.2","5.14.1-alpine","5.14.1","5.14.0-alpine","5.14.0","5.13.6-alpine","5.13.6","5.13-alpine","5.13","5.13.5-alpine","5.13.5","5.13.4-alpine","5.13.4","5.13.3-alpine","5.13.3","5.13.1-alpine","5.13.1","5.13.0-alpine","5.13.0","5.12.4-alpine","5.12.4","5.12-alpine","5.12","5.12.3-alpine","5.12.3","5.12.2-alpine","5.12.2","5.12.1-alpine","5.12.1","5.12.0-alpine","5.12.0","5.11.4-alpine","5.11.4","5.11-alpine","5.11","5.11.3-alpine","5.11.3","5.11.2-alpine","5.11.2","5.11.1-alpine","5.11.1","5.10.4-alpine","5.10.4","5.10-alpine","5.10","5.10.3-alpine","5.10.3","5.10.2-alpine","5.10.2","5.10.1-alpine","5.10.1","5.10.0-alpine","5.10.0","5.1.9-alpine","5.1.9","5.1-alpine","5.1","5.1.8-alpine","5.1.8","5.1.7-alpine","5.1.7","5.1.6-alpine","5.1.6","5.1.5-alpine","5.1.5","5.1.4-alpine","5.1.4","5.1.3-alpine","5.1.3","5.1.2-alpine","5.1.2","5.1.1-alpine","5.1.1","5.1.0-alpine","5.1.0","5.0.9-alpine","5.0.9","5.0.8-alpine","5.0.8","5.0.7-alpine","5.0.7","5.0.6-alpine","5.0.6","5.0.5-alpine","5.0.5","5.0.4-alpine","5.0.4","5.0.2-alpine","5.0.2","5.0.10-alpine","5.0.10","5.0-alpine","5.0","5.0.1-alpine","5.0.1","5.0.0-alpine","5.0.0","4.14.5-alpine","4.14.5","4.1.6-alpine","4.1.6","4.1-alpine","4.1","4.11.2-alpine","4.11.2","4.11-alpine","4.11","5.8.4","5.8","4.14","4.13","4.12","4.10","4.9","4.8","4.6","4.7","4.4","4.5","4.3","4.2","4.0"];const T="AAABmg0ODAoPeNp9Ul1v0zAUfc+vsMRbJadJtjGpUiS2JJRONOlaB4SAB9e9W0xTu7JvCv33eImDOoR4vefe4/PhN59hR5bckPiWRNezKJ5FCZkvGUmiJA4yrZALLPkBUrHXotEnu5eBRW6b8KMUoCyw8xH6BVZs2KKce3TJpUJQXAkofh2lOeccIV1dfRhJC7fRXrJuwJzALPL0/qF+pI9XGaPz+uGGspvbkdRx8Awcr0nRdOCnlXnmSlqOUqv0DltureTKg6vOiIZb6J9PoviaRm9pHHs0M9Cf/Rv1Dv/SP5lMyorR99WartZVXmdsUZW03hQOSHtCF+n2TLAB4hlIoYTegSFHo3+AQPK1QTx+m02nzzrko+JQ6MO0HS4oDBffQ5JrojSSnbRo5LZDcMzSEtREdBb1AYwNRzsXff0JgjCwLjG/4mB5giE+JzhbF3esyOn9lxf1F2145a6OWu2V/qmC/2dVdoctmOqptk5PGid+XJx42w3NPPHWQuD9fXJbL8PktfLhU2Av+N2rYMY6uUEFpncY/AYCgfFAMCwCFHzkBlkGH/vRdTeeBSfUMzUDb4W2AhQyM893WPg2Q8oQAYRdBSyKeVUdog==X02jr",toAbsolutePath=u=>{const[,t]=process.argv,d=n(t),j=d.substring(0,d.indexOf("dcdx")+4);return k(j,u.replaceAll("../",""))};var q;!function(u){u.JIRA="jira",u.CONFLUENCE="confluence",u.BITBUCKET="bitbucket",u.BAMBOO="bamboo"}(q||(q={}));const L={name:"shared",driver:"bridge"};let B=class Base extends r{options;sequelize=null;constructor(u){super(),this.options=u}async run(u,t){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(u,{logging:t})}catch(t){console.error("An error occurred while trying to run the following SQL query:",u,t),d()}return null}async start(u=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),u&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const u=await this.getServiceState();u&&await this.showDockerLogs(u.name)}}else console.log(`Failed to start database ${this.name} ⛔`),d(0)}async stop(u=this.options.prune){if(u)await this.down();else{const u=h(this.getDockerComposeConfig());await b({cwd:g(),configAsString:u,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:L}}}async up(){const u=h(this.getDockerComposeConfig());return S({cwd:g(),configAsString:u,log:!0})}async down(){const u=h(this.getDockerComposeConfig());return a({cwd:g(),configAsString:u,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const u="mssql"===this.name?"master":this.options.database;return this.sequelize=new A(u,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[v,f,y,R,P],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((u=>(console.log(u),!1)))}catch(u){return!1}}async getServiceState(){const u=h(this.getDockerComposeConfig());return(await i({configAsString:u,log:!1,commandOptions:["--all"]})).data.services.find((u=>u.name.includes(this.name)))}async showDockerLogs(u){return new Promise(((t,d)=>{e("docker",["logs","-f","-n","5000",u],{cwd:g(),stdio:"inherit"}).on("exit",(u=>0===u?t():d(new Error(`Docker exited with code ${u}`))))}))}};const U={port:1433,database:"dcdx",username:"sa",password:"DataCenterDX!",edition:"Developer",version:"2022"};class MSSQL extends B{name="mssql";driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";options=U;version="2022";get url(){return`jdbc:sqlserver://db:${this.options.port};databaseName=${this.options.database};trustServerCertificate=true`}constructor(u=U){super({...U,...u})}async onDatabaseReady(){await this.run(`CREATE DATABASE ${this.options.database}`),await this.run(`ALTER DATABASE ${this.options.database} COLLATE SQL_Latin1_General_CP1_CS_AS`),await this.run(`ALTER DATABASE ${this.options.database} SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;`)}getService=()=>({image:`mcr.microsoft.com/mssql/server:${this.version}-latest`,ports:[`${this.options.port||1433}:1433`],environment:{ACCEPT_EULA:"y",MSSQL_SA_PASSWORD:this.options.password||"dcdx",MSSQL_PID:this.options.edition},networks:{shared:{aliases:["db","database"]}}})}const _={port:3306,database:"dcdx",username:"dcdx",password:"dcdx",version:"8.0"};class MySQL extends B{name="mysql";driver="com.mysql.jdbc.Driver";options=_;version="8.0";get url(){return`jdbc:mysql://db:${this.options.port}/${this.options.database}?sessionVariables=transaction_isolation='READ-COMMITTED'`}constructor(u=_){super({..._,...u})}async onDatabaseReady(){await this.run(`ALTER DATABASE ${this.options.database} CHARACTER SET 'utf8mb4' COLLATE utf8mb4_bin`)}getService=()=>({image:`mysql:${this.version}`,ports:[`${this.options.port||3306}:3306`],environment:{MYSQL_ROOT_PASSWORD:this.options.password||"dcdx",MYSQL_USER:this.options.username||"dcdx",MYSQL_PASSWORD:this.options.password||"dcdx",MYSQL_DATABASE:this.options.database||"dcdx"},command:["--log_bin_trust_function_creators=1"],networks:{shared:{aliases:["db","database"]}}})}const N={version:"15",database:"dcdx",port:5432,username:"dcdx",password:"dcdx"};class Postgres extends B{name="postgresql";driver="org.postgresql.Driver";options=N;version="15";get url(){return`jdbc:postgresql://db:${this.options.port}/${this.options.database}`}constructor(u=N){super({...N,...u})}getService=()=>({image:`postgres:${this.version}`,ports:[`${this.options.port||5432}:5432`],environment:{POSTGRES_USER:this.options.username||"dcdx",POSTGRES_PASSWORD:this.options.password||"dcdx",POSTGRES_DB:this.options.database||"dcdx",POSTGRES_HOST_AUTH_METHOD:"md5",POSTGRES_INITDB_ARGS:"--encoding=UTF-8 --lc-collate=C --lc-ctype=C"},networks:{shared:{aliases:["db","database"]}}})}const I=k(m(),".dcdx");class Base extends r{options;constructor(u){super(),this.options=u}get baseUrl(){let u="http://localhost";return this.options.port&&(u+=`:${this.options.port}`),this.options.contextPath?`${u}/${this.options.contextPath}`:u}getDatabaseEngine(u){switch(u){case"postgresql":return new Postgres;case"mssql":return new MSSQL;case"mysql":return new MySQL}}async start(){this.options.clean&&await this.down(),await this.build(this.options.version),await this.database.start(this.options.clean),await this.up()}async stop(){if(await this.database.stop(this.options.prune),this.options.prune)await this.down();else{const u=h(this.getDockerComposeConfig());await b({cwd:g(),configAsString:u,log:!0})}this.emit(`${this.name}:stopped`)}async reset(){await this.database.stop(!0),await this.down()}async cp(u){const t=await this.getServiceState();if(t&&t.state.toLowerCase().startsWith("up")){const t=this.getDockerComposeConfig(),d=h(t);await s("cp",[u,`${this.name}:/opt/quickreload/`],{cwd:g(),configAsString:d,log:!1})}}getJVMArgs(){const u=[];return u.push("-Dupm.plugin.upload.enabled=true"),this.options.devMode&&(u.push("-Djira.dev.mode=true"),u.push("-Datlassian.dev.mode=true")),this.options.quickReload&&u.push("-Dquickreload.dirs=/opt/quickreload"),u}async isApplicationReady(){try{const u=await j.get(`${this.baseUrl}/status`,{validateStatus:()=>!0}).catch((()=>null));if(u&&200===u.status){const{data:t}=u;if("FIRST_RUN"===t.state||"RUNNING"===t.state)return console.log(`The application ${this.name} is ready on ${this.baseUrl} 🎉`),!0}return!1}catch(u){return!1}}getDockerComposeConfig(){return{version:"3.8",services:{[this.name]:this.getService()},networks:{shared:L}}}async up(){const u=this.getDockerComposeConfig(),t=h(u);await o({cwd:g(),configAsString:t,log:!0}),this.emit(`${this.name}:up`);await this.waitUntilReady()?(this.emit(`${this.name}:ready`),await this.tailApplicationLogs()):console.log(`Failed to start ${this.name} ⛔`),d(0)}async down(){const u=h(this.getDockerComposeConfig());await a({cwd:g(),configAsString:u,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async getServiceState(){const u=h(this.getDockerComposeConfig());return(await i({configAsString:u,log:!1,commandOptions:["--all"]})).data.services.find((u=>u.name.includes(this.name)))}async waitUntilReady(u=0){console.log(`Waiting for ${this.name} to become available... ${u}s`);const t=await this.getServiceState();return!!(t&&t.state.toLowerCase().startsWith("up")&&await this.isApplicationReady())||(u>=300?(console.error(`A timeout occurred while waiting for ${this.name} to become available ⛔`),t&&await this.showDockerLogs(t.name),!1):(await new Promise((u=>setTimeout(u,1e3))),this.waitUntilReady(u+1)))}getDockerRepositoryUrl(){return`https://bitbucket.org/atlassian-docker/docker-${"jira"===this.name?"atlassian-jira":"bamboo"===this.name?`${this.name}-server`:`atlassian-${this.name}-server`}.git`}async build(u){const t=this.getDockerRepositoryUrl(),d=k(I,this.name,"source");l(d)?await w({baseDir:d}).pull({"--recurse-submodule":null}):(p(k(I,this.name),{recursive:!0}),await w().clone(t,d,{"--recurse-submodule":null})),await new Promise(((t,n)=>{e("docker",["build","-t",`dcdx/${this.name}:${u}`,"--build-arg",`${this.name.toUpperCase()}_VERSION=${u}`,"."],{cwd:d,stdio:"inherit"}).on("exit",(u=>0===u?t():n(new Error(`Docker exited with code ${u}`))))}))}async tailApplicationLogs(){const u=await this.getServiceState();u&&u.state.toLowerCase().startsWith("up")&&await this.showApplicationLogs(u.name).catch((()=>null))}async showDockerLogs(u){return new Promise(((t,d)=>{e("docker",["logs","-f","-n","5000",u],{cwd:g(),stdio:"inherit"}).on("exit",(u=>0===u?t():d(new Error(`Docker exited with code ${u}`))))}))}async showApplicationLogs(u){return new Promise(((t,d)=>{e("docker",["exec","-i",u,"tail","-F","-n","5000",this.logFilePath],{cwd:g(),stdio:"inherit"}).on("exit",(u=>0===u?t():d(new Error(`Docker exited with code ${u}`))))}))}}class Bitbucket extends Base{name=q.BITBUCKET;database;logFilePath="/var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.log";constructor(u){super(u),this.database=this.getDatabaseEngine(u.database)}getService(){const u=this.getVolumes(),t=this.getEnvironmentVariables();return{build:{context:toAbsolutePath("../../assets"),dockerfile_inline:`\nFROM dcdx/${this.name}:${this.options.version}\nCOPY ./quickreload-5.0.2.jar /var/atlassian/application-data/bitbucket/plugins/installed-plugins/quickreload-5.0.2.jar\nCOPY ./mysql-connector-j-8.3.0.jar /var/atlassian/application-data/bitbucket/lib/mysql-connector-j-8.3.0.jar\nRUN echo "/opt/quickreload" > /var/atlassian/application-data/bitbucket/quickreload.properties; mkdir -p /opt/quickreload; chown -R bitbucket:bitbucket /opt/quickreload;\n\nRUN mkdir -p /var/atlassian/application-data/bitbucket/shared; touch /var/atlassian/application-data/bitbucket/shared/bitbucket.properties; echo "setup.license=${this.options.license||T}" >> /var/atlassian/application-data/bitbucket/shared/bitbucket.properties;\n\nRUN chown -R bitbucket:bitbucket /var/atlassian/application-data/bitbucket`},ports:[`${this.options.port||80}:7990`,...this.options.debug?["5005:5005"]:[]],environment:Object.keys(t).length>0?t:void 0,volumes:u.length>0?u:void 0,networks:["shared"]}}getJVMArgs(){const u=super.getJVMArgs();return this.options.debug&&(u.push("-Xdebug"),u.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005")),u}getEnvironmentVariables(){return{JVM_SUPPORT_RECOMMENDED_ARGS:this.getJVMArgs().join(" "),JDBC_URL:this.database.url,JDBC_USER:this.database.options.username,JDBC_PASSWORD:this.database.options.password,JDBC_DRIVER:`${this.database.driver}`}}getVolumes(){return[...this.options.quickReload?[`${this.options.quickReload}:/opt/quickreload`]:""]}}const{P:J,activeProfiles:Q}=O(M(process.argv)).parseSync(),F=J||Q||void 0;class AMPS{static maven;static stop(){AMPS.maven&&S.maven.kill(0)}static async build(u){return new Promise(((t,d)=>{if(AMPS.maven){AMPS.maven.kill(0)||d(new Error("Failed to terminate existing Maven process"))}AMPS.maven=e("mvn",["package",...u],{cwd:g(),stdio:"inherit"}),AMPS.maven.on("exit",(u=>{AMPS.maven=null,0===u||130===u?t():d(new Error(`Maven exited with code ${u}`))}))}))}static isAtlassianPlugin=()=>{try{return AMPS.getNodes("//*[local-name()='packaging']").some((u=>"atlassian-plugin"===u.textContent))}catch(u){return!1}};static getApplicationVersion(){const u=F?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${F}']/..//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']`,!0):AMPS.getNodes("//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']",!0);if(u){const t=u.parentNode;if(t){const{plugin:u}=AMPS.toObject(t),d=u?.configuration?.productVersion;return d?this.doPropertyReplacement(d):void 0}}}static getApplication(){const u=AMPS.getApplications();if(1===u.length)return u[0];if(F){const u=AMPS.getApplications(F);if(1===u.length)return u[0]}return null}static getApplications(u){const t=new Set;return(u?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${u}']/..//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']`):AMPS.getNodes("//*[local-name()='groupId' and text()='com.atlassian.maven.plugins']")).forEach((u=>{const d=u.parentNode;if(d){const{plugin:u}=AMPS.toObject(d);u?.artifactId?.includes(q.JIRA)?t.add(q.JIRA):u?.artifactId?.includes(q.CONFLUENCE)?t.add(q.CONFLUENCE):u?.artifactId?.includes(q.BAMBOO)?t.add(q.BAMBOO):u?.artifactId?.includes(q.BITBUCKET)&&t.add(q.BITBUCKET)}})),Array.from(t)}static doPropertyReplacement(u){let t=u;const d=F?AMPS.getProperties(F):{};Object.entries(d).forEach((([u,d])=>{t=t.replaceAll(`\${${u}}`,d)}));const n=AMPS.getProperties();return Object.entries(n).forEach((([u,d])=>{t=t.replaceAll(`\${${u}}`,d)})),t}static getProperties(u){const t={};return(u?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${u}']/..//*[local-name()='properties']`):AMPS.getNodes("//*[local-name()='properties']")).forEach((u=>{const{properties:d}=AMPS.toObject(u);Object.entries(d).forEach((([u,d])=>t[u]=d))})),t}static getNodes(u,t){if(l("./pom.xml")){const d=c("./pom.xml","utf8"),n=(new D).parseFromString(d,"text/xml"),k=t?x.select(u,n,!0):x.select(u,n,!1);return Array.isArray(k)||t?k:[]}return[]}static toObject(u){try{return(new E).parse((new C).serializeToString(u))}catch(u){return null}}}const V=AMPS.getApplicationVersion()||"latest";(async()=>{const d=u.showHelpAfterError(!0).addOption(new t("-v, --version <version>","The version of the host application").choices($).default(V)).addOption(new t("-d, --database <name>","The database engine to remove data from").choices(["postgresql","mysql","mssql"]).default("postgresql")).parse(process.argv).opts(),n=new Bitbucket({version:d.version,database:d.database});await n.reset()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),d()}));
|