Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I pull artifacts from TeamCity?

I would like to pull artifacts from teamcity.

I've been trying to use c# and the HtmlAgilityPack to goto the website and find the latest version and its artifacts. I'm currently stuck at the login, I think I just need to be sending Session Cookies out.

Am I going in the right direction, has anyone else tried this?

I realize that pushing files out with the build scripts is easy but I'd like to minimize changes to the Ant,NAnt files since I'm looking at scaling this to 100 apps.

Edit: this question looks promising Getting HTML from a page behind a login

Edit: this works now, I just need to write some code to parse it

WebClient ww = new WebClient();
ww.Credentials = CredentialCache.DefaultCredentials;
ww.DownloadString("http://yourteamcity.com/login.html");
ww.Headers.Add("Cookie",ww.ResponseHeaders["Set-Cookie"]);

NameValueCollection post = new NameValueCollection();
post.Add("username", "name");
post.Add("remember","true");
post.Add("submitLogin", "Login");
post.Add("publicKey","long thing to intercept with fiddler");
post.Add("encryptedPassword","not giving you this");
post.Add("_", "");
byte[] values = ww.UploadValues("http://yourteamcity.com/loginSubmit.html", "POST",post);
string s = ww.DownloadString("http://yourteamcity.com/overview.html");
like image 377
Scott Cowan Avatar asked Oct 10 '08 09:10

Scott Cowan


People also ask

Where are artifacts stored in TeamCity?

By default, the artifacts are stored under the <TeamCity Data Directory\>/system/artifacts directory which can be changed. You can configure an external artifacts storage to replace the built-in one. Build artifacts can also be uploaded to the server while the build is still running.

How do you download builds on TeamCity?

What you're actually looking to do is create artifacts in TeamCity. Artifacts are normally a build output which are then attached to the individual build runs so that you can download and review them at a later date. There's a walk through including the creation of build artifacts in You're deploying it wrong!

What is artifact path in TeamCity?

Artifact Paths Build artifacts are files produced by the build which are stored on TeamCity server and can be downloaded from the TeamCity UI or used as artifact dependencies by other builds.

How do you zip artifacts in TeamCity?

You can specify a zip file for your output which i would recommend to save space. to do this you simply give it the location in the format of “MyFile. zip!/Subfolder” and it will compress your output into a folder in the zip file.


1 Answers

There are simpler solutions, please read this: http://www.jetbrains.net/confluence/display/TCD4/Patterns+For+Accessing+Build+Artifacts

like image 116
Pavel Sher Avatar answered Sep 26 '22 00:09

Pavel Sher