Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven authenticate only backups settings if file exists before first run #20158

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
525 changes: 338 additions & 187 deletions Tasks/MavenAuthenticateV0/_buildConfigs/Node20/package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions Tasks/MavenAuthenticateV0/mavenauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ async function run(): Promise<void> {

if (tl.exist(userSettingsXmlPath)) {
tl.debug(tl.loc("Info_SettingsXmlRead", userSettingsXmlPath));
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
if (!tl.getVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH') && !tl.exist(backupSettingsXmlPath)) {
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
}
settingsJson = await util.readXmlFileAsJson(userSettingsXmlPath);
}
else {
tl.debug(tl.loc("Info_CreatingSettingsXml", userSettingsXmlPath));
tl.setVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH', userSettingsXmlPath);
}

for (let serverElement of newServerElements) {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/MavenAuthenticateV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Minor": 243,
"Patch": 0
},
"runsOn": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/MavenAuthenticateV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Minor": 243,
"Patch": 0
},
"runsOn": [
Expand Down
4 changes: 2 additions & 2 deletions _generated/MavenAuthenticateV0.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|0.238.0
Node20_229_1|0.238.1
Default|0.243.0
Node20_229_1|0.243.1
7 changes: 5 additions & 2 deletions _generated/MavenAuthenticateV0/mavenauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ async function run(): Promise<void> {

if (tl.exist(userSettingsXmlPath)) {
tl.debug(tl.loc("Info_SettingsXmlRead", userSettingsXmlPath));
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
if (!tl.getVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH') && !tl.exist(backupSettingsXmlPath)) {
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
}
settingsJson = await util.readXmlFileAsJson(userSettingsXmlPath);
}
else {
tl.debug(tl.loc("Info_CreatingSettingsXml", userSettingsXmlPath));
tl.setVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH', userSettingsXmlPath);
embetten marked this conversation as resolved.
Show resolved Hide resolved
}

for (let serverElement of newServerElements) {
Expand Down
6 changes: 3 additions & 3 deletions _generated/MavenAuthenticateV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Minor": 243,
"Patch": 0
},
"runsOn": [
Expand Down Expand Up @@ -80,7 +80,7 @@
"Error_FailedCleanupM2": "Failed to delete credentials from the user settings.xml file: %s"
},
"_buildConfigMapping": {
"Default": "0.238.0",
"Node20_229_1": "0.238.1"
"Default": "0.243.0",
"Node20_229_1": "0.243.1"
}
}
6 changes: 3 additions & 3 deletions _generated/MavenAuthenticateV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 238,
"Minor": 243,
"Patch": 0
},
"runsOn": [
Expand Down Expand Up @@ -80,7 +80,7 @@
"Error_FailedCleanupM2": "ms-resource:loc.messages.Error_FailedCleanupM2"
},
"_buildConfigMapping": {
"Default": "0.238.0",
"Node20_229_1": "0.238.1"
"Default": "0.243.0",
"Node20_229_1": "0.243.1"
}
}
7 changes: 5 additions & 2 deletions _generated/MavenAuthenticateV0_Node20/mavenauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ async function run(): Promise<void> {

if (tl.exist(userSettingsXmlPath)) {
tl.debug(tl.loc("Info_SettingsXmlRead", userSettingsXmlPath));
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
if (!tl.getVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH') && !tl.exist(backupSettingsXmlPath)) {
tl.cp(userSettingsXmlPath, backupSettingsXmlPath);
tl.setTaskVariable("backupUserM2SettingsFilePath", backupSettingsXmlPath);
}
settingsJson = await util.readXmlFileAsJson(userSettingsXmlPath);
}
else {
tl.debug(tl.loc("Info_CreatingSettingsXml", userSettingsXmlPath));
tl.setVariable('FIRST_RUN_SETTINGS_XML_EXISTS_PATH', userSettingsXmlPath);
}

for (let serverElement of newServerElements) {
Expand Down
Loading
Loading