mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-17 01:12:35 +00:00
feat: allow to override docker command and user (#783)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
577b35899d
commit
8d4ffe3283
6 changed files with 102 additions and 0 deletions
|
|
@ -39,8 +39,26 @@ class Renovate {
|
|||
);
|
||||
}
|
||||
|
||||
const dockerCmdFile = this.input.getDockerCmdFile();
|
||||
let dockerCmd: string | null = null;
|
||||
if (dockerCmdFile !== null) {
|
||||
const baseName = path.basename(dockerCmdFile);
|
||||
const mountPath = `/${baseName}`;
|
||||
dockerArguments.push(`--volume ${dockerCmdFile}:${mountPath}`);
|
||||
dockerCmd = mountPath;
|
||||
}
|
||||
|
||||
const dockerUser = this.input.getDockerUser();
|
||||
if (dockerUser !== null) {
|
||||
dockerArguments.push(`--user ${dockerUser}`);
|
||||
}
|
||||
|
||||
dockerArguments.push('--volume /tmp:/tmp', '--rm', this.docker.image());
|
||||
|
||||
if (dockerCmd !== null) {
|
||||
dockerArguments.push(dockerCmd);
|
||||
}
|
||||
|
||||
const command = `docker run ${dockerArguments.join(' ')}`;
|
||||
|
||||
const code = await exec(command);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue