Skip to content

Commit acd3c9d

Browse files
authored
Merge pull request #116 from crazy-max/buildx-install-private
buildx: install from private repo support
2 parents 6fc5565 + 8ad595b commit acd3c9d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/buildx/install.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ export class Install {
157157
throw new Error(`Neither buildx standalone or plugin have been found to build from ref ${gitContext}`);
158158
}
159159

160+
const args = ['build', '--target', 'binaries', '--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1', '--output', `type=local,dest=${outputDir}`];
161+
if (process.env.GIT_AUTH_TOKEN) {
162+
args.push('--secret', 'id=GIT_AUTH_TOKEN');
163+
}
164+
args.push(gitContext);
165+
160166
//prettier-ignore
161-
return await new Buildx({standalone: buildStandalone}).getCommand([
162-
'build',
163-
'--target', 'binaries',
164-
'--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1',
165-
'--output', `type=local,dest=${outputDir}`,
166-
gitContext
167-
]);
167+
return await new Buildx({standalone: buildStandalone}).getCommand(args);
168168
}
169169

170170
private async isStandalone(): Promise<boolean> {

0 commit comments

Comments
 (0)