Skip to content

Commit 4e6c0e2

Browse files
Added Node 16 runner to the NodeTaskRunnerInstallerV0 task. (#19727)
1 parent 2612f9d commit 4e6c0e2

File tree

16 files changed

+88
-49
lines changed

16 files changed

+88
-49
lines changed

Tasks/NodeTaskRunnerInstallerV0/constants.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ export const BASE_NODE_VERSIONS_URL = 'https://nodejs.org/dist/index.json';
44

55
export enum RunnerVersion {
66
node6 = '6.17.1',
7-
node10 = '10.24.1'
7+
node10 = '10.24.1',
8+
node16 = '16.20.2'
89
}
910

11+
export const RunnerFolder = {
12+
[RunnerVersion.node6]: 'node',
13+
[RunnerVersion.node10]: 'node10',
14+
[RunnerVersion.node16]: 'node16'
15+
} as const;
16+
1017
export const NODE_INPUT_VERSIONS = {
1118
'6': RunnerVersion.node6,
12-
'10': RunnerVersion.node10
19+
'10': RunnerVersion.node10,
20+
'16': RunnerVersion.node16
1321
} as const;

Tasks/NodeTaskRunnerInstallerV0/modules/cache.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33

44
import * as taskLib from 'azure-pipelines-task-lib';
55

6-
import { RunnerVersion } from '../constants';
6+
import { RunnerVersion, RunnerFolder } from '../constants';
77
import { NodeOsPlatform } from '../interfaces/os-types';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99

@@ -12,7 +12,8 @@ export function isRunnerInstalled(targetRunner: RunnerVersion, osPlatform: NodeO
1212
const agentExternals = getAgentExternalsPath();
1313

1414
const nodeBinName = osPlatform === 'win32' ? 'node.exe' : 'node';
15-
const nodeFolder = targetRunner === RunnerVersion.node6 ? 'node' : 'node10';
15+
16+
const nodeFolder = RunnerFolder[targetRunner];
1617

1718
const nodePath = path.join(agentExternals, nodeFolder, 'bin', nodeBinName);
1819

Tasks/NodeTaskRunnerInstallerV0/modules/installNodeRunner.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ import { isDarwinArmWithRosetta } from '../utils/isDarwinArmWithRosetta';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99
import { getDirContent } from '../utils/getDirContent';
1010
import { NodeOsPlatform, TargetOsInfo } from '../interfaces/os-types';
11+
import { RunnerFolder } from '../constants';
1112

1213
export async function installNodeRunner(targetNodeVersion: string, osInfo: TargetOsInfo) {
1314
let installedArch = osInfo.osArch;
1415

1516
let targetNodePath: string;
17+
let nodeFolderName = RunnerFolder[toolLib.cleanVersion(targetNodeVersion)];
1618

1719
// check cache
18-
targetNodePath = toolLib.findLocalTool('node', targetNodeVersion, installedArch);
20+
targetNodePath = toolLib.findLocalTool(nodeFolderName, targetNodeVersion, installedArch);
1921

2022
// In case if it's darwin arm and toolPath is empty trying to find x64 version
2123
if (!targetNodePath && isDarwinArmWithRosetta(osInfo.osPlatform, installedArch)) {
22-
targetNodePath = toolLib.findLocalTool('node', installedArch, 'x64');
24+
targetNodePath = toolLib.findLocalTool(nodeFolderName, installedArch, 'x64');
2325
installedArch = 'x64';
2426
}
2527

@@ -32,7 +34,7 @@ export async function installNodeRunner(targetNodeVersion: string, osInfo: Targe
3234
);
3335
}
3436

35-
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, 'node', osInfo.osPlatform);
37+
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, nodeFolderName, osInfo.osPlatform);
3638

3739
taskLib.debug('resultNodePath = ' + resultNodePath);
3840

Tasks/NodeTaskRunnerInstallerV0/task.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 2
17+
"Minor": 238,
18+
"Patch": 0
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "Select the node version to install.",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],

Tasks/NodeTaskRunnerInstallerV0/task.loc.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 2
17+
"Minor": 238,
18+
"Patch": 0
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "ms-resource:loc.input.help.runnerVersion",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|0.231.2
2-
Node20-225|0.231.3
1+
Default|0.238.0
2+
Node20-225|0.238.1

_generated/NodeTaskRunnerInstallerV0/constants.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ export const BASE_NODE_VERSIONS_URL = 'https://nodejs.org/dist/index.json';
44

55
export enum RunnerVersion {
66
node6 = '6.17.1',
7-
node10 = '10.24.1'
7+
node10 = '10.24.1',
8+
node16 = '16.20.2'
89
}
910

11+
export const RunnerFolder = {
12+
[RunnerVersion.node6]: 'node',
13+
[RunnerVersion.node10]: 'node10',
14+
[RunnerVersion.node16]: 'node16'
15+
} as const;
16+
1017
export const NODE_INPUT_VERSIONS = {
1118
'6': RunnerVersion.node6,
12-
'10': RunnerVersion.node10
19+
'10': RunnerVersion.node10,
20+
'16': RunnerVersion.node16
1321
} as const;

_generated/NodeTaskRunnerInstallerV0/modules/cache.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33

44
import * as taskLib from 'azure-pipelines-task-lib';
55

6-
import { RunnerVersion } from '../constants';
6+
import { RunnerVersion, RunnerFolder } from '../constants';
77
import { NodeOsPlatform } from '../interfaces/os-types';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99

@@ -12,7 +12,8 @@ export function isRunnerInstalled(targetRunner: RunnerVersion, osPlatform: NodeO
1212
const agentExternals = getAgentExternalsPath();
1313

1414
const nodeBinName = osPlatform === 'win32' ? 'node.exe' : 'node';
15-
const nodeFolder = targetRunner === RunnerVersion.node6 ? 'node' : 'node10';
15+
16+
const nodeFolder = RunnerFolder[targetRunner];
1617

1718
const nodePath = path.join(agentExternals, nodeFolder, 'bin', nodeBinName);
1819

_generated/NodeTaskRunnerInstallerV0/modules/installNodeRunner.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ import { isDarwinArmWithRosetta } from '../utils/isDarwinArmWithRosetta';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99
import { getDirContent } from '../utils/getDirContent';
1010
import { NodeOsPlatform, TargetOsInfo } from '../interfaces/os-types';
11+
import { RunnerFolder } from '../constants';
1112

1213
export async function installNodeRunner(targetNodeVersion: string, osInfo: TargetOsInfo) {
1314
let installedArch = osInfo.osArch;
1415

1516
let targetNodePath: string;
17+
let nodeFolderName = RunnerFolder[toolLib.cleanVersion(targetNodeVersion)];
1618

1719
// check cache
18-
targetNodePath = toolLib.findLocalTool('node', targetNodeVersion, installedArch);
20+
targetNodePath = toolLib.findLocalTool(nodeFolderName, targetNodeVersion, installedArch);
1921

2022
// In case if it's darwin arm and toolPath is empty trying to find x64 version
2123
if (!targetNodePath && isDarwinArmWithRosetta(osInfo.osPlatform, installedArch)) {
22-
targetNodePath = toolLib.findLocalTool('node', installedArch, 'x64');
24+
targetNodePath = toolLib.findLocalTool(nodeFolderName, installedArch, 'x64');
2325
installedArch = 'x64';
2426
}
2527

@@ -32,7 +34,7 @@ export async function installNodeRunner(targetNodeVersion: string, osInfo: Targe
3234
);
3335
}
3436

35-
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, 'node', osInfo.osPlatform);
37+
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, nodeFolderName, osInfo.osPlatform);
3638

3739
taskLib.debug('resultNodePath = ' + resultNodePath);
3840

_generated/NodeTaskRunnerInstallerV0/task.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 2
17+
"Minor": 238,
18+
"Patch": 0
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "Select the node version to install.",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],
@@ -58,7 +59,7 @@
5859
"RunnerAlreadyInstalled": "%s version of node runner already installed on the agent. Skipping installation."
5960
},
6061
"_buildConfigMapping": {
61-
"Default": "0.231.2",
62-
"Node20-225": "0.231.3"
62+
"Default": "0.238.0",
63+
"Node20-225": "0.238.1"
6364
}
6465
}

_generated/NodeTaskRunnerInstallerV0/task.loc.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 2
17+
"Minor": 238,
18+
"Patch": 0
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "ms-resource:loc.input.help.runnerVersion",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],
@@ -58,7 +59,7 @@
5859
"RunnerAlreadyInstalled": "ms-resource:loc.messages.RunnerAlreadyInstalled"
5960
},
6061
"_buildConfigMapping": {
61-
"Default": "0.231.2",
62-
"Node20-225": "0.231.3"
62+
"Default": "0.238.0",
63+
"Node20-225": "0.238.1"
6364
}
6465
}

_generated/NodeTaskRunnerInstallerV0_Node20/constants.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ export const BASE_NODE_VERSIONS_URL = 'https://nodejs.org/dist/index.json';
44

55
export enum RunnerVersion {
66
node6 = '6.17.1',
7-
node10 = '10.24.1'
7+
node10 = '10.24.1',
8+
node16 = '16.20.2'
89
}
910

11+
export const RunnerFolder = {
12+
[RunnerVersion.node6]: 'node',
13+
[RunnerVersion.node10]: 'node10',
14+
[RunnerVersion.node16]: 'node16'
15+
} as const;
16+
1017
export const NODE_INPUT_VERSIONS = {
1118
'6': RunnerVersion.node6,
12-
'10': RunnerVersion.node10
19+
'10': RunnerVersion.node10,
20+
'16': RunnerVersion.node16
1321
} as const;

_generated/NodeTaskRunnerInstallerV0_Node20/modules/cache.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33

44
import * as taskLib from 'azure-pipelines-task-lib';
55

6-
import { RunnerVersion } from '../constants';
6+
import { RunnerVersion, RunnerFolder } from '../constants';
77
import { NodeOsPlatform } from '../interfaces/os-types';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99

@@ -12,7 +12,8 @@ export function isRunnerInstalled(targetRunner: RunnerVersion, osPlatform: NodeO
1212
const agentExternals = getAgentExternalsPath();
1313

1414
const nodeBinName = osPlatform === 'win32' ? 'node.exe' : 'node';
15-
const nodeFolder = targetRunner === RunnerVersion.node6 ? 'node' : 'node10';
15+
16+
const nodeFolder = RunnerFolder[targetRunner];
1617

1718
const nodePath = path.join(agentExternals, nodeFolder, 'bin', nodeBinName);
1819

_generated/NodeTaskRunnerInstallerV0_Node20/modules/installNodeRunner.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ import { isDarwinArmWithRosetta } from '../utils/isDarwinArmWithRosetta';
88
import { getAgentExternalsPath } from '../utils/getAgentExternalsPath';
99
import { getDirContent } from '../utils/getDirContent';
1010
import { NodeOsPlatform, TargetOsInfo } from '../interfaces/os-types';
11+
import { RunnerFolder } from '../constants';
1112

1213
export async function installNodeRunner(targetNodeVersion: string, osInfo: TargetOsInfo) {
1314
let installedArch = osInfo.osArch;
1415

1516
let targetNodePath: string;
17+
let nodeFolderName = RunnerFolder[toolLib.cleanVersion(targetNodeVersion)];
1618

1719
// check cache
18-
targetNodePath = toolLib.findLocalTool('node', targetNodeVersion, installedArch);
20+
targetNodePath = toolLib.findLocalTool(nodeFolderName, targetNodeVersion, installedArch);
1921

2022
// In case if it's darwin arm and toolPath is empty trying to find x64 version
2123
if (!targetNodePath && isDarwinArmWithRosetta(osInfo.osPlatform, installedArch)) {
22-
targetNodePath = toolLib.findLocalTool('node', installedArch, 'x64');
24+
targetNodePath = toolLib.findLocalTool(nodeFolderName, installedArch, 'x64');
2325
installedArch = 'x64';
2426
}
2527

@@ -32,7 +34,7 @@ export async function installNodeRunner(targetNodeVersion: string, osInfo: Targe
3234
);
3335
}
3436

35-
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, 'node', osInfo.osPlatform);
37+
const resultNodePath = await copyNodeToAgentExternals(targetNodePath, nodeFolderName, osInfo.osPlatform);
3638

3739
taskLib.debug('resultNodePath = ' + resultNodePath);
3840

_generated/NodeTaskRunnerInstallerV0_Node20/task.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 3
17+
"Minor": 238,
18+
"Patch": 1
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "Select the node version to install.",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],
@@ -62,7 +63,7 @@
6263
"RunnerAlreadyInstalled": "%s version of node runner already installed on the agent. Skipping installation."
6364
},
6465
"_buildConfigMapping": {
65-
"Default": "0.231.2",
66-
"Node20-225": "0.231.3"
66+
"Default": "0.238.0",
67+
"Node20-225": "0.238.1"
6768
}
6869
}

_generated/NodeTaskRunnerInstallerV0_Node20/task.loc.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"author": "Microsoft Corporation",
1515
"version": {
1616
"Major": 0,
17-
"Minor": 231,
18-
"Patch": 3
17+
"Minor": 238,
18+
"Patch": 1
1919
},
2020
"preview": true,
2121
"demands": [],
@@ -35,7 +35,8 @@
3535
"helpMarkDown": "ms-resource:loc.input.help.runnerVersion",
3636
"options": {
3737
"6": "Node.js 6.17.1",
38-
"10": "Node.js 10.24.1"
38+
"10": "Node.js 10.24.1",
39+
"16": "Node.js 16.20.2"
3940
}
4041
}
4142
],
@@ -62,7 +63,7 @@
6263
"RunnerAlreadyInstalled": "ms-resource:loc.messages.RunnerAlreadyInstalled"
6364
},
6465
"_buildConfigMapping": {
65-
"Default": "0.231.2",
66-
"Node20-225": "0.231.3"
66+
"Default": "0.238.0",
67+
"Node20-225": "0.238.1"
6768
}
6869
}

0 commit comments

Comments
 (0)