Skip to content

Commit f036f41

Browse files
committed
Updated genmatrix
1 parent a45e54a commit f036f41

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

22/windows-2019/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019
33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6-
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;{1};C:\Program Files (x86)\GnuPG\bin' -f $env:LOCALAPPDATA, $env:PATH); \
6+
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;C:\Program Files (x86)\GnuPG\bin;{1}' -f $env:LOCALAPPDATA, $env:PATH); \
77
Write-Host ('Updating PATH: {0}' -f $newPath); \
88
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)
99
# doing this first to share cache across versions more aggressively

22/windows-2022/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022
33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6-
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;{1};C:\Program Files (x86)\GnuPG\bin' -f $env:LOCALAPPDATA, $env:PATH); \
6+
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;C:\Program Files (x86)\GnuPG\bin;{1}' -f $env:LOCALAPPDATA, $env:PATH); \
77
Write-Host ('Updating PATH: {0}' -f $newPath); \
88
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)
99
# doing this first to share cache across versions more aggressively

Dockerfile-windows.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/windows/servercore:version
33
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
44

55
# PATH isn't actually set in the Docker image, so we have to set it from within the container
6-
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;{1};C:\Program Files (x86)\GnuPG\bin' -f $env:LOCALAPPDATA, $env:PATH); \
6+
RUN $newPath = ('C:\nodejs;{0}\Yarn\bin;C:\Program Files (x86)\GnuPG\bin;{1}' -f $env:LOCALAPPDATA, $env:PATH); \
77
Write-Host ('Updating PATH: {0}' -f $newPath); \
88
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine)
99
# doing this first to share cache across versions more aggressively

genMatrix.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,28 @@ const testFiles = [
88
];
99

1010
const nodeDirRegex = /^\d+$/;
11+
// Directories starting with 'windows-' are excluded from the matrix windows-2019 are excluded for example
1112
const windowsDirRegex = /^windows-/;
1213

1314
const areTestFilesChanged = (changedFiles) => changedFiles
1415
.some((file) => testFiles.includes(file));
1516

1617
// Returns a list of the child directories in the given path, excluding those starting with 'windows-'
1718
const getChildDirectories = (parent) => fs.readdirSync(parent, { withFileTypes: true })
18-
.filter((dirent) => dirent.isDirectory() && !windowsDirRegex.test(dirent.name))
19+
.filter((directory) => directory.isDirectory())
1920
.map(({ name }) => path.resolve(parent, name));
2021

2122
const getNodeVersionDirs = (base) => getChildDirectories(base)
2223
.filter((childPath) => nodeDirRegex.test(path.basename(childPath)));
2324

2425
// Returns the paths of Dockerfiles that are at: base/*/Dockerfile
2526
const getDockerfilesInChildDirs = (base) => getChildDirectories(base)
27+
.filter((directory) => directory.isDirectory() && !windowsDirRegex.test(directory.name))
28+
// Test print the directories
29+
.map((childDir) => {
30+
console.log(childDir);
31+
return childDir;
32+
})
2633
.map((childDir) => path.resolve(childDir, 'Dockerfile'));
2734

2835
const getAllDockerfiles = (base) => getNodeVersionDirs(base).flatMap(getDockerfilesInChildDirs);

0 commit comments

Comments
 (0)