From b575d906463f45339975411aaf470171db35864e Mon Sep 17 00:00:00 2001 From: Ivan Duplenskikh <115665590+ivanduplenskikh@users.noreply.github.com> Date: Thu, 16 May 2024 12:23:22 +0200 Subject: [PATCH] Add updating UpdateAgentPackage.xml in Release CI (#4796) * Add UpdateAgentPackage file to an ADO PR --- release/createAdoPrs.js | 25 +++++--- src/Misc/UpdateAgentPackage.template.xml | 81 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 10 deletions(-) create mode 100644 src/Misc/UpdateAgentPackage.template.xml diff --git a/release/createAdoPrs.js b/release/createAdoPrs.js index 6a5743ece9..da0ab0e813 100644 --- a/release/createAdoPrs.js +++ b/release/createAdoPrs.js @@ -33,14 +33,16 @@ const connection = new azdev.WebApi(httpsOrgUrl, authHandler); function createIntegrationFiles(agentVersion) { fs.mkdirSync(INTEGRATION_DIR, { recursive: true }); - const xmlFilePath = path.join(INTEGRATION_DIR, 'InstallAgentPackage.xml'); - util.fillAgentParameters( - path.join(__dirname, '..', 'src', 'Misc', 'InstallAgentPackage.template.xml'), - xmlFilePath, - agentVersion - ); - clearEmptyHashValueLine(xmlFilePath); - clearEmptyXmlNodes(xmlFilePath); + for (const agentPackageXml of ['InstallAgentPackage', 'UpdateAgentPackage']) { + const xmlFilePath = path.join(INTEGRATION_DIR, `${agentPackageXml}.xml`); + util.fillAgentParameters( + path.join(__dirname, '..', 'src', 'Misc', `${agentPackageXml}.template.xml`), + xmlFilePath, + agentVersion + ); + clearEmptyHashValueLine(xmlFilePath); + clearEmptyXmlNodes(xmlFilePath); + } const publishScriptFilePath = path.join(INTEGRATION_DIR, 'Publish.ps1'); util.fillAgentParameters( @@ -74,7 +76,7 @@ function clearEmptyHashValueLine(filePath) { * @param {string} commitMessage commit message * @param {string} title pull request title * @param {string} description pull reqest description - * @param {string} targetsToCommit files to add in pull request + * @param {string[]} targetsToCommit files to add in pull request */ async function openPR(repo, project, sourceBranch, targetBranch, commitMessage, title, description, targetsToCommit) { console.log(`Creating PR from "${sourceBranch}" into "${targetBranch}" in the "${project}/${repo}" repo`); @@ -183,7 +185,10 @@ async function main() { [ path.join( 'DistributedTask', 'Service', 'Servicing', 'Host', 'Deployment', 'Groups', 'InstallAgentPackage.xml' - ) + ), + path.join( + 'DistributedTask', 'Service', 'Servicing', 'Host', 'Deployment', 'Groups', 'UpdateAgentPackage.xml' + ), ] ); diff --git a/src/Misc/UpdateAgentPackage.template.xml b/src/Misc/UpdateAgentPackage.template.xml new file mode 100644 index 0000000000..571c07e99b --- /dev/null +++ b/src/Misc/UpdateAgentPackage.template.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +