UNPKG

@jameslnewell/buildkite-pipelines

Version:
82 lines 2.75 kB
"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _ECRPlugin_accounts, _ECRPlugin_options; Object.defineProperty(exports, "__esModule", { value: true }); exports.ECRPlugin = void 0; /** * @see https://github.com/buildkite-plugins/ecr-buildkite-plugin */ class ECRPlugin { constructor() { _ECRPlugin_accounts.set(this, []); _ECRPlugin_options.set(this, {}); } /** * @deprecated Use .setLogin() instead */ login(login = true) { return this.setLogin(login); } setLogin(login) { __classPrivateFieldGet(this, _ECRPlugin_options, "f")['login'] = login; return this; } /** * @deprecated Use .setAccount() instead */ account(id) { return this.setAccount(id); } setAccount(id) { __classPrivateFieldGet(this, _ECRPlugin_accounts, "f").push(id); return this; } /** * @deprecated Use .setRegion() instead */ region(region) { return this.setRegion(region); } setRegion(region) { __classPrivateFieldGet(this, _ECRPlugin_options, "f")['region'] = region; return this; } /** * @deprecated Use .setRetries() instead */ retries(retries) { return this.setRetries(retries); } setRetries(retries) { __classPrivateFieldGet(this, _ECRPlugin_options, "f")['retries'] = retries; return this; } setAssumeRole(roleArn, durationSeconds) { __classPrivateFieldGet(this, _ECRPlugin_options, "f")['assume-role'] = { 'role-arn': roleArn, ...(durationSeconds !== undefined ? { 'duration-seconds': durationSeconds } : {}), }; return this; } build() { const object = { ...__classPrivateFieldGet(this, _ECRPlugin_options, "f"), }; if (__classPrivateFieldGet(this, _ECRPlugin_accounts, "f").length) { object['account-ids'] = __classPrivateFieldGet(this, _ECRPlugin_accounts, "f"); } return { [ECRPlugin.PLUGIN]: object, }; } } exports.ECRPlugin = ECRPlugin; _ECRPlugin_accounts = new WeakMap(), _ECRPlugin_options = new WeakMap(); ECRPlugin.PLUGIN = 'ecr#v2.9.0'; //# sourceMappingURL=ECRPlugin.js.map