Changed structure of docker.js to match new standard
parent
ccedbb68b5
commit
10bbe05d2e
|
@ -154,6 +154,21 @@ const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||||
const Docker = {
|
const Docker = {
|
||||||
run(image, parameters, silent = false) {
|
run(image, parameters, silent = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let runCommand = '';
|
||||||
|
switch (process.platform) {
|
||||||
|
case 'linux':
|
||||||
|
runCommand = this.getLinuxCommand(image, parameters);
|
||||||
|
break;
|
||||||
|
case 'win32':
|
||||||
|
runCommand = this.getWindowsCommand(image, parameters);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Operation system, ${process.platform}, is not supported yet.`);
|
||||||
|
}
|
||||||
|
yield (0, exec_1.exec)(runCommand, undefined, { silent });
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getLinuxCommand(image, parameters) {
|
||||||
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
|
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
|
||||||
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
||||||
if (!(0, fs_1.existsSync)(githubHome))
|
if (!(0, fs_1.existsSync)(githubHome))
|
||||||
|
@ -162,44 +177,7 @@ const Docker = {
|
||||||
if (!(0, fs_1.existsSync)(githubWorkflow))
|
if (!(0, fs_1.existsSync)(githubWorkflow))
|
||||||
(0, fs_1.mkdirSync)(githubWorkflow);
|
(0, fs_1.mkdirSync)(githubWorkflow);
|
||||||
const testPlatforms = (testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]).join(';');
|
const testPlatforms = (testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]).join(';');
|
||||||
const dockerPaths = new Map([
|
return `docker run \
|
||||||
[
|
|
||||||
'linux',
|
|
||||||
new Map([
|
|
||||||
['shellCommand', '/bin/bash /dist/entrypoint.sh'],
|
|
||||||
['sshAgent', '/ssh-agent'],
|
|
||||||
['githubHome', '/root'],
|
|
||||||
['githubWorkflow', '/github/workflow'],
|
|
||||||
['githubWorkspace', '/github/workspace'],
|
|
||||||
['stepsPathParent', `${actionFolder}/steps`],
|
|
||||||
['stepsPathContainer', '/steps'],
|
|
||||||
['entrypointPathParent', `${actionFolder}/`],
|
|
||||||
['entrypointPathContainer', '/dist'],
|
|
||||||
['knownHostsParent', ' /home/runner/.ssh/known_hosts'],
|
|
||||||
['knownHostsContainer', '/root/.ssh/known_hosts'],
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'win32',
|
|
||||||
new Map([
|
|
||||||
['shellCommand', 'powershell C:\\dist\\entrypoint.ps1'],
|
|
||||||
['sshAgent', 'C:\\ssh-agent'],
|
|
||||||
['githubHome', 'C:\\root'],
|
|
||||||
['githubWorkflow', 'C:\\github\\workflow'],
|
|
||||||
['githubWorkspace', 'C:\\github\\workspace'],
|
|
||||||
['stepsPathParent', `${actionFolder}\\steps`],
|
|
||||||
['stepsPathContainer', 'C:\\steps'],
|
|
||||||
['entrypointPathParent', `${actionFolder}\\`],
|
|
||||||
['entrypointPathContainer', 'C:\\dist'],
|
|
||||||
['knownHostsParent', 'C:\\Users\\Administrator\\.ssh\\known_hosts'],
|
|
||||||
['knownHostsContainer', 'C:\\root\\.ssh\\known_hosts'],
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
const currentDockerPath = dockerPaths.get(process.platform);
|
|
||||||
const bindMountZ = process.platform === 'linux' ? ':z' : '';
|
|
||||||
const bindMountRO = process.platform === 'linux' ? ':ro' : '';
|
|
||||||
const command = `docker run \
|
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
--env UNITY_LICENSE \
|
--env UNITY_LICENSE \
|
||||||
|
@ -222,7 +200,7 @@ const Docker = {
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_WORKSPACE="${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('githubWorkspace')}" \
|
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_ACTION \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_OS \
|
--env RUNNER_OS \
|
||||||
|
@ -230,22 +208,73 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? `--env SSH_AUTH_SOCK=${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('sshAgent')}` : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('githubHome')}${bindMountZ}" \
|
--volume "${githubHome}:/root:z" \
|
||||||
--volume "${githubWorkflow}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('githubWorkflow')}${bindMountZ}" \
|
--volume "${githubWorkflow}:/github/workflow:z" \
|
||||||
--volume "${workspace}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('githubWorkspace')}${bindMountZ}" \
|
--volume "${workspace}:/github/workspace:z" \
|
||||||
--volume "${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('stepsPathParent')}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('stepsPathContainer')}${bindMountZ}" \
|
--volume "${actionFolder}/steps:/steps:z" \
|
||||||
--volume "${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('entrypointPathParent')}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('entrypointPathContainer')}${bindMountZ}" \
|
--volume "${actionFolder}/entrypoint.sh:/entrypoint.sh:z" \
|
||||||
${sshAgent ? `--volume ${sshAgent}:${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('sshAgent')}` : ''} \
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
|
${sshAgent ? `--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro` : ''} \
|
||||||
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
|
${image} \
|
||||||
|
/bin/bash -c /entrypoint.sh`;
|
||||||
|
},
|
||||||
|
getWindowsCommand(image, parameters) {
|
||||||
|
const { actionFolder, editorVersion, workspace, projectPath, customParameters, testMode, coverageOptions, artifactsPath, useHostNetwork, sshAgent, gitPrivateToken, githubToken, runnerTemporaryPath, } = parameters;
|
||||||
|
const githubHome = path_1.default.join(runnerTemporaryPath, '_github_home');
|
||||||
|
if (!(0, fs_1.existsSync)(githubHome))
|
||||||
|
(0, fs_1.mkdirSync)(githubHome);
|
||||||
|
const githubWorkflow = path_1.default.join(runnerTemporaryPath, '_github_workflow');
|
||||||
|
if (!(0, fs_1.existsSync)(githubWorkflow))
|
||||||
|
(0, fs_1.mkdirSync)(githubWorkflow);
|
||||||
|
const testPlatforms = (testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]).join(';');
|
||||||
|
return `docker run \
|
||||||
|
--workdir /github/workspace \
|
||||||
|
--rm \
|
||||||
|
--env UNITY_LICENSE \
|
||||||
|
--env UNITY_LICENSE_FILE \
|
||||||
|
--env UNITY_EMAIL \
|
||||||
|
--env UNITY_PASSWORD \
|
||||||
|
--env UNITY_SERIAL \
|
||||||
|
--env UNITY_VERSION="${editorVersion}" \
|
||||||
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
|
--env TEST_PLATFORMS="${testPlatforms}" \
|
||||||
|
--env COVERAGE_OPTIONS="${coverageOptions}" \
|
||||||
|
--env COVERAGE_RESULTS_PATH="CodeCoverage" \
|
||||||
|
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||||
|
--env GITHUB_REF \
|
||||||
|
--env GITHUB_SHA \
|
||||||
|
--env GITHUB_REPOSITORY \
|
||||||
|
--env GITHUB_ACTOR \
|
||||||
|
--env GITHUB_WORKFLOW \
|
||||||
|
--env GITHUB_HEAD_REF \
|
||||||
|
--env GITHUB_BASE_REF \
|
||||||
|
--env GITHUB_EVENT_NAME \
|
||||||
|
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||||
|
--env GITHUB_ACTION \
|
||||||
|
--env GITHUB_EVENT_PATH \
|
||||||
|
--env RUNNER_OS \
|
||||||
|
--env RUNNER_TOOL_CACHE \
|
||||||
|
--env RUNNER_TEMP \
|
||||||
|
--env RUNNER_WORKSPACE \
|
||||||
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
||||||
|
--volume "${githubHome}":"c:/root" \
|
||||||
|
--volume "${githubWorkflow}":"c:/github/workflow" \
|
||||||
|
--volume "${workspace}":"c:/github/workspace" \
|
||||||
|
--volume "${actionFolder}/steps":"c:/steps" \
|
||||||
|
--volume "${actionFolder}":"c:/dist" \
|
||||||
|
${sshAgent ? `--volume ${sshAgent}:c:/ssh-agent` : ''} \
|
||||||
${sshAgent
|
${sshAgent
|
||||||
? `--volume ${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('knownHostParent')}${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('knownHostContainer')}${bindMountRO}`
|
? `--volume c:/Users/Administrator/.ssh/known_hosts:c:/root/.ssh/known_hosts`
|
||||||
: ''} \
|
: ''} \
|
||||||
${useHostNetwork ? '--net=host' : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
${image} \
|
${image} \
|
||||||
${currentDockerPath === null || currentDockerPath === void 0 ? void 0 : currentDockerPath.get('shellCommand')}`;
|
powershell c:/dist/entrypoint.ps1`;
|
||||||
yield (0, exec_1.exec)(command, undefined, { silent });
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
exports["default"] = Docker;
|
exports["default"] = Docker;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,7 @@ if ( ($null -ne ${env:UNITY_LICENSE}) -or ($null -ne ${env:UNITY_LICENSE_FILE})
|
||||||
}
|
}
|
||||||
$convert = (Get-Content -Raw $FILE_PATH) -replace "`r`n","`n"
|
$convert = (Get-Content -Raw $FILE_PATH) -replace "`r`n","`n"
|
||||||
[io.file]::WriteAllText($FILE_PATH, $convert)
|
[io.file]::WriteAllText($FILE_PATH, $convert)
|
||||||
|
Get-ChildItem -Path $FILE_PATH
|
||||||
|
|
||||||
# Activate license
|
# Activate license
|
||||||
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -nographics -logFile $ACTIVATE_LICENSE_PATH\activate.log -quit -manualLicenseFile $FILE_PATH"
|
$ACTIVATION_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "C:\Program Files\Unity\Hub\Editor\${env:UNITY_VERSION}\editor\Unity.exe" -ArgumentList "-batchmode -nographics -logFile $ACTIVATE_LICENSE_PATH\activate.log -quit -manualLicenseFile $FILE_PATH"
|
||||||
|
|
|
@ -4,6 +4,21 @@ import path from 'path';
|
||||||
|
|
||||||
const Docker = {
|
const Docker = {
|
||||||
async run(image, parameters, silent = false) {
|
async run(image, parameters, silent = false) {
|
||||||
|
let runCommand = '';
|
||||||
|
switch (process.platform) {
|
||||||
|
case 'linux':
|
||||||
|
runCommand = this.getLinuxCommand(image, parameters);
|
||||||
|
break;
|
||||||
|
case 'win32':
|
||||||
|
runCommand = this.getWindowsCommand(image, parameters);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Operation system, ${process.platform}, is not supported yet.`);
|
||||||
|
}
|
||||||
|
await exec(runCommand, undefined, { silent });
|
||||||
|
},
|
||||||
|
|
||||||
|
getLinuxCommand(image, parameters): string {
|
||||||
const {
|
const {
|
||||||
actionFolder,
|
actionFolder,
|
||||||
editorVersion,
|
editorVersion,
|
||||||
|
@ -28,45 +43,7 @@ const Docker = {
|
||||||
testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]
|
testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]
|
||||||
).join(';');
|
).join(';');
|
||||||
|
|
||||||
const dockerPaths = new Map([
|
return `docker run \
|
||||||
[
|
|
||||||
'linux',
|
|
||||||
new Map([
|
|
||||||
['shellCommand', '/bin/bash /dist/entrypoint.sh'],
|
|
||||||
['sshAgent', '/ssh-agent'],
|
|
||||||
['githubHome', '/root'],
|
|
||||||
['githubWorkflow', '/github/workflow'],
|
|
||||||
['githubWorkspace', '/github/workspace'],
|
|
||||||
['stepsPathParent', `${actionFolder}/steps`],
|
|
||||||
['stepsPathContainer', '/steps'],
|
|
||||||
['entrypointPathParent', `${actionFolder}/`],
|
|
||||||
['entrypointPathContainer', '/dist'],
|
|
||||||
['knownHostsParent', ' /home/runner/.ssh/known_hosts'],
|
|
||||||
['knownHostsContainer', '/root/.ssh/known_hosts'],
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'win32',
|
|
||||||
new Map([
|
|
||||||
['shellCommand', 'powershell C:\\dist\\entrypoint.ps1'],
|
|
||||||
['sshAgent', 'C:\\ssh-agent'],
|
|
||||||
['githubHome', 'C:\\root'],
|
|
||||||
['githubWorkflow', 'C:\\github\\workflow'],
|
|
||||||
['githubWorkspace', 'C:\\github\\workspace'],
|
|
||||||
['stepsPathParent', `${actionFolder}\\steps`],
|
|
||||||
['stepsPathContainer', 'C:\\steps'],
|
|
||||||
['entrypointPathParent', `${actionFolder}\\`],
|
|
||||||
['entrypointPathContainer', 'C:\\dist'],
|
|
||||||
['knownHostsParent', 'C:\\Users\\Administrator\\.ssh\\known_hosts'],
|
|
||||||
['knownHostsContainer', 'C:\\root\\.ssh\\known_hosts'],
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
const currentDockerPath = dockerPaths.get(process.platform);
|
|
||||||
const bindMountZ = process.platform === 'linux' ? ':z' : '';
|
|
||||||
const bindMountRO = process.platform === 'linux' ? ':ro' : '';
|
|
||||||
|
|
||||||
const command = `docker run \
|
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
--env UNITY_LICENSE \
|
--env UNITY_LICENSE \
|
||||||
|
@ -89,7 +66,7 @@ const Docker = {
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_WORKSPACE="${currentDockerPath?.get('githubWorkspace')}" \
|
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_ACTION \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_OS \
|
--env RUNNER_OS \
|
||||||
|
@ -97,30 +74,94 @@ const Docker = {
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? `--env SSH_AUTH_SOCK=${currentDockerPath?.get('sshAgent')}` : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "${githubHome}:${currentDockerPath?.get('githubHome')}${bindMountZ}" \
|
--volume "${githubHome}:/root:z" \
|
||||||
--volume "${githubWorkflow}:${currentDockerPath?.get('githubWorkflow')}${bindMountZ}" \
|
--volume "${githubWorkflow}:/github/workflow:z" \
|
||||||
--volume "${workspace}:${currentDockerPath?.get('githubWorkspace')}${bindMountZ}" \
|
--volume "${workspace}:/github/workspace:z" \
|
||||||
--volume "${currentDockerPath?.get('stepsPathParent')}:${currentDockerPath?.get(
|
--volume "${actionFolder}/steps:/steps:z" \
|
||||||
'stepsPathContainer',
|
--volume "${actionFolder}/entrypoint.sh:/entrypoint.sh:z" \
|
||||||
)}${bindMountZ}" \
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
--volume "${currentDockerPath?.get('entrypointPathParent')}:${currentDockerPath?.get(
|
${
|
||||||
'entrypointPathContainer',
|
sshAgent ? `--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro` : ''
|
||||||
)}${bindMountZ}" \
|
} \
|
||||||
${sshAgent ? `--volume ${sshAgent}:${currentDockerPath?.get('sshAgent')}` : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
|
${image} \
|
||||||
|
/bin/bash -c /entrypoint.sh`;
|
||||||
|
},
|
||||||
|
|
||||||
|
getWindowsCommand(image, parameters): string {
|
||||||
|
const {
|
||||||
|
actionFolder,
|
||||||
|
editorVersion,
|
||||||
|
workspace,
|
||||||
|
projectPath,
|
||||||
|
customParameters,
|
||||||
|
testMode,
|
||||||
|
coverageOptions,
|
||||||
|
artifactsPath,
|
||||||
|
useHostNetwork,
|
||||||
|
sshAgent,
|
||||||
|
gitPrivateToken,
|
||||||
|
githubToken,
|
||||||
|
runnerTemporaryPath,
|
||||||
|
} = parameters;
|
||||||
|
|
||||||
|
const githubHome = path.join(runnerTemporaryPath, '_github_home');
|
||||||
|
if (!existsSync(githubHome)) mkdirSync(githubHome);
|
||||||
|
const githubWorkflow = path.join(runnerTemporaryPath, '_github_workflow');
|
||||||
|
if (!existsSync(githubWorkflow)) mkdirSync(githubWorkflow);
|
||||||
|
const testPlatforms = (
|
||||||
|
testMode === 'all' ? ['playmode', 'editmode', 'COMBINE_RESULTS'] : [testMode]
|
||||||
|
).join(';');
|
||||||
|
|
||||||
|
return `docker run \
|
||||||
|
--workdir /github/workspace \
|
||||||
|
--rm \
|
||||||
|
--env UNITY_LICENSE \
|
||||||
|
--env UNITY_LICENSE_FILE \
|
||||||
|
--env UNITY_EMAIL \
|
||||||
|
--env UNITY_PASSWORD \
|
||||||
|
--env UNITY_SERIAL \
|
||||||
|
--env UNITY_VERSION="${editorVersion}" \
|
||||||
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
|
--env TEST_PLATFORMS="${testPlatforms}" \
|
||||||
|
--env COVERAGE_OPTIONS="${coverageOptions}" \
|
||||||
|
--env COVERAGE_RESULTS_PATH="CodeCoverage" \
|
||||||
|
--env ARTIFACTS_PATH="${artifactsPath}" \
|
||||||
|
--env GITHUB_REF \
|
||||||
|
--env GITHUB_SHA \
|
||||||
|
--env GITHUB_REPOSITORY \
|
||||||
|
--env GITHUB_ACTOR \
|
||||||
|
--env GITHUB_WORKFLOW \
|
||||||
|
--env GITHUB_HEAD_REF \
|
||||||
|
--env GITHUB_BASE_REF \
|
||||||
|
--env GITHUB_EVENT_NAME \
|
||||||
|
--env GITHUB_WORKSPACE="/github/workspace" \
|
||||||
|
--env GITHUB_ACTION \
|
||||||
|
--env GITHUB_EVENT_PATH \
|
||||||
|
--env RUNNER_OS \
|
||||||
|
--env RUNNER_TOOL_CACHE \
|
||||||
|
--env RUNNER_TEMP \
|
||||||
|
--env RUNNER_WORKSPACE \
|
||||||
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
|
${sshAgent ? '--env SSH_AUTH_SOCK=c:/ssh-agent' : ''} \
|
||||||
|
--volume "${githubHome}":"c:/root" \
|
||||||
|
--volume "${githubWorkflow}":"c:/github/workflow" \
|
||||||
|
--volume "${workspace}":"c:/github/workspace" \
|
||||||
|
--volume "${actionFolder}/steps":"c:/steps" \
|
||||||
|
--volume "${actionFolder}":"c:/dist" \
|
||||||
|
${sshAgent ? `--volume ${sshAgent}:c:/ssh-agent` : ''} \
|
||||||
${
|
${
|
||||||
sshAgent
|
sshAgent
|
||||||
? `--volume ${currentDockerPath?.get('knownHostParent')}${currentDockerPath?.get(
|
? `--volume c:/Users/Administrator/.ssh/known_hosts:c:/root/.ssh/known_hosts`
|
||||||
'knownHostContainer',
|
|
||||||
)}${bindMountRO}`
|
|
||||||
: ''
|
: ''
|
||||||
} \
|
} \
|
||||||
${useHostNetwork ? '--net=host' : ''} \
|
${useHostNetwork ? '--net=host' : ''} \
|
||||||
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
${githubToken ? '--env USE_EXIT_CODE=false' : '--env USE_EXIT_CODE=true'} \
|
||||||
${image} \
|
${image} \
|
||||||
${currentDockerPath?.get('shellCommand')}`;
|
powershell c:/dist/entrypoint.ps1`;
|
||||||
|
|
||||||
await exec(command, undefined, { silent });
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue