2024-05-30 07:12:56 +00:00
|
|
|
import { reconfigure } from './hostAdminClient'
|
|
|
|
|
|
|
|
let lastConfig: string
|
|
|
|
|
2024-05-30 07:13:40 +00:00
|
|
|
export function startWith({
|
|
|
|
pro = false,
|
|
|
|
version = 'latest',
|
|
|
|
vars = {},
|
|
|
|
varsFn = () => ({}),
|
2024-06-11 11:01:21 +00:00
|
|
|
withDataDir = false,
|
2024-05-30 07:13:40 +00:00
|
|
|
}) {
|
2024-05-30 07:12:56 +00:00
|
|
|
before(async function () {
|
2024-05-30 07:13:40 +00:00
|
|
|
Object.assign(vars, varsFn())
|
2024-06-11 11:01:21 +00:00
|
|
|
const cfg = JSON.stringify({ pro, version, vars, withDataDir })
|
2024-05-30 07:12:56 +00:00
|
|
|
if (lastConfig === cfg) return
|
|
|
|
|
|
|
|
this.timeout(100 * 1000)
|
2024-06-11 11:01:21 +00:00
|
|
|
await reconfigure({ pro, version, vars, withDataDir })
|
2024-05-30 07:12:56 +00:00
|
|
|
lastConfig = cfg
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export { reconfigure }
|