@catladder/pipeline
Version:
Panter workflow for cloud CI/CD and DevOps
35 lines (34 loc) • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.callClaude = exports.baseSetupScript = exports.createBaseAgentJob = void 0;
var bashEscape_1 = require("../../bash/bashEscape");
var runner_1 = require("../../runner");
var createBaseAgentJob = function (context) {
return {
stage: "agents",
// image: "node:24-alpine3.21",
image: (0, runner_1.getRunnerImage)("agent-claude"),
variables: {
MAX_MCP_OUTPUT_TOKENS: "75000",
GITLAB_PERSONAL_ACCESS_TOKEN: "$AGENT_GITLAB_PERSONAL_ACCESS_TOKEN",
// TODO: we don't have global secret keys to configure yet
GITLAB_API_URL: "$CI_API_V4_URL"
}
};
};
exports.createBaseAgentJob = createBaseAgentJob;
exports.baseSetupScript = [
// these are done in the image already
// "apk update",
// "apk add --no-cache git curl bash",
//"npm install -g @anthropic-ai/claude-code",
"claude mcp add gitlab --env GITLAB_PERSONAL_ACCESS_TOKEN=$GITLAB_PERSONAL_ACCESS_TOKEN --env GITLAB_API_URL=$GITLAB_API_URL --env USE_PIPELINE='true' -- npx -y @zereight/mcp-gitlab"];
var callClaude = function (_a) {
var prompt = _a.prompt;
return ["export PROMPT=\"".concat((0, bashEscape_1.escapeNewlines)((0, bashEscape_1.escapeDoubleQuotes)((0, bashEscape_1.escapeBackTicks)(prompt))), "\""),
//'echo "$PROMPT"',
"claude -p \"$PROMPT\" --permission-mode acceptEdits --allowedTools \"Bash Read(*) Edit(*) Write(*) mcp__gitlab\" --verbose --debug"];
};
exports.callClaude = callClaude;