【发布时间】:2020-05-12 17:49:28
【问题描述】:
我正在学习 jenkins,我一直很难使用参数将 jenkins 部署到 tomcat,尤其是在 windows 机器上运行的 jenkins。 这个问题与之前在 stackoverflow 上提出的问题几乎相同,但我不认为答案是匹配的,因为它是如此广泛。问题已解释here
我的tomcat用户权限设置如下
<role rolename="tomcat"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="manager" password="tomcat" roles="tomcat,manager-gui"/>
<user username="jenkins" password="jenkins" roles="manager-script"/>
我正在尝试在带有 curl 的 Windows 10 上使用以下 curl 命令进行部署
curl -u %tcuser%:%tcpass% -F filedata=target/**.war "http://localhost:8080/manager/text/deploy?path=/devops&update=true"
我在 jenkins 中遇到以下错误
C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.[*******]\workspace\devops01>curl -u [*******]:[*******] -F filedata=target/**.war "http://localhost:8080/manager/text/deploy?path=/devops&update=true"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 908 100 752 100 156 752 156 0:00:01 --:--:-- 0:00:01 7264
<!doctype html><html lang="en"><head><title>HTTP Status 405 – Method Not Allowed</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 405 – Method Not Allowed</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> HTTP method POST is not supported by this URL</p><p><b>Description</b> The method received in the request-line is known by the origin server but not supported by the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.54</h3></body></html>
C:\WINDOWS\system32\config\systemprofile\AppData\Local\Jenkins.[*******]\workspace\devops01>exit 0
有人可以帮我吗?
【问题讨论】:
-
有人可以帮忙吗?相信很多人都遇到过类似的问题。谢谢。