Merge pull request #18635 from overleaf/jpa-test-upgrade

[server-pro] add tests for upgrade process

GitOrigin-RevId: eaa1486688cb2fa544adaaee16da04fd757a1b65
This commit is contained in:
Jakob Ackermann
2024-06-12 08:04:48 +00:00
committed by Copybot
parent 9e0bf6c626
commit b75d183cfc
11 changed files with 354 additions and 131 deletions
+8 -18
View File
@@ -1,21 +1,3 @@
export async function setVars(vars = {}) {
return await fetchJSON('http://host-admin/set/vars', {
method: 'POST',
body: JSON.stringify({ vars, path: 'docker-compose.yml' }),
})
}
export async function setVersion({ pro = false, version = 'latest' }) {
return await fetchJSON('http://host-admin/set/version', {
method: 'POST',
body: JSON.stringify({
pro,
version,
path: 'docker-compose.yml',
}),
})
}
export async function dockerCompose(cmd: string, ...args: string[]) {
return await fetchJSON(`http://host-admin/docker/compose/${cmd}`, {
method: 'POST',
@@ -31,10 +13,17 @@ export async function mongoInit() {
})
}
export async function resetData() {
return await fetchJSON('http://host-admin/reset/data', {
method: 'POST',
})
}
export async function reconfigure({
pro = false,
version = 'latest',
vars = {},
withDataDir = false,
}) {
return await fetchJSON('http://host-admin/reconfigure', {
method: 'POST',
@@ -42,6 +31,7 @@ export async function reconfigure({
pro,
version,
vars,
withDataDir,
}),
})
}