Skip to content

Commit

Permalink
Add updating UpdateAgentPackage.xml in Release CI (#4796)
Browse files Browse the repository at this point in the history
* Add UpdateAgentPackage file to an ADO PR
  • Loading branch information
ivanduplenskikh authored May 16, 2024
1 parent 02eb61d commit b575d90
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 10 deletions.
25 changes: 15 additions & 10 deletions release/createAdoPrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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`);
Expand Down Expand Up @@ -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'
),
]
);

Expand Down
81 changes: 81 additions & 0 deletions src/Misc/UpdateAgentPackage.template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This step is run during every deployment host upgrade, to ensure that all agents are up to date.
-->
<ServicingStepGroup name="UpdateAgentPackage">
<ExecutionHandlers>
<ExecutionHandler type="Microsoft.TeamFoundation.DistributedTask.Server.Extensions.NonPipelinesOnlyExecutionHandler" />
</ExecutionHandlers>
<Steps>
<ServicingStep name="Add OSX agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="osx-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-osx-x64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-osx-x64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add OSX (arm64) agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="osx-arm64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-osx-arm64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-osx-arm64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x64 Linux agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="linux-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-linux-x64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-linux-x64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add ARM Linux agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="linux-arm" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-linux-arm-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-linux-arm-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add ARM64 Linux agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="linux-arm64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-linux-arm64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-linux-arm64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x64 Windows agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="win-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-win-x64-<AGENT_VERSION>.zip" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-win-x64-<AGENT_VERSION>.zip" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x86 Windows agent package" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="agent" platform="win-x86" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-win-x86-<AGENT_VERSION>.zip" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-win-x86-<AGENT_VERSION>.zip" />
</StepData>
</ServicingStep>
<ServicingStep name="Add OSX agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="osx-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-osx-x64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-osx-x64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add ARM OSX agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="osx-arm64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-osx-arm64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-osx-arm64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x64 Linux agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="linux-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-linux-x64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-linux-x64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add ARM Linux agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="linux-arm" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/vsts-agent-linux-arm-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="vsts-agent-linux-arm-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add ARM64 Linux agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="linux-arm64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-linux-arm64-<AGENT_VERSION>.tar.gz" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-linux-arm64-<AGENT_VERSION>.tar.gz" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x64 Windows agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="win-x64" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-win-x64-<AGENT_VERSION>.zip" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-win-x64-<AGENT_VERSION>.zip" />
</StepData>
</ServicingStep>
<ServicingStep name="Add x86 Windows agent package (without Node 6)" stepPerformer="DistributedTask" stepType="AddTaskPackage">
<StepData>
<AddTaskPackageData packageType="pipelines-agent" platform="win-x86" version="<AGENT_VERSION>" hashValue="<HASH_VALUE>" downloadUrl="https://vstsagentpackage.azureedge.net/agent/<AGENT_VERSION>/pipelines-agent-win-x86-<AGENT_VERSION>.zip" infoUrl="https://go.microsoft.com/fwlink/?LinkId=798199" filename="pipelines-agent-win-x86-<AGENT_VERSION>.zip" />
</StepData>
</ServicingStep>
</Steps>
</ServicingStepGroup>

0 comments on commit b575d90

Please sign in to comment.