refactor(Apps/Dashboard): Remove Deno as a dependency to the dashboard (#16934)

* remove deno as a dependency

* use the ACORE_VERSION env var

* I forgot client-data

* accidentally removed too much

* docker-cmd: extraneous parallel flag

* typo

* remove docker image prune -af

the `docker image prune` removes the containers we just build.

* fetch everything in the beginning
This commit is contained in:
Mike Delago
2023-09-09 19:12:47 -04:00
committed by GitHub
parent f6d11d526b
commit c43e1b8c0c
10 changed files with 206 additions and 431 deletions

View File

@@ -64,11 +64,12 @@ function _switch() {
inst_simple_restarter authserver
;;
""|"dr"|"docker"|"13")
DOCKER=1 denoRunFile "$AC_PATH_APPS/docker/docker-cmd.ts" "${@:2}"
DOCKER=1 bash "$AC_PATH_ROOT/apps/docker/docker-cmd.sh" "${@:2}"
exit
;;
""|"v"|"version"|"14")
denoRunFile "$AC_PATH_APPS/installer/main.ts" "version"
# denoRunFile "$AC_PATH_APPS/installer/main.ts" "version"
printf "AzerothCore Rev. %s\n" "$ACORE_VERSION"
exit
;;
""|"quit"|"15")

View File

@@ -1,43 +0,0 @@
import { Command } from "https://cdn.deno.land/cmd/versions/v1.2.0/raw/mod.ts";
import { getAcoreReleaseVersion } from "./utils.ts";
import { Input } from "https://deno.land/x/cliffy@v0.25.2/prompt/mod.ts";
const program = new Command();
program
.name("acore.sh")
.description("Shell scripts for docker")
.version("1.0.0");
// program
// .command("quit")
// .description("Close docker command")
// .action(() => {
// process.exit(0);
// });
program
.command("version")
.description("Get the version of the current AzerothCore revision")
.action(async () => {
console.log(await getAcoreReleaseVersion());
});
async function main() {
let exit = false;
do {
if (Deno.args.length === 0) {
program.outputHelp();
const command = await Input.prompt({
message: "Enter the command:",
});
console.log(command);
await program.parseAsync(command.split(" "));
} else {
exit = true;
await program.parseAsync(Deno.args);
process.exit(0);
}
} while (!exit);
}
main();

View File

@@ -1,17 +0,0 @@
import * as path from "https://deno.land/std/path/mod.ts";
import makeloc from "https://deno.land/x/dirname@1.1.2/mod.ts";
const { __dirname } = makeloc(import.meta);
// specify the needed paths here
const ACORE_JSON = path.resolve(__dirname + "/../../acore.json");
export async function getAcoreReleaseVersion() {
// read the acore.json file to work with the versioning
const decoder = new TextDecoder("utf-8");
//console.debug(`Open ${ACORE_JSON}`)
const data = await Deno.readFile(ACORE_JSON);
const acoreInfo = JSON.parse(decoder.decode(data));
return `AzerothCore Rev. ${acoreInfo.version}`;
}