Use --builder

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-09-03 11:49:39 +02:00
parent b563df09ad
commit cf9301c704
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
4 changed files with 7 additions and 27 deletions

19
dist/index.js generated vendored
View File

@ -2395,10 +2395,6 @@ function run() {
const buildxVersion = yield buildx.getVersion(); const buildxVersion = yield buildx.getVersion();
core.info(`📣 Buildx version: ${buildxVersion}`); core.info(`📣 Buildx version: ${buildxVersion}`);
let inputs = yield context.getInputs(); let inputs = yield context.getInputs();
if (inputs.builder) {
core.info(`📌 Using builder instance ${inputs.builder}`);
yield buildx.use(inputs.builder);
}
core.info(`🏃 Starting build...`); core.info(`🏃 Starting build...`);
const args = yield context.getArgs(inputs, buildxVersion); const args = yield context.getArgs(inputs, buildxVersion);
yield exec.exec('docker', args); yield exec.exec('docker', args);
@ -5186,7 +5182,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.use = exports.parseVersion = exports.getVersion = exports.isAvailable = exports.getSecret = exports.getImageID = exports.getImageIDFile = void 0; exports.parseVersion = exports.getVersion = exports.isAvailable = exports.getSecret = exports.getImageID = exports.getImageIDFile = void 0;
const fs_1 = __importDefault(__webpack_require__(747)); const fs_1 = __importDefault(__webpack_require__(747));
const path_1 = __importDefault(__webpack_require__(622)); const path_1 = __importDefault(__webpack_require__(622));
const tmp_1 = __importDefault(__webpack_require__(517)); const tmp_1 = __importDefault(__webpack_require__(517));
@ -5252,16 +5248,6 @@ function parseVersion(stdout) {
}); });
} }
exports.parseVersion = parseVersion; exports.parseVersion = parseVersion;
function use(builder) {
return __awaiter(this, void 0, void 0, function* () {
return yield exec.exec(`docker`, ['buildx', 'use', '--builder', builder], false).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
});
});
}
exports.use = use;
//# sourceMappingURL=buildx.js.map //# sourceMappingURL=buildx.js.map
/***/ }), /***/ }),
@ -13737,6 +13723,9 @@ function getCommonArgs(inputs) {
if (inputs.noCache) { if (inputs.noCache) {
args.push('--no-cache'); args.push('--no-cache');
} }
if (inputs.builder) {
args.push('--builder', inputs.builder);
}
if (inputs.pull) { if (inputs.pull) {
args.push('--pull'); args.push('--pull');
} }

View File

@ -51,11 +51,3 @@ export async function parseVersion(stdout: string): Promise<string> {
} }
return semver.clean(matches[1]); return semver.clean(matches[1]);
} }
export async function use(builder: string): Promise<void> {
return await exec.exec(`docker`, ['buildx', 'use', '--builder', builder], false).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}
});
}

View File

@ -106,6 +106,9 @@ async function getCommonArgs(inputs: Inputs): Promise<Array<string>> {
if (inputs.noCache) { if (inputs.noCache) {
args.push('--no-cache'); args.push('--no-cache');
} }
if (inputs.builder) {
args.push('--builder', inputs.builder);
}
if (inputs.pull) { if (inputs.pull) {
args.push('--pull'); args.push('--pull');
} }

View File

@ -23,10 +23,6 @@ async function run(): Promise<void> {
core.info(`📣 Buildx version: ${buildxVersion}`); core.info(`📣 Buildx version: ${buildxVersion}`);
let inputs: context.Inputs = await context.getInputs(); let inputs: context.Inputs = await context.getInputs();
if (inputs.builder) {
core.info(`📌 Using builder instance ${inputs.builder}`);
await buildx.use(inputs.builder);
}
core.info(`🏃 Starting build...`); core.info(`🏃 Starting build...`);
const args: string[] = await context.getArgs(inputs, buildxVersion); const args: string[] = await context.getArgs(inputs, buildxVersion);