Build Agent Working Paths
Hello everyone,
I have a rather complex question about how the build agent handles its working paths.
Here's the basic situation:
I have a build agent building for the project CompanyProjectX::ProjectX
The directory.map looks like this:
bt2=CompanyProjectX::ProjectX -> f54d78a299f7f499 |?| Nov 20, 2017 8:07:36 AM UTC |:| default
bt2=CompanyProjectX::ProjectX -> c44e4eee366a1459 |?| Nov 20, 2017 8:33:38 AM UTC |:| default
bt2=CompanyProjectX::ProjectX -> ebd6fd5e0031f83f |?| Nov 20, 2017 8:58:19 AM UTC |:| default
My first question is: Why does the project have three different folders. I don't understand the purpose of these. I believe it came to be because I added a new VCS root to the project to import the "www" project. Before that, this project only had the f54d78a299f7f499 folder.
Now, to the extension of said problem. For my purposes, there are a total of two folders that are relevant, and which I want to address with PowerShell scripts in the build:
* The artifacts folder, which contains the build artifacts
* The www folder, which contains files relevant to the project
The main problem is: Those two folders are not in the same working directory.
* The artifacts folder is located in f54d78a299f7f499
* The www folder is located in c44e4eee366a1459 and ebd6fd5e0031f83f
I know I could address them with absolute paths, but I fear that would run the risk of me getting wrong or outdated files. So I'd rather address them with relative paths, but that can't work since the folders are in in different working directories of the build agent.
I want to understand what is happening here. Why do I have three working directories for the same project? And why is the artifacts folder only in the oldest project, and not in the two most recent ones? If the artifacts folder would exist in the most recent working directory, I would have no problem creating relative path PowerShell scripts. But for some reason, it does not, and that is where the trouble starts.
I have tried checking if an absolute path for the artifacts is specified in the Artifact paths, but all it reads is:
artifacts => artifacts
3rdPartyDlls => 3rdPartyDlls
Can somebody please help me with this?
Update 20-Nov-2017 10:30 UTC:
Okay, I figured out the mystery of the stray artifacts folder. My predecessor had written a kinda dodgy script which manually created the folder in an absolute path.
However, I would still like to understand:
1.) Why the build agent now has three work directories for this project
2.) How the Artifact paths are determined. I don't have an "artifacts" folder in the newer work directories, but I do have a "3rdPartyDlls" folder
Update 20-Nov-2017 11:20 UTC:
I've now realized the artifacts path was created by another PowerShell script with an absolute path and remedied this, so now all agent working directories have an "artifacts" folder, right next to the "3rdPartyDlls" folder.
However, when building, I get a warning at the end of the build:
Note that although the "artifacts" folder and the "3rdPartyDlls" folder both exist in each of the 3 working directories, TeamCity for some reason that I don't understand does not find the "artifacts" folder, even though it does find the "3rdPartyDlls" folder.
I've already made sure it's not a typo. Using the windows search in the agent work directories, I find both the 3 "artifacts" folders and the 3 "3rdPartyDlls" folders.
Thanks in advance.
Kira Resari
Please sign in to leave a comment.