@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
332 lines (331 loc) • 10.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DockerPlugin", {
enumerable: true,
get: function() {
return DockerPlugin;
}
});
function _check_private_redeclaration(obj, privateCollection) {
if (privateCollection.has(obj)) {
throw new TypeError("Cannot initialize the same private elements twice on an object");
}
}
function _class_apply_descriptor_get(receiver, descriptor) {
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
function _class_extract_field_descriptor(receiver, privateMap, action) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to " + action + " private field on non-instance");
}
return privateMap.get(receiver);
}
function _class_private_field_get(receiver, privateMap) {
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
return _class_apply_descriptor_get(receiver, descriptor);
}
function _class_private_field_init(obj, privateMap, value) {
_check_private_redeclaration(obj, privateMap);
privateMap.set(obj, value);
}
function _define_property(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var _options = /*#__PURE__*/ new WeakMap(), _commands = /*#__PURE__*/ new WeakMap(), _envvars = /*#__PURE__*/ new WeakMap(), _volumes = /*#__PURE__*/ new WeakMap();
class DockerPlugin {
getImage() {
return _class_private_field_get(this, _options)['image'];
}
/**
* @deprecated Use .setImage() instead
*/ image(image) {
return this.setImage(image);
}
setImage(image) {
_class_private_field_get(this, _options)['image'] = image;
return this;
}
getAlwaysPull() {
return _class_private_field_get(this, _options)['always-pull'];
}
/**
* @deprecated Use .setAlwaysPull() instead
*/ alwaysPull(alwaysPull = true) {
return this.setAlwaysPull(alwaysPull);
}
setAlwaysPull(alwaysPull) {
_class_private_field_get(this, _options)['always-pull'] = alwaysPull;
return this;
}
getCommands() {
return _class_private_field_get(this, _commands);
}
/**
* @deprecated Use .addCommand() instead
*/ command(command) {
return this.addCommand(command);
}
addCommand(command) {
_class_private_field_get(this, _commands).push(command);
return this;
}
getDebug() {
return _class_private_field_get(this, _options)['debug'];
}
/**
* @deprecated Use .setDebug() instead
*/ debug(debug = true) {
return this.setDebug(debug);
}
setDebug(debug) {
_class_private_field_get(this, _options)['debug'] = debug;
return this;
}
getEntrypoint() {
return _class_private_field_get(this, _options)['entrypoint'];
}
/**
* @deprecated Use .addCommand() instead
*/ entrypoint(entrypoint) {
return this.setEntrypoint(entrypoint);
}
setEntrypoint(entrypoint) {
_class_private_field_get(this, _options)['entrypoint'] = entrypoint;
return this;
}
getEnvironment() {
return _class_private_field_get(this, _envvars);
}
/**
* @deprecated Use .addEnvironment() instead
*/ environment(environment) {
return this.addEnvironment(environment);
}
addEnvironment(environment) {
_class_private_field_get(this, _envvars).push(environment);
return this;
}
getPropagateEnvironment() {
return _class_private_field_get(this, _options)['propagate-environment'];
}
/**
* @deprecated Use .setPropagateEnvironment() instead
*/ propagateEnvironment(propagate = true) {
return this.setPropagateEnvironment(propagate);
}
setPropagateEnvironment(propagate) {
_class_private_field_get(this, _options)['propagate-environment'] = propagate;
return this;
}
getPropagateAWSAauthTokens() {
return _class_private_field_get(this, _options)['propagate-aws-auth-tokens'];
}
/**
* @deprecated Use .setPropagateAWSAuthTokens() instead
*/ propagateAWSAuthTokens(propagate = true) {
return this.setPropagateAWSAuthTokens(propagate);
}
/**
* @deprecated Use .setPropagateAWSAuthTokens() instead
*/ setPropagateAWSAauthTokens(propagate) {
return this.setPropagateAWSAuthTokens(propagate);
}
setPropagateAWSAuthTokens(propagate) {
_class_private_field_get(this, _options)['propagate-aws-auth-tokens'] = propagate;
return this;
}
getMountCheckout() {
return _class_private_field_get(this, _options)['mount-checkout'];
}
/**
* @deprecated Use .setMountCheckout() instead
*/ mountCheckout(mount = true) {
return this.setMountCheckout(mount);
}
setMountCheckout(mount = true) {
_class_private_field_get(this, _options)['mount-checkout'] = mount;
return this;
}
getMountBuildkiteAgent() {
return _class_private_field_get(this, _options)['mount-buildkite-agent'];
}
/**
* @deprecated Use .setMountBuildkiteAgent() instead
*/ mountBuildkiteAgent(mount = true) {
return this.setMountBuildkiteAgent(mount);
}
setMountBuildkiteAgent(mount) {
_class_private_field_get(this, _options)['mount-buildkite-agent'] = mount;
return this;
}
getMountSSHAgent() {
return _class_private_field_get(this, _options)['mount-ssh-agent'];
}
/**
* @deprecated Use .setMountSSHAgent() instead
*/ mountSSHAgent(mount = true) {
return this.setMountSSHAgent(mount);
}
setMountSSHAgent(mount) {
_class_private_field_get(this, _options)['mount-ssh-agent'] = mount;
return this;
}
getPlatform() {
return _class_private_field_get(this, _options)['platform'];
}
/**
* @deprecated Use .setPlatform() instead
*/ platform(platform) {
return this.setPlatform(platform);
}
setPlatform(platform) {
_class_private_field_get(this, _options)['platform'] = platform;
return this;
}
getShell() {
return _class_private_field_get(this, _options)['shell'];
}
/**
* @deprecated Use .setPlatform() instead
*/ shell(cmd, args = []) {
return this.setShell(cmd, args);
}
setShell(cmd, args = []) {
_class_private_field_get(this, _options)['shell'] = [
cmd,
...args
];
return this;
}
/**
* @deprecated Use .setUser() instead
*/ user(user) {
return this.setUser(user);
}
setUser(user) {
_class_private_field_get(this, _options)['user'] = user;
return this;
}
/**
* @deprecated Use .setUserNamespace() instead
*/ userns(namespace) {
return this.setUserns(namespace);
}
setUserns(namespace) {
_class_private_field_get(this, _options)['userns'] = namespace;
return this;
}
getVolumes() {
return _class_private_field_get(this, _volumes);
}
/**
* @deprecated Use .addVolume() instead
*/ volume(volume) {
return this.addVolume(volume);
}
addVolume(volume) {
_class_private_field_get(this, _volumes).push(volume);
return this;
}
/**
* @deprecated Use .setWorkdir() instead
*/ workdir(workdir) {
return this.setWorkdir(workdir);
}
setWorkdir(workdir) {
_class_private_field_get(this, _options)['workdir'] = workdir;
return this;
}
/**
* @deprecated Use .setCPUs() instead
*/ cpus(cpus) {
return this.setCPUs(cpus);
}
setCPUs(cpus) {
_class_private_field_get(this, _options)['cpus'] = cpus;
return this;
}
/**
* @deprecated Use .setMemory() instead
*/ memory(memory) {
return this.setMemory(memory);
}
setMemory(memory) {
_class_private_field_get(this, _options)['memory'] = memory;
return this;
}
/**
* @deprecated Use .setMemorySwap() instead
*/ memorySwap(swap) {
return this.setMemorySwap(swap);
}
setMemorySwap(swap) {
_class_private_field_get(this, _options)['memory-swap'] = swap;
return this;
}
/**
* @deprecated Use .setMemorySwapiness() instead
*/ memorySwapiness(swappiness) {
return this.setMemorySwapiness(swappiness);
}
setMemorySwapiness(swappiness) {
_class_private_field_get(this, _options)['memory-swapiness'] = swappiness;
return this;
}
setExpandVolumeVars(expand) {
_class_private_field_get(this, _options)['expand-volume-vars'] = expand;
return this;
}
build() {
const object = {
..._class_private_field_get(this, _options)
};
if (_class_private_field_get(this, _commands).length) {
object['command'] = _class_private_field_get(this, _commands);
}
if (_class_private_field_get(this, _envvars).length) {
object['environment'] = _class_private_field_get(this, _envvars);
}
if (_class_private_field_get(this, _volumes).length) {
object['volumes'] = _class_private_field_get(this, _volumes);
}
return {
[DockerPlugin.PLUGIN]: object
};
}
constructor(){
_class_private_field_init(this, _options, {
writable: true,
value: {}
});
_class_private_field_init(this, _commands, {
writable: true,
value: []
});
_class_private_field_init(this, _envvars, {
writable: true,
value: []
});
_class_private_field_init(this, _volumes, {
writable: true,
value: []
});
}
}
_define_property(DockerPlugin, "PLUGIN", 'docker#v5.11.0');
//# sourceMappingURL=DockerPlugin.js.map