dcdx 1.2.0-next.3 → 1.2.0-next.5
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/versions.json +1 -1
- package/lib/commands/build.js +2 -0
- package/lib/commands/{database-mysql.js → database/mysql.js} +1 -1
- package/lib/commands/{database-postgres.js → database/postgres.js} +1 -1
- package/lib/commands/database.js +1 -1
- package/lib/commands/reset/bamboo.js +2 -0
- package/lib/commands/reset/bitbucket.js +2 -0
- package/lib/commands/reset/confluence.js +2 -0
- package/lib/commands/reset/jira.js +2 -0
- package/lib/commands/{run-bamboo.js → run/bamboo.js} +1 -1
- package/lib/commands/{run-bitbucket.js → run/bitbucket.js} +1 -1
- package/lib/commands/{run-confluence.js → run/confluence.js} +1 -1
- package/lib/commands/run/jira.js +2 -0
- package/lib/commands/run.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/commands/stop/bamboo.js +2 -0
- package/lib/commands/stop/bitbucket.js +2 -0
- package/lib/commands/stop/confluence.js +2 -0
- package/lib/commands/stop/jira.js +2 -0
- package/lib/commands/stop.js +2 -0
- package/lib/index.js +1 -1
- package/lib/types/src/applications/bamboo.d.ts +1 -1
- package/lib/types/src/applications/base.d.ts +1 -0
- package/lib/types/src/applications/bitbucket.d.ts +1 -1
- package/lib/types/src/applications/confluence.d.ts +1 -1
- package/lib/types/src/applications/jira.d.ts +1 -1
- package/lib/types/src/commands/run/jira.d.ts +2 -0
- package/lib/types/src/commands/stop/bamboo.d.ts +2 -0
- package/lib/types/src/commands/stop/bitbucket.d.ts +2 -0
- package/lib/types/src/commands/stop/confluence.d.ts +2 -0
- package/lib/types/src/commands/stop/jira.d.ts +2 -0
- package/lib/types/src/commands/stop.d.ts +2 -0
- package/lib/types/src/helpers/docker.d.ts +5 -0
- package/lib/types/src/types/ApplicationOptions.d.ts +1 -0
- package/package.json +3 -1
- 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-jira.js +0 -2
- /package/lib/commands/{database-mssql.js → database/mssql.js} +0 -0
- /package/lib/types/src/commands/{database-mssql.d.ts → build.d.ts} +0 -0
- /package/lib/types/src/commands/{database-mysql.d.ts → database/mssql.d.ts} +0 -0
- /package/lib/types/src/commands/{database-postgres.d.ts → database/mysql.d.ts} +0 -0
- /package/lib/types/src/commands/{reset-bamboo.d.ts → database/postgres.d.ts} +0 -0
- /package/lib/types/src/commands/{reset-bitbucket.d.ts → reset/bamboo.d.ts} +0 -0
- /package/lib/types/src/commands/{reset-confluence.d.ts → reset/bitbucket.d.ts} +0 -0
- /package/lib/types/src/commands/{reset-jira.d.ts → reset/confluence.d.ts} +0 -0
- /package/lib/types/src/commands/{run-bamboo.d.ts → reset/jira.d.ts} +0 -0
- /package/lib/types/src/commands/{run-bitbucket.d.ts → run/bamboo.d.ts} +0 -0
- /package/lib/types/src/commands/{run-confluence.d.ts → run/bitbucket.d.ts} +0 -0
- /package/lib/types/src/commands/{run-jira.d.ts → run/confluence.d.ts} +0 -0
- /package/lib/types/src/{applications → helpers}/amps.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{watch as t}from"chokidar";import{program as e,Option as s}from"commander";import{gracefulExit as o,asyncExitHook as a}from"exit-hook";import{dirname as i,join as n,resolve as r}from"path";import{cwd as c}from"process";import{DOMParser as l,XMLSerializer as d}from"@xmldom/xmldom";import{spawn as p}from"child_process";import{XMLParser as u}from"fast-xml-parser";import{existsSync as h,readFileSync as g,mkdirSync as m}from"fs";import b from"xpath";import{hideBin as A}from"yargs/helpers";import f from"yargs/yargs";import w from"dockerode";import v from"axios";import{stop as S,downAll as k,ps as P,execCompose as R,upAll as E}from"docker-compose/dist/v2.js";import C from"events";import{dump as D}from"js-yaml";import{homedir as y}from"os";import T from"simple-git";import{upAll as O}from"docker-compose";import{Sequelize as M,ConnectionError as x,TimeoutError as U,ConnectionTimedOutError as L,ConnectionRefusedError as q,ConnectionAcquireTimeoutError as j}from"sequelize";var B;!function(t){t.JIRA="jira",t.CONFLUENCE="confluence",t.BITBUCKET="bitbucket",t.BAMBOO="bamboo"}(B||(B={}));const{P:_,activeProfiles:N}=f(A(process.argv)).parseSync(),I=_||N||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=p("mvn",["package",...t],{cwd:c(),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=I?AMPS.getNodes(`//*[local-name()='profile']/*[local-name()='id' and text()='${I}']/..//*[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(I){const t=AMPS.getApplications(I);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(B.JIRA)?e.add(B.JIRA):t?.artifactId?.includes(B.CONFLUENCE)?e.add(B.CONFLUENCE):t?.artifactId?.includes(B.BAMBOO)?e.add(B.BAMBOO):t?.artifactId?.includes(B.BITBUCKET)&&e.add(B.BITBUCKET)}})),Array.from(e)}static doPropertyReplacement(t){let e=t;const s=I?AMPS.getProperties(I):{};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(h("./pom.xml")){const s=g("./pom.xml","utf8"),o=(new l).parseFromString(s,"text/xml"),a=e?b.select(t,o,!0):b.select(t,o,!1);return Array.isArray(a)||e?a:[]}return[]}static toObject(t){try{return(new u).parse((new d).serializeToString(t))}catch(t){return null}}}const J=new w;class Docker{static async getRunningContainerIds(t){return(await J.listContainers({filters:{status:["running"],label:[`com.docker.compose.service=${t}`]}})).map((t=>t.Id))}static async copy(t,e){return new Promise(((s,o)=>{const a=p("docker",["cp",t,e],{cwd:c(),stdio:"inherit"});a.on("error",o),a.on("exit",(t=>0===t?s():o(new Error(`Docker exited with code ${t}`))))}))}}const V="AAACBA0ODAoPeNp9kl1v2jAUhu/zK460OyQHSLuVIkUaTbwNVBKUhEnbugsTDuA2sSPbgbFfPxOC1i+4yEXO5+vnPR+yGiGSW/CuoXc7vBoMvT4ENAOv5/WctUIUG1lVqNx7nqPQSJfccCl8GmU0mSXjlDpRXS5Qxau5RqV90ncCKQzLTcRK9Eu944Ip/cQ/M1MwrTkTbi5LZ1arfMM0hsyg7/X6A9LvE89z2j3ZvsJmQBBPpzQJxqP7U4r+qbjaN32zG+/baR2dMl6c35ei2qIah/4dvaHkOvzpkU/x5IZ8vbodOI9cMbdSclnnxj38EC1XZscUunYy36JvVI3OxGZmbZXdzwIU5lVJWi90rnjVQGoi70B873GNhPOQO51OFGfkS5yQWRKH8yAbxxGZp9Qm/EChpbGExR7MBqGdAlTkcokK7MMeMTfwa2NM9TDsdtfSfQGnWxw7CB47frsQShDSwJJro/iiNmgncw1GQl5rI0trtetY4sKgYCJ/Y4qVFSR0lNGQ3P04aDxrTKvWOjMXT0LuxCU33txaSiPffuRjr3fsO/mC6og/VmsmuGYN0Ij93TFYcVXunQaaDb4+wJbFd7vg0OI5If53NENtoK2AlVQwGScjSFt5lrjdWymu8WEIgSwtppyzAsLgxRk8P5hG9PMA3bKiPspdsULjJRwX7ukf5/NX7TAtAhUAhQSHz9DgycOX7wcwERMJb3TLGb4CFGkB/xUWSRK3BZLrPF9Rn6ZmrUqJX02oc",Q="AAACzg0ODAoPeNp9VO9v2jAQ/Z6/wtK+IYWGsEKHFGmQmJau/GgIm9iYJhMOYprYke1A4a+fSchGKtqPPvvevXv3zp/6gqLHLEb2HbKsTvNzp9lC98MA2ZbdNKYgdiAGntPDQ2z688HcdH/aM7P5o2kZTzQEJiE4pDAiCTgBngaD0b0RCr5f1S9uHfcUWXSQBzuIeQrCCDlb10mo6A4cJTLQSVlIlzFUggpI8ickMbAVEbI+ypIliPG6R5Il5z4kXEF3A0xJp1Gywa8pFQePKHAmDdt6+A9cJVQEK5yWmhMV8HGZLRWkwrF8PZMgpGPfGh7IUNBUUc6cAKRCcVEYrblAaZxtKEOrsqj8V/US85zxXd+fUGwD70ickRwyf7ARACziqUYo+8Irmt/jUYD9iT+YYmNIKFPACAuvyHIaQEUSHYgz0G8rorgC8rp5qvaEZVp3pt0u8sve3TiTCsSIr0A6llGr1VwfdwPsmb25PjjbVwq2EcZcm6nS6DKX+I3iT1yP/Cy42TBe4FAK0WhZVtu6azYbZeZlB0U2wrpnkQoqq40Uyst67RqB9zU8k64olYeqKnGmNCzWiseOUoKwhLLoK1ExkZISVg95cr3ZN/YqdueSYW649/mdrfJAZOQM3b3b96DRuhVk3261kkFvexwe41UQtJN12u5Gz6GcPT7Pn71H70t69CPcbx/a9rcj3rDuwlk4xprKCA5VN+oJjsaB2R/75sQfezM3GIxH5myKT6PN/QErtDwgFQE6E9VDCLUZtN8F30Ko0K9IqXTRubnZ8HpFlZtzAyYUGb/ryOOIcYVWVCpBl5kCjUwlUhyF2mY80WaoXxdzEhOWe2YsNoRRWWxMt6xX/hH6P5uxF8b3rLJIlz1LpQW95pQPvqfLq0kmwohIeLs2l9PMzfQ48LvvWTbfMY1AXDg9KJDLCV2C9HUMH+CaJfOfudi/v0kIGVswLAIUEMQ9X77gqGBdfH0HIzBaV8NadPUCFBn+RiUA4D+IqVQpTTouLVY66aCGX02121",$="AAABmg0ODAoPeNp9Ul1v0zAUfc+vsMRbJadJtjGpUiS2JJRONOlaB4SAB9e9W0xTu7JvCv33eImDOoR4vefe4/PhN59hR5bckPiWRNezKJ5FCZkvGUmiJA4yrZALLPkBUrHXotEnu5eBRW6b8KMUoCyw8xH6BVZs2KKce3TJpUJQXAkofh2lOeccIV1dfRhJC7fRXrJuwJzALPL0/qF+pI9XGaPz+uGGspvbkdRx8Awcr0nRdOCnlXnmSlqOUqv0DltureTKg6vOiIZb6J9PoviaRm9pHHs0M9Cf/Rv1Dv/SP5lMyorR99WartZVXmdsUZW03hQOSHtCF+n2TLAB4hlIoYTegSFHo3+AQPK1QTx+m02nzzrko+JQ6MO0HS4oDBffQ5JrojSSnbRo5LZDcMzSEtREdBb1AYwNRzsXff0JgjCwLjG/4mB5giE+JzhbF3esyOn9lxf1F2145a6OWu2V/qmC/2dVdoctmOqptk5PGid+XJx42w3NPPHWQuD9fXJbL8PktfLhU2Av+N2rYMY6uUEFpncY/AYCgfFAMCwCFHzkBlkGH/vRdTeeBSfUMzUDb4W2AhQyM893WPg2Q8oQAYRdBSyKeVUdog==X02jr",G="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=i(e),o=s.substring(0,s.indexOf("dcdx")+4);return n(o,t.replaceAll("../",""))},F={name:"shared",driver:"bridge"};let Y=class Base extends C{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),o()}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} ⛔`),o(0)}async stop(t=this.options.prune){if(t)await this.down();else{const t=D(this.getDockerComposeConfig());await S({cwd:c(),configAsString:t,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:F}}}async up(){const t=D(this.getDockerComposeConfig());return O({cwd:c(),configAsString:t,log:!0})}async down(){const t=D(this.getDockerComposeConfig());return k({cwd:c(),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 M(t,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[x,U,L,q,j],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=D(this.getDockerComposeConfig());return(await P({configAsString:t,log:!1,commandOptions:["--all"]})).data.services.find((t=>t.name.includes(this.name)))}async showDockerLogs(t){return new Promise(((e,s)=>{p("docker",["logs","-f","-n","5000",t],{cwd:c(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}};const W={port:1433,database:"dcdx",username:"sa",password:"DataCenterDX!",edition:"Developer",version:"2022"};class MSSQL extends Y{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(t=W){super({...W,...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 z={port:3306,database:"dcdx",username:"dcdx",password:"dcdx",version:"8.0"};class MySQL extends Y{name="mysql";driver="com.mysql.jdbc.Driver";options=z;version="8.0";get url(){return`jdbc:mysql://db:${this.options.port}/${this.options.database}?sessionVariables=transaction_isolation='READ-COMMITTED'`}constructor(t=z){super({...z,...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 K={version:"15",database:"dcdx",port:5432,username:"dcdx",password:"dcdx"};class Postgres extends Y{name="postgresql";driver="org.postgresql.Driver";options=K;version="15";get url(){return`jdbc:postgresql://db:${this.options.port}/${this.options.database}`}constructor(t=K){super({...K,...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 X=n(y(),".dcdx");class Base extends C{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=D(this.getDockerComposeConfig());await S({cwd:c(),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=D(e);await R("cp",[t,`${this.name}:/opt/quickreload/`],{cwd:c(),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 v.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:F}}}async up(){const t=this.getDockerComposeConfig(),e=D(t);await E({cwd:c(),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} ⛔`),o(0)}async down(){const t=D(this.getDockerComposeConfig());await k({cwd:c(),configAsString:t,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async getServiceState(){const t=D(this.getDockerComposeConfig());return(await P({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(X,this.name,"source");h(s)?await T({baseDir:s}).pull({"--recurse-submodule":null}):(m(n(X,this.name),{recursive:!0}),await T().clone(e,s,{"--recurse-submodule":null})),await new Promise(((e,o)=>{p("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)=>{p("docker",["logs","-f","-n","5000",t],{cwd:c(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}async showApplicationLogs(t){return new Promise(((e,s)=>{p("docker",["exec","-i",t,"tail","-F","-n","5000",this.logFilePath],{cwd:c(),stdio:"inherit"}).on("exit",(t=>0===t?e():s(new Error(`Docker exited with code ${t}`))))}))}}class Bamboo extends Base{name=B.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 v.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||G,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`]:""]}}class Bitbucket extends Base{name=B.BITBUCKET;database;logFilePath="/var/atlassian/application-data/bitbucket/log/atlassian-bitbucket.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 ./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||$}" >> /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(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}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`]:""]}}class Confluence extends Base{name=B.CONFLUENCE;database;logFilePath="/var/atlassian/application-data/confluence/logs/atlassian-confluence.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/confluence/confluence/WEB-INF/lib/mysql-connector-j-8.3.0.jar\nCOPY ./quickreload-5.0.2.jar /opt/atlassian/confluence/confluence/WEB-INF/atlassian-bundled-plugins/quickreload-5.0.2.jar\nRUN echo "/opt/quickreload" > /var/atlassian/application-data/confluence/quickreload.properties; mkdir -p /opt/quickreload; chown -R confluence:confluence /opt/quickreload;\n\nRUN chown -R confluence:confluence /opt/atlassian/confluence`},ports:[`${this.options.port||80}:8090`,...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("-Xrunjdwp:transport=dt_socket,address=*:5005,server=y,suspend=n"),t.push("-Dcom.sun.management.jmxremote.port=9999"),t.push("-Dcom.sun.management.jmxremote.rmi.port=9998"),t.push("-Dcom.sun.management.jmxremote.authenticate=false"),t.push("-Dcom.sun.management.jmxremote.ssl=false")),t}getEnvironmentVariables(){return{...this.options.contextPath?{ATL_TOMCAT_CONTEXTPATH:this.options.contextPath}:"",JVM_SUPPORT_RECOMMENDED_ARGS:this.getJVMArgs().join(" "),ATL_LICENSE_KEY:this.options.license||Q,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`]:""]}}class Jira extends Base{name=B.JIRA;database;logFilePath="/var/atlassian/application-data/jira/log/atlassian-jira.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 ./jira-data-generator-5.0.0.jar /var/atlassian/application-data/jira/plugins/installed-plugins/jira-data-generator-5.0.0.jar\nCOPY ./mysql-connector-j-8.3.0.jar /opt/atlassian/jira/lib/mysql-connector-j-8.3.0.jar\nCOPY ./quickreload-5.0.2.jar /var/atlassian/application-data/jira/plugins/installed-plugins/quickreload-5.0.2.jar\nRUN echo "/opt/quickreload" > /var/atlassian/application-data/jira/quickreload.properties; mkdir -p /opt/quickreload; chown -R jira:jira /opt/quickreload;\n\nRUN chown -R jira:jira /var/atlassian/application-data/jira`},ports:[`${this.options.port||80}:8080`,...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}getEnvironmentVariables(){const t="postgresql"===this.database.name?"postgres72":this.database.name;return{...this.options.contextPath?{ATL_TOMCAT_CONTEXTPATH:this.options.contextPath}:"",JVM_SUPPORT_RECOMMENDED_ARGS:this.getJVMArgs().join(" "),ATL_LICENSE_KEY:this.options.license||Q,ATL_JDBC_URL:this.database.url,ATL_JDBC_USER:this.database.options.username,ATL_JDBC_PASSWORD:this.database.options.password,ATL_DB_DRIVER:this.database.driver,ATL_DB_TYPE:t,JIRA_SETUP_LICENSE:this.options.license||V}}getVolumes(){return[...this.options.quickReload?[`${this.options.quickReload}:/opt/quickreload`]:""]}}(async()=>{const i=e.name("dcdx build").description("Build & install the Atlassian Data Center plugin from the current directory.\nYou can add Maven build arguments after the command options.").usage("[options] [...maven_arguments]").addOption(new s("-w, --watch <patterns...>","Additional list of glob patterns used to watch for file changes")).addOption(new s("-P, --activate-profiles <arg>","Comma-delimited list of profiles to activate")).addOption(new s("-o, --outputDirectory <directory>","Output directory where QuickReload will look for generated JAR files").default("target")).allowUnknownOption(!0).parse(process.argv).opts();AMPS.isAtlassianPlugin()||(console.log("Unable to find an Atlassian Plugin project in the current directory 🤔"),o());const n=AMPS.getApplication();n||(console.log("The Atlassian Plugin project does not contain an AMPS configuration, unable to detect product 😰"),o(),process.exit());(t=>{switch(t){case B.JIRA:return Jira;case B.CONFLUENCE:return Confluence;case B.BAMBOO:return Bamboo;case B.BITBUCKET:return Bitbucket}})(n)||(console.log("The Atlassian Plugin project does not contain an AMPS configuration, unable to detect product 😰"),process.exit());const l=e.args.slice();i.activateProfiles&&l.push("-P",i.activateProfiles),console.log(`Looking for running instances of ${n}`);const d=await Docker.getRunningContainerIds(n);if(d.length>1)return console.log(`There are multple running instance of ${n}, unable to determine which one to use`),void o(0);const p=d[0];if(!p)return console.log(`Could not find running instance of ${n}, please make sure they are running first!`),void o(0);console.log("Watching filesystem for changes to source files (QuickReload)");let u=(new Date).getTime();const h=Array.isArray(i.watch)?i.watch:[i.watch],g=t(["**/*",...h],{cwd:c(),usePolling:!0,interval:2e3,binaryInterval:2e3,awaitWriteFinish:!0,persistent:!0,atomic:!0});a((async()=>{console.log("Stopping filesystem watcher... ⏳"),await g.close(),console.log("Successfully stopped all running processes 💪")}),{wait:3e4}),g.on("change",(async t=>{var e;t.startsWith(i.outputDirectory)&&t.toLowerCase().endsWith(".jar")?(console.log("Found updated JAR file, uploading them to QuickReload"),await Docker.copy(r(t),`${p}:/opt/quickreload/`).then((()=>console.log("Finished uploading JAR file to QuickReload"))).catch((t=>console.log("Failed to upload JAR file to QuickReload",t))),u=(new Date).getTime()):t.startsWith(i.outputDirectory)||((t=>t>(new Date).getTime()-5e3)(u)?(e=i.outputDirectory,console.log(`\n===============================================================================================================\nRecursive build trigger detected. The last build completed last than 5 seconds ago\nThis may indicate that the build changes files outside of the output directory\nAlternatively, Maven is using a different output directory than configured:\n'${e}'\n\nPlease make sure to check your build process and/or specify a different output directory using the '-o' option\n===============================================================================================================\n `)):(console.log("Detected file change, rebuilding Atlasian Plugin for QuickReload"),await AMPS.build(l).catch((()=>Promise.resolve()))))})),await AMPS.build(l).catch((()=>Promise.resolve())),u=(new Date).getTime()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),o()}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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","8.0-
|
|
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 +1,2 @@
|
|
|
1
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","16.2-bullseye","16.2-bookworm","16.2","16-bullseye","16-bookworm","16","15.6-bullseye","15.6-bookworm","15.6","15-bullseye","15-bookworm","15","14.11-bullseye","14.11-bookworm","14.11","14-bullseye","14-bookworm","14","13.14-bullseye","13.14-bookworm","13.14","13-bullseye","13-bookworm","13","12.18-bullseye","12.18-bookworm","12.18","12-bullseye","12-bookworm","12","alpine3.19","alpine3.18","alpine","16.2-alpine3.19","16.2-alpine3.18","16.2-alpine","16-alpine3.19","16-alpine3.18","16-alpine","15.6-alpine3.19","15.6-alpine3.18","15.6-alpine","15-alpine3.19","15-alpine3.18","15-alpine","14.11-alpine3.19","14.11-alpine3.18","14.11-alpine","14-alpine3.19","14-alpine3.18","14-alpine","13.14-alpine3.19","13.14-alpine3.18","13.14-alpine","13-alpine3.19","13-alpine3.18","13-alpine","12.18-alpine3.19","12.18-alpine3.18","12.18-alpine","12-alpine3.19","12-alpine3.18","12-alpine","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);
|
|
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);
|
package/lib/commands/database.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{program as e}from"commander";e.name("dcdx database").command("postgresql","Start PostgreSQL",{executableFile:"./database
|
|
2
|
+
import{program as e}from"commander";e.name("dcdx database").command("postgresql","Start PostgreSQL",{executableFile:"./database/postgres.js"}).command("mysql","Start MySQL",{executableFile:"./database/mysql.js"}).command("mssql","Start Microsoft SQL Server",{executableFile:"./database/mssql.js"}).showHelpAfterError(!0),e.parse();
|
|
@@ -0,0 +1,2 @@
|
|
|
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()}));
|
|
@@ -0,0 +1,2 @@
|
|
|
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()}));
|