import wmill from "windmill-cli";
export async function main(source_workspace_id: string, target_workspace_id: string) {
console.log(`Starting migration of jobs from ${source_workspace_id} to ${target_workspace_id}`);
try {
const cmd = [
"workspace",
"migrate",
target_workspace_id,
"--token",
process.env["WM_TOKEN"] ?? "",
"--remote",
process.env["BASE_URL"] ?? "",
"--source-workspace",
source_workspace_id
];
console.log("Running CLI command:", cmd.join(" "));
await wmill.parse(cmd);
console.log(`Successfully migrated jobs from ${source_workspace_id} to ${target_workspace_id}`);
return {
success: true,
message: `Jobs migration completed from ${source_workspace_id} to ${target_workspace_id}`,
source_workspace_id,
target_workspace_id,
};
} catch (error) {
console.error("Migration failed:", error);
throw new Error(`Migration failed: ${error}`);
}
}Submitted by dieriba.pro916 200 days ago
import wmill from "windmill-cli";
type Args = {
source_workspace_id: string;
target_workspace_id: string;
};
export async function main(args: Args) {
const {
source_workspace_id,
target_workspace_id,
} = args;
console.log(`Starting migration of jobs from ${source_workspace_id} to ${target_workspace_id}`);
try {
const cmd = [
"workspace",
"migrate",
target_workspace_id,
"--token",
process.env["WM_TOKEN"] ?? "",
"--remote",
process.env["BASE_URL"] ?? "",
"--source-workspace",
source_workspace_id
];
console.log("Running CLI command:", cmd.join(" "));
await wmill.parse(cmd);
console.log(`Successfully migrated jobs from ${source_workspace_id} to ${target_workspace_id}`);
return {
success: true,
message: `Jobs migration completed from ${source_workspace_id} to ${target_workspace_id}`,
source_workspace_id,
target_workspace_id,
};
} catch (error) {
console.error("Migration failed:", error);
throw new Error(`Migration failed: ${error}`);
}
}Submitted by dieriba.pro916 201 days ago
import wmill from "windmill-cli";
type Args = {
source_workspace_id: string;
target_workspace_id: string;
};
export async function main(args: Args) {
const {
source_workspace_id,
target_workspace_id,
} = args;
console.log(`Starting migration of jobs from ${source_workspace_id} to ${target_workspace_id}`);
try {
const cmd = [
"workspace",
"migrate",
target_workspace_id,
"--token",
process.env["WM_TOKEN"] ?? "",
"--remote",
process.env["BASE_URL"] ?? "",
"--source-workspace",
source_workspace_id
];
console.log("Running CLI command:", cmd.join(" "));
await wmill.parse(cmd);
console.log(`Successfully migrated jobs from ${source_workspace_id} to ${target_workspace_id}`);
return {
success: true,
message: `Jobs migration completed from ${source_workspace_id} to ${target_workspace_id}`,
source_workspace_id,
target_workspace_id,
};
} catch (error) {
console.error("Migration failed:", error);
throw new Error(`Migration failed: ${error}`);
}
}Submitted by dieriba.pro916 201 days ago