forked from louislam/uptime-kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up armv7 build time of healthcheck by using go compiler cross-b…
…uild feature in the host
- Loading branch information
Showing
5 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ cypress/screenshots | |
|
||
/extra/healthcheck.exe | ||
/extra/healthcheck | ||
/extra/healthcheck-armv7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const childProcess = require("child_process"); | ||
const fs = require("fs"); | ||
const platform = process.argv[2]; | ||
|
||
if (!platform) { | ||
console.error("No platform??"); | ||
process.exit(1); | ||
} | ||
|
||
if (platform === "linux/arm/v7") { | ||
console.log("Arch: armv7"); | ||
if (fs.existsSync("./extra/healthcheck-armv7")) { | ||
fs.renameSync("./extra/healthcheck-armv7", "./extra/healthcheck"); | ||
console.log("Already built in the host, skip."); | ||
process.exit(0); | ||
} else { | ||
console.log("prebuilt not found, it will be slow! You should execute `npm run build-healthcheck-armv7` before build."); | ||
} | ||
} else { | ||
if (fs.existsSync("./extra/healthcheck-armv7")) { | ||
fs.rmSync("./extra/healthcheck-armv7"); | ||
} | ||
} | ||
|
||
const output = childProcess.execSync("go build -x -o ./extra/healthcheck ./extra/healthcheck.go").toString("utf8"); | ||
console.log(output); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters