Increment in _work directory

前端 未结 2 708
夕颜
夕颜 2021-01-24 10:54

What causes the folder name under \'_work\' to change on a Private Agent?

We are currently using _work/10/s etc. It has used this for the last few builds, but what would

相关标签:
2条回答
  • 2021-01-24 11:05

    Each build definition gets its own folder. This allows for total isolation of source code and build outputs.

    You should never rely on hard-coding this path; you can reference a build's working directory with the $(System.DefaultWorkingDirectory) variable.

    0 讨论(0)
  • 2021-01-24 11:05

    There is SourceRootMapping folder in the working folder and there are Mappings.json and SourceFolder.json files (SourceRootMapping{guid} folder{build definition id} folder\sourceFolder.json) in this folder.

    Mappings.json:

    {
      "lastBuildFolderCreatedOn": "05/16/2018 13:20:06 +08:00",
      "lastBuildFolderNumber": 2
    }
    

    A SourceFolder.json:

    {
      "build_artifactstagingdirectory": "1\\a",
      "agent_builddirectory": "1",
      "collectionUrl": "https://XXX.visualstudio.com/",
      "definitionName": "a",
      "fileFormatVersion": 3,
      "lastRunOn": "05/16/2018 13:18:06 +08:00",
      "repositoryType": "TfsGit",
      "lastMaintenanceAttemptedOn": "",
      "lastMaintenanceCompletedOn": "",
      "build_sourcesdirectory": "1\\s",
      "common_testresultsdirectory": "1\\TestResults",
      "collectionId": "21136b22-dbe8-4fae-a111-3f8c5b0fed9b",
      "definitionId": "285",
      "hashKey": "d2545895fec8eea22c60ecc24f6593a986106b80",
      "repositoryUrl": "https://starain.visualstudio.com/Scrum2017/_git/cppbase",
      "system": "build"
    }
    

    So, it’s easy to find that the VSTS agent increase the folder number per to Mappings.json and SourceFolder.json file is used to mapping build definition and its corresponding working folder.

    0 讨论(0)
提交回复
热议问题