Fixes build
This commit is contained in:
parent
917c1f1fed
commit
4f5beda018
2 changed files with 18 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import * as fs from "node:fs";
|
||||||
|
|
||||||
if (!process.env.BUILD_TARGET) {
|
if (!process.env.BUILD_TARGET) {
|
||||||
process.env.BUILD_TARGET = "LOCAL";
|
process.env.BUILD_TARGET = "LOCAL";
|
||||||
}
|
}
|
||||||
|
|
@ -7,8 +9,12 @@ if (!process.env.BUILD_LABEL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
import context from './context.mjs';
|
import context from './context.mjs';
|
||||||
|
import {createBuildFile} from "./create-build-file.mjs";
|
||||||
|
|
||||||
|
(async () => {
|
||||||
await context.rebuild();
|
await context.rebuild();
|
||||||
await context.dispose();
|
await context.dispose();
|
||||||
|
|
||||||
import "./create-build-file.mjs";
|
createBuildFile()
|
||||||
|
})()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import * as child_process from "node:child_process";
|
||||||
import {json} from "node:stream/consumers";
|
import {json} from "node:stream/consumers";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
|
|
||||||
|
export function createBuildFile() {
|
||||||
const buildContext = {
|
const buildContext = {
|
||||||
target: process.env.BUILD_TARGET ?? 'LOCAL',
|
target: process.env.BUILD_TARGET ?? 'LOCAL',
|
||||||
commitHash: child_process.execSync("git rev-parse HEAD").toString(),
|
commitHash: child_process.execSync("git rev-parse HEAD").toString(),
|
||||||
|
|
@ -10,3 +11,5 @@ const buildContext = {
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync("./dist/deploy.json", JSON.stringify(buildContext))
|
fs.writeFileSync("./dist/deploy.json", JSON.stringify(buildContext))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue