@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
55 lines • 2.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMeteorBuildJobs = void 0;
const runner_1 = require("../../runner");
const base_1 = require("../base");
const docker_1 = require("../docker");
const types_1 = require("../types");
const cache_1 = require("./cache");
const yarn_1 = require("./yarn");
const getMeteorCache = (context) => [
{
key: "meteor-build-cache",
policy: "pull-push",
paths: [
".meteor/local/resolver-result-cache.json",
".meteor/local/plugin-cache",
".meteor/local/isopacks",
".meteor/local/bundler-cache/scanner",
],
},
];
const createMeteorBuildJobs = (context) => {
const buildConfig = context.build.config;
if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
throw new Error("deploy config is not meteor");
}
const yarnInstall = (0, yarn_1.getYarnInstall)(context);
return (0, base_1.createComponentBuildJobs)(context, {
appBuild: buildConfig.buildCommand !== null
? {
cache: [...(0, cache_1.getNodeCache)(context), ...getMeteorCache(context)],
image: (0, runner_1.getRunnerImage)("jobs-meteor"),
variables: {
METEOR_DISABLE_OPTIMISTIC_CACHING: "1", // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
},
script: [
...yarnInstall,
'echo "add healthcheck package"',
"meteor add panter:healthroute --allow-superuser",
"meteor add qualia:prod-shell --allow-superuser",
'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory',
"cp ./__build_info.json ./dist/bundle/programs/server",
],
}
: undefined,
dockerBuild: {
script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, "meteor"),
variables: {
METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : "",
},
},
});
};
exports.createMeteorBuildJobs = createMeteorBuildJobs;
//# sourceMappingURL=meteor.js.map