mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Using SSH_AUTH_SOCK (ssh agent forwarding) to pull upm private repos (#256)
* using SSH_AUTH_SOCK (ssh agent forwarding) to pull upm private repos * sshAgent as input parameter * yarn run prettier --write "src/**/*.{js,ts}" * yarn run lint --fix && yarn build * fixed compilation after rebase * removed RUN apt-get update && apt-get install -y openssh-client. This change needs to be done upstream. See game-ci/docker#117
This commit is contained in:
parent
71ca7bdbfc
commit
497f2f7b5f
@ -106,6 +106,10 @@ inputs:
|
|||||||
|
|
||||||
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
|
Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).
|
||||||
Parameters without a value will be considered booleans (with a value of true).
|
Parameters without a value will be considered booleans (with a value of true).
|
||||||
|
sshAgent:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: 'SSH Agent path to forward to the container'
|
||||||
chownFilesTo:
|
chownFilesTo:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
@ -10,6 +10,7 @@ export const mockGetFromUser = jest.fn().mockResolvedValue({
|
|||||||
buildMethod: undefined,
|
buildMethod: undefined,
|
||||||
buildVersion: '1.3.37',
|
buildVersion: '1.3.37',
|
||||||
customParameters: '',
|
customParameters: '',
|
||||||
|
sshAgent: '',
|
||||||
chownFilesTo: '',
|
chownFilesTo: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ class BuildParameters {
|
|||||||
public androidKeyaliasName!: string;
|
public androidKeyaliasName!: string;
|
||||||
public androidKeyaliasPass!: string;
|
public androidKeyaliasPass!: string;
|
||||||
public customParameters!: string;
|
public customParameters!: string;
|
||||||
|
public sshAgent!: string;
|
||||||
public remoteBuildCluster!: string;
|
public remoteBuildCluster!: string;
|
||||||
public awsStackName!: string;
|
public awsStackName!: string;
|
||||||
public kubeConfig!: string;
|
public kubeConfig!: string;
|
||||||
@ -60,6 +61,7 @@ class BuildParameters {
|
|||||||
androidKeyaliasName: Input.androidKeyaliasName,
|
androidKeyaliasName: Input.androidKeyaliasName,
|
||||||
androidKeyaliasPass: Input.androidKeyaliasPass,
|
androidKeyaliasPass: Input.androidKeyaliasPass,
|
||||||
customParameters: Input.customParameters,
|
customParameters: Input.customParameters,
|
||||||
|
sshAgent: Input.sshAgent,
|
||||||
chownFilesTo: Input.chownFilesTo,
|
chownFilesTo: Input.chownFilesTo,
|
||||||
remoteBuildCluster: Input.remoteBuildCluster,
|
remoteBuildCluster: Input.remoteBuildCluster,
|
||||||
awsStackName: Input.awsStackName,
|
awsStackName: Input.awsStackName,
|
||||||
|
@ -36,6 +36,7 @@ class Docker {
|
|||||||
androidKeyaliasName,
|
androidKeyaliasName,
|
||||||
androidKeyaliasPass,
|
androidKeyaliasPass,
|
||||||
customParameters,
|
customParameters,
|
||||||
|
sshAgent,
|
||||||
chownFilesTo,
|
chownFilesTo,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
@ -79,10 +80,13 @@ class Docker {
|
|||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
||||||
--volume "${runnerTempPath}/_github_home":"/root" \
|
--volume "${runnerTempPath}/_github_home":"/root" \
|
||||||
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
||||||
--volume "${workspace}":"/github/workspace" \
|
--volume "${workspace}":"/github/workspace" \
|
||||||
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
|
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
||||||
${image}`;
|
${image}`;
|
||||||
|
|
||||||
await exec(command, undefined, { silent });
|
await exec(command, undefined, { silent });
|
||||||
|
@ -85,6 +85,10 @@ class Input {
|
|||||||
return core.getInput('customParameters') || '';
|
return core.getInput('customParameters') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get sshAgent() {
|
||||||
|
return core.getInput('sshAgent') || '';
|
||||||
|
}
|
||||||
|
|
||||||
static get chownFilesTo() {
|
static get chownFilesTo() {
|
||||||
return core.getInput('chownFilesTo') || '';
|
return core.getInput('chownFilesTo') || '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user