Skip to content

Commit

Permalink
Resolve incorrectly added env vars for Windows (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Oct 28, 2022
1 parent 0dc2443 commit f846949
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class AgentNodes {
maxTotalUses: -1,
minimumNumberOfSpareInstances: 2,
numExecutors: 1,
amiId: 'ami-04e3e1e593eb9b709',
amiId: 'ami-0720b70e6cb2e8012',
initScript: 'echo',
remoteFs: 'C:\\Users\\Administrator\\jenkins',
};
Expand All @@ -160,7 +160,7 @@ export class AgentNodes {
maxTotalUses: 1,
minimumNumberOfSpareInstances: 1,
numExecutors: 1,
amiId: 'ami-04e3e1e593eb9b709',
amiId: 'ami-0720b70e6cb2e8012',
initScript: 'echo',
remoteFs: 'C:\\Users\\Administrator\\jenkins',
};
Expand Down
10 changes: 5 additions & 5 deletions packer/scripts/windows/scoop-install-commons.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ $fileFound
$gitPathFound = $fileFound.replace("$fileName", '')
$gitPathFound
# Add to EnvVar
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";$gitPathFound", "User")
$userenv = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";$gitPathFound", [System.EnvironmentVariableTarget]::User)
# Make sure mem size are set to avoid "Out of memory, malloc failed" issues on Windows
git config --system core.packedGitLimit 128m
git config --system core.packedGitWindowSize 128m
Expand Down Expand Up @@ -57,7 +57,7 @@ $libPathFound = $libFound.replace("$libName", '')
$libPathFound
mv -v "$libFound" "$libPathFound\\$libNameRequired"
# Add MINGW_BIN path to User Env Var for k-NN to retrieve libs
[System.Environment]::SetEnvironmentVariable("MINGW_BIN", "$libPathFound", "User")
[System.Environment]::SetEnvironmentVariable("MINGW_BIN", "$libPathFound", [System.EnvironmentVariableTarget]::User)

# Install zlib for k-NN compilation requirements
scoop install zlib
Expand Down Expand Up @@ -114,9 +114,9 @@ Foreach ($nodeVersion in $nodeVersionList)
}
volta install yarn
yarn --version
$userenv2 = [System.Environment]::GetEnvironmentVariable("Path", "User")
$userenv2 = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User)
$nodePathFixed = "C:\\Users\\Administrator\\scoop\\persist\\volta\\appdata\\bin"
[System.Environment]::SetEnvironmentVariable("PATH", $userenv2 + ";$nodePathFixed", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv2 + ";$nodePathFixed", [System.EnvironmentVariableTarget]::User)

# Install ruby24
scoop install ruby24
Expand Down

0 comments on commit f846949

Please sign in to comment.