Adds support for .upmconfig.toml in Windows Docker images (#705)
* Supports github_home in windows-latest * Attempt at copying from specific volume * Adding some more logging * Fix and compiles index.js * Debugging and some other approach * Another attempt at debugging * Testing two more approaches * Try only copying the file * Cleanup * Updates index.js, index.js.map and licenses.txt After `yarn` + `npm run build` * Update index.js.mappull/711/head
parent
a1ebdb7abd
commit
65607f9ebb
|
@ -6103,7 +6103,10 @@ class Docker {
|
||||||
"${overrideCommands !== '' ? overrideCommands : `/entrypoint.sh`}"`;
|
"${overrideCommands !== '' ? overrideCommands : `/entrypoint.sh`}"`;
|
||||||
}
|
}
|
||||||
static getWindowsCommand(image, parameters) {
|
static getWindowsCommand(image, parameters) {
|
||||||
const { workspace, actionFolder, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, } = parameters;
|
const { workspace, actionFolder, runnerTempPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, } = parameters;
|
||||||
|
const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');
|
||||||
|
if (!(0, node_fs_1.existsSync)(githubHome))
|
||||||
|
(0, node_fs_1.mkdirSync)(githubHome);
|
||||||
return `docker run \
|
return `docker run \
|
||||||
--workdir c:${dockerWorkspacePath} \
|
--workdir c:${dockerWorkspacePath} \
|
||||||
--rm \
|
--rm \
|
||||||
|
@ -6111,6 +6114,7 @@ class Docker {
|
||||||
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
||||||
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
||||||
|
--volume "${githubHome}":"C:/githubhome" \
|
||||||
--volume "c:/regkeys":"c:/regkeys" \
|
--volume "c:/regkeys":"c:/regkeys" \
|
||||||
--volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \
|
--volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \
|
||||||
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,13 @@
|
||||||
Get-Process
|
Get-Process
|
||||||
|
|
||||||
|
# Copy .upmconfig.toml if it exists
|
||||||
|
if (Test-Path "C:\githubhome\.upmconfig.toml") {
|
||||||
|
Write-Host "Copying .upmconfig.toml to $Env:USERPROFILE\.upmconfig.toml"
|
||||||
|
Copy-Item -Path "C:\githubhome\.upmconfig.toml" -Destination "$Env:USERPROFILE\.upmconfig.toml" -Force
|
||||||
|
} else {
|
||||||
|
Write-Host "No .upmconfig.toml found at C:\githubhome"
|
||||||
|
}
|
||||||
|
|
||||||
# Import any necessary registry keys, ie: location of windows 10 sdk
|
# Import any necessary registry keys, ie: location of windows 10 sdk
|
||||||
# No guarantee that there will be any necessary registry keys, ie: tvOS
|
# No guarantee that there will be any necessary registry keys, ie: tvOS
|
||||||
Get-ChildItem -Path c:\regkeys -File | ForEach-Object { reg import $_.fullname }
|
Get-ChildItem -Path c:\regkeys -File | ForEach-Object { reg import $_.fullname }
|
||||||
|
|
|
@ -92,6 +92,7 @@ class Docker {
|
||||||
const {
|
const {
|
||||||
workspace,
|
workspace,
|
||||||
actionFolder,
|
actionFolder,
|
||||||
|
runnerTempPath,
|
||||||
gitPrivateToken,
|
gitPrivateToken,
|
||||||
dockerWorkspacePath,
|
dockerWorkspacePath,
|
||||||
dockerCpuLimit,
|
dockerCpuLimit,
|
||||||
|
@ -99,6 +100,9 @@ class Docker {
|
||||||
dockerIsolationMode,
|
dockerIsolationMode,
|
||||||
} = parameters;
|
} = parameters;
|
||||||
|
|
||||||
|
const githubHome = path.join(runnerTempPath, '_github_home');
|
||||||
|
if (!existsSync(githubHome)) mkdirSync(githubHome);
|
||||||
|
|
||||||
return `docker run \
|
return `docker run \
|
||||||
--workdir c:${dockerWorkspacePath} \
|
--workdir c:${dockerWorkspacePath} \
|
||||||
--rm \
|
--rm \
|
||||||
|
@ -106,6 +110,7 @@ class Docker {
|
||||||
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
--env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \
|
||||||
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN="${gitPrivateToken}"` : ''} \
|
||||||
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
--volume "${workspace}":"c:${dockerWorkspacePath}" \
|
||||||
|
--volume "${githubHome}":"C:/githubhome" \
|
||||||
--volume "c:/regkeys":"c:/regkeys" \
|
--volume "c:/regkeys":"c:/regkeys" \
|
||||||
--volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \
|
--volume "C:/Program Files/Microsoft Visual Studio":"C:/Program Files/Microsoft Visual Studio" \
|
||||||
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
||||||
|
|
Loading…
Reference in New Issue