【发布时间】:2015-08-12 08:08:58
【问题描述】:
按照this 教程,我想在 Slack 中包含一个斜杠命令,它将远程触发 Jenkins 构建。我的 Jenkins 服务器是使用 ngnix 的反向代理。
所以,https://[Jenkins-Server]/buildByToken/build?job=[job-name]&token=[token] 命令在使用curl 或我的浏览器运行时会触发构建。
curl 输出是
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 12 Aug 2015 08:51:41 GMT
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 11
Connection: keep-alive
X-Content-Type-Options: nosniff
但是当它通过 Slack 触发时,会给出以下输出。我在集成斜杠命令时嵌入了相同的 URL。
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>
我是 slack 的新手,任何帮助将不胜感激。
【问题讨论】:
-
请检查您的 http 日志以确保您使用的是正确的 Token