Rebuild beta and campaign file activations
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { parentPort } from 'node:worker_threads';
|
||||
import { posix } from 'node:path';
|
||||
import { applyActivationFiles } from './activation-files.js';
|
||||
import { db } from '../db/index.js';
|
||||
import { relDestForKind } from '../config.js';
|
||||
import {
|
||||
@@ -32,15 +33,15 @@ parentPort!.on(
|
||||
const input = message.input;
|
||||
// All file versions and composed configuration belong to one snapshot.
|
||||
const { recipe, password } = db().transaction(() => {
|
||||
if (!input.frozenRecipeId)
|
||||
return {
|
||||
recipe: {
|
||||
...captureRecipe(input.game, input.mapSlug, input.rconPassword),
|
||||
native: input.native,
|
||||
image: input.instance.image
|
||||
},
|
||||
password: input.rconPassword
|
||||
if (!input.frozenRecipeId) {
|
||||
const recipe = {
|
||||
...captureRecipe(input.game, input.mapSlug, input.rconPassword),
|
||||
native: input.native,
|
||||
image: input.instance.image
|
||||
};
|
||||
if (input.activationId) applyActivationFiles(recipe, input.activationId, true);
|
||||
return { recipe, password: input.rconPassword };
|
||||
}
|
||||
const stored = recipeForDeployment(input.frozenRecipeId)?.recipe;
|
||||
const migration = db()
|
||||
.prepare(
|
||||
@@ -85,6 +86,7 @@ parentPort!.on(
|
||||
)
|
||||
throw new Error('electric_cherry_bank.cfg is reserved for instance credentials.');
|
||||
const payload = {
|
||||
...(input.activationId ? { stageId: input.activationId } : {}),
|
||||
name: instance.server,
|
||||
game: recipe.game,
|
||||
libraryId: instance.library_id,
|
||||
|
||||
Reference in New Issue
Block a user