mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Alphine and migration mode
This commit is contained in:
2
.github/workflows/build-binaries.yml
vendored
2
.github/workflows/build-binaries.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
arch: [x64, arm64]
|
arch: [x64, arm64]
|
||||||
os: [linux, win]
|
os: [linux, alphine, win]
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
target: node18-linux
|
target: node18-linux
|
||||||
|
|||||||
@@ -1,34 +1,9 @@
|
|||||||
import { logger } from "../logger";
|
|
||||||
|
|
||||||
export const isMigrationMode = () => {
|
export const isMigrationMode = () => {
|
||||||
try {
|
const args = process.argv.slice(2);
|
||||||
const args = process.argv.slice(2);
|
const migrationMode = args.find((arg) => arg === "migration:latest");
|
||||||
const migrationFlag = args.find((arg) => arg.startsWith("--migration-mode"));
|
|
||||||
|
|
||||||
if (!migrationFlag) {
|
if (migrationMode) {
|
||||||
return false;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
// Covers the case where the flag is --migration-mode [true|false|...]
|
|
||||||
if (migrationFlag === "--migration-mode") {
|
|
||||||
const nextArg = args[args.indexOf(migrationFlag) + 1];
|
|
||||||
if (nextArg === "false") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// --migration-mode without a value defaults to true
|
|
||||||
return nextArg === undefined || nextArg.toLowerCase() === "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Covers the case where the flag is --migration-mode=[...]
|
|
||||||
const [, value] = migrationFlag.split("=");
|
|
||||||
if (value === undefined) {
|
|
||||||
const nextArg = args[args.indexOf(migrationFlag) + 1];
|
|
||||||
return nextArg === "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
return value.toLowerCase() === "true";
|
|
||||||
} catch (err) {
|
|
||||||
logger.error(err, `Failed to check migration mode`);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user