From 8ad595b4454759c649ca3cfab60e9f60abd4a390 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 9 Jun 2023 17:54:49 +0200 Subject: [PATCH] buildx: install from private repo support Signed-off-by: CrazyMax --- src/buildx/install.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/buildx/install.ts b/src/buildx/install.ts index c1b13c89..a99d238b 100644 --- a/src/buildx/install.ts +++ b/src/buildx/install.ts @@ -157,14 +157,14 @@ export class Install { throw new Error(`Neither buildx standalone or plugin have been found to build from ref ${gitContext}`); } + const args = ['build', '--target', 'binaries', '--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1', '--output', `type=local,dest=${outputDir}`]; + if (process.env.GIT_AUTH_TOKEN) { + args.push('--secret', 'id=GIT_AUTH_TOKEN'); + } + args.push(gitContext); + //prettier-ignore - return await new Buildx({standalone: buildStandalone}).getCommand([ - 'build', - '--target', 'binaries', - '--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1', - '--output', `type=local,dest=${outputDir}`, - gitContext - ]); + return await new Buildx({standalone: buildStandalone}).getCommand(args); } private async isStandalone(): Promise {