如何从XL Release Task触发Jenkins构建作业

时间:2015-05-18 09:31:46

标签: jenkins xlrelease

我们一直在使用'XL Release'服务器(XLR)进行项目发布管理,Jenkins用于从GitHub持续集成项目。我试图通过提供Jenkins URL /用户名/密码和Jenkins作业名称等基本配置来为XLR上的一个Release创建一个Jenkins任务。

现在,当我在XLR中启动任务时,它会显示如下错误消息:

“无法在http://[Jenkins服务器连接{job // build。状态:405”

响应与下面的脚本一样:

<!DOCTYPE html><html><head resURL="/static/84561821">


<title>Form post required [Jenkins]</title><link rel="stylesheet" type="text/css" href="/static/84561821/css/style.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/css/color.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/css/responsive-grid.css" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/static/84561821/favicon.ico" /><script>var isRunAsTest=false; var rootURL=""; var resURL="/static/84561821";</script><script src="/static/84561821/scripts/prototype.js" type="text/javascript"></script><script src="/static/84561821/scripts/behavior.js" type="text/javascript"></script><script src='/adjuncts/84561821/org/kohsuke/stapler/bind.js' type='text/javascript'></script><script src="/static/84561821/scripts/yui/yahoo/yahoo-min.js"></script><script src="/static/84561821/scripts/yui/dom/dom-min.js"></script><script src="/static/84561821/scripts/yui/event/event-min.js"></script><script src="/static/84561821/scripts/yui/animation/animation-min.js"></script><script src="/static/84561821/scripts/yui/dragdrop/dragdrop-min.js"></script><script src="/static/84561821/scripts/yui/container/container-min.js"></script><script src="/static/84561821/scripts/yui/connection/connection-min.js"></script><script src="/static/84561821/scripts/yui/datasource/datasource-min.js"></script><script src="/static/84561821/scripts/yui/autocomplete/autocomplete-min.js"></script><script src="/static/84561821/scripts/yui/menu/menu-min.js"></script><script src="/static/84561821/scripts/yui/element/element-min.js"></script><script src="/static/84561821/scripts/yui/button/button-min.js"></script><script src="/static/84561821/scripts/yui/storage/storage-min.js"></script><script src="/static/84561821/scripts/hudson-behavior.js" type="text/javascript"></script><script src="/static/84561821/scripts/sortable.js" type="text/javascript"></script><script>crumb.init("", "");</script><link rel="stylesheet" type="text/css" href="/static/84561821/scripts/yui/container/assets/container.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/scripts/yui/assets/skins/sam/skin.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/scripts/yui/container/assets/skins/sam/container.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/scripts/yui/button/assets/skins/sam/button.css" /><link rel="stylesheet" type="text/css" href="/static/84561821/scripts/yui/menu/assets/skins/sam/menu.css" /><link title="Jenkins" rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" /><meta name="ROBOTS" content="INDEX,NOFOLLOW" /><script src="/static/84561821/scripts/yui/cookie/cookie-min.js"></script></head><body id="jenkins" data-version="jenkins-1.612" class="yui-skin-sam jenkins-1.612"><a href="#skip2content" class="skiplink">Skip to content</a><div id="page-head"><div id="header"><div class="logo"><a id="jenkins-home-link" href="/"><img id="jenkins-head-icon" alt="title" src="/static/84561821/images/headshot.png" /><img id="jenkins-name-icon" height="34" alt="title" width="139" src="/static/84561821/images/title.png" /></a></div><div class="login"> <span style="white-space:nowrap"><a class="model-link inside inverse" href="/user/admin"><b>Admin</b></a>
                |
                <a href="/logout"><b>log out</b></a></span></div><div class="searchbox hidden-xs"><form style="position:relative;" name="search" action="/job/XLRConnect/search/" class="no-json" method="get"><div id="search-box-minWidth"></div><div id="search-box-sizer"></div><div id="searchform"><input id="search-box" placeholder="search" name="q" class="has-default-text" /> <a href="http://wiki.jenkins-ci.org/display/JENKINS/Search+Box"><img style="width: 16px; height: 16px; " class="icon-help icon-sm" src="/static/84561821/images/16x16/help.png" /></a><div id="search-box-completion"></div><script>createSearchBox("/job/XLRConnect/search/");</script></div></form></div></div><div id="breadcrumbBar"><tr id="top-nav"><td id="left-top-nav" colspan="2"><link rel='stylesheet' href='/adjuncts/84561821/lib/layout/breadcrumbs.css' type='text/css' /><script src='/adjuncts/84561821/lib/layout/breadcrumbs.js' type='text/javascript'></script><div class="top-sticker noedge"><div class="top-sticker-inner"><div id="right-top-nav"><div id="right-top-nav"><div class="smallfont"><a href="?auto_refresh=true">ENABLE AUTO REFRESH</a></div></div></div><ul id="breadcrumbs"><li class="item"><a class="model-link inside" href="/">Jenkins</a></li><li class="children" href="/"></li><li class="item"><a class="model-link inside" href="/job/XLRConnect/">XLRConnect</a></li><li class="children" href="/job/XLRConnect/"></li></ul><div id="breadcrumb-menu-target"></div></div></div></td></tr></div></div><div id="page-body"><div class="row"><div id="side-panel"><div id="side-panel-content"></div></div><div id="main-panel"><div id="main-panel-content"><a name="skip2content"></a><p>You must use POST method to trigger builds. (From scripts you may instead pass a per-project authentication token, or authenticate with your API token.) If you see this page, it may be because a plugin offered a GET link; file a bug report for that plugin.</p><form method="POST"><input value="Proceed" type="submit" /></form></div></div></div></div><div id="footer-container" class="hidden-xs"><div id="footer"><span class="page_generated">
      Page generated:
      May 15, 2015 7:19:33 AM</span><span class="rest_api"><a href="api/">REST API</a></span><span class="jenkins_ver"><a href="http://jenkins-ci.org/">Jenkins ver. 1.612</a></span><div id="l10n-dialog" class="dialog"></div><div id="l10n-footer" style="display:none; float:left"><a href="#" onclick="return showTranslationDialog();"><img src="/static/84561821/plugin/translation/flags.png" />
  Help us localize this page
</a></div><script>var footer = document.getElementById('l10n-footer');
var f = document.getElementById('footer');
f.insertBefore(footer,f.firstChild);
footer.style.display="block";

var translation={}; 
translation.bundles = "2/IQrALgQj5lxSaSGgxqQQkSUo1ENoPujAvbNoPJBK21a2oKoF/JGOpvDglu0VebF5yobsoJyFLor25mINHZlxHylXblrqHOuffnUiU91xUSw1gbTHkbtyOsTKsLGVLKw+X2jk0M8bGwrntRODX2cfYB5AJ8mQaEVEmEwEZD1sCFMVG2gQHzDmgiIVBSBPtqCOjg5K4JvO0BpT9HTnxudGzYRNvIi+Dln94MShP6x3g3gP83NCpANQ7L+7XkvT3Q5cifZcX37D4vYCyYpERPJc9hO5WlbsUd7DJEAvVwemi7azuvAfJEQ34mjOBf2+72xE/EYKxZv85GUpwC79oVObY0jBPF+WHG94syh70ZYIw=";
translation.detectedLocale = "";

function showTranslationDialog() {
  if(!translation.launchDialog)
    loadScript("/static/84561821/plugin/translation/dialog.js");
  else
    translation.launchDialog();
  return false; 
}</script></div></div></body></html> 

响应头看起来像

Response headers: {'X-Frame-Options': 'sameorigin', 'X-Instance-Identity': 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyIYGgQSshNjxYz1dxA4h4OQtyFz00oXjDDjMSeJmR0o9Qrr9CkDYnrjuher6aMj/ls8qI2um+CHk9zVwUeSTzHhBIg29V+l7Hu4k9RF18ZY2omMDgonvuH9sqBpKAu4/S1U+RXQuQIKQk/66+UhhXPL3EYqYiNPuvRHXfhqIjXqH8Ts58q1ueuJ06b63RcnAx1z3XEq/pBMImz1HaXFhqS//FVhnx6Rl+AC7pXksR+vchyk8M9oHixtHk4lqaJxCgdAjydojVagPwEeh98TfBcmhjdLQhdLNaTe0SB7agNgiN0rgwzC9CCbQYlFMcYZ2UrcsPL5XsFRs8sqiMlPpswIDAQAB', 'X-Content-Type-Options': 'nosniff', 'X-Jenkins-CLI-Port': '41603', 'X-Jenkins-CLI2-Port': '41603', 'X-Jenkins-Session': '84561821', 'X-Hudson-CLI-Port': '41603', 'Cache-Control': 'no-cache,no-store,must-revalidate', 'Allow': 'POST', 'X-Hudson': '1.395', 'Server': 'Jetty(winstone-2.8)', 'X-Jenkins': '1.612', 'Set-Cookie': 'JSESSIONID.fa5428c3=158cuy2kt13l64ci0bpcstd9b;Path=/;HttpOnly', 'X-Hudson-Theme': 'default', 'Content-Type': 'text/html;charset=UTF-8', 'Expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'X-SSH-Endpoint': '10.80.250.149:48964'}

Exception during execution: SystemExit: 1 in <script> at line number 113

问题

此类设置是否有任何先决条件?或者我错过了Jenkins配置中的任何内容?

如果有人可以向任何方向指出,那将是非常有帮助的。到目前为止,我无法找到任何适合此组合的文档(Jenkins + XLR),尽管两种工具默认相互支持。

注意:Jenkins有一个XL Release插件,它有助于通过构建作业创建新版本。但是我的要求相反,XLR的任务将触发Jenkins构建工作。

1 个答案:

答案 0 :(得分:1)

您是否在启用安全性的情况下运行Jenkins?如果是这样,以下文章“配置XL Release Jenkins插件以调用安全的Jenkins安装”可能有所帮助:

https://support.xebialabs.com/hc/communities/public/questions/202581015-How-To-Configure-the-XL-Release-Jenkins-plugin-to-invoke-secured-Jenkins-installations-by-sending-POSTs

此致

AP