我怎么能拉的文物从TeamCity的? [英] How can I pull artifacts from TeamCity?

查看:176
本文介绍了我怎么能拉的文物从TeamCity的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从拉的TeamCity文物。

我一直在尝试使用C#和HtmlAgilityPack到转到该网站,并找到最新的版本和它的文物。我目前停留在登录,我想我只是需要被发送会话Cookie了。

我在正确的方向前进,有其他人尝试过呢?

我认识到,推动了文件的构建脚本很容易,但我想,以尽量减少,因为我在看这个扩展到100应用改变蚂蚁,南特的文件。

编辑:这个问题看起来很有希望获得从HTML页面登录背后

编辑:这个工程现在,我只需要编写一些code解析它

  WebClient的WW =新的WebClient();
ww.Credentials = CredentialCache.DefaultCredentials;
ww.DownloadString(http://yourteamcity.com/login.html);
ww.Headers.Add(曲奇,ww.ResponseHeaders [设置Cookie]);NameValueCollection中后=新的NameValueCollection();
post.Add(用户名,名);
post.Add(记住,真);
post.Add(submitLogin,登录);
post.Add(公钥,长的事与小提琴手拦截);
post.Add(encryptedPassword,不给你这个);
post.Add(_,);
字节[] =值ww.UploadValues​​(http://yourteamcity.com/loginSubmit.html,POST,后);
字符串s = ww.DownloadString(http://yourteamcity.com/overview.html);


解决方案

有简单的解决方案,请仔细阅读本:<一href=\"http://www.jetbrains.net/confluence/display/TCD4/Patterns+For+Accessing+Build+Artifacts\">http://www.jetbrains.net/confluence/display/TCD4/Patterns+For+Accessing+Build+Artifacts

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");

解决方案

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

这篇关于我怎么能拉的文物从TeamCity的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆