@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
37 lines • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStopJob = exports.STOP_JOB_NAME = void 0;
const variables_1 = require("./variables");
exports.STOP_JOB_NAME = "🛑 Stop ⚠️";
const createStopJob = (context, jobDefinition) => {
return {
name: exports.STOP_JOB_NAME,
image: jobDefinition.image,
envMode: "stagePerEnv", // makes it easier to run manual tasks er env
needs: [], // can be executed even if the deploy job failed
allow_failure: true,
when: "manual", // stop is always manual
rules: [
{
if: "$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/", // automatic on hotfix branches
when: "on_success",
},
],
variables: {
...context.environment.jobOnlyVars.deploy.envVars,
...jobDefinition.variables,
},
runnerVariables: {
...variables_1.DEPLOY_RUNNER_VARIABLES,
GIT_STRATEGY: "none",
...jobDefinition.runnerVariables,
},
stage: "stop",
environment: {
action: "stop",
},
script: jobDefinition.script,
};
};
exports.createStopJob = createStopJob;
//# sourceMappingURL=stop.js.map