使用jenkins CLI(在fedora 23上) [英] Using the jenkins CLI (on fedora 23)

查看:104
本文介绍了使用jenkins CLI(在fedora 23上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个jenkins实例.为了在Fedora 23机器上创建该实例,我安装了jenkins(通过dnf)并启动了它(通过systemd).它正在运行,我可以在浏览器中的 http://localhost:8080 上看到它.

I have a jenkins instance running. To create this instance on a Fedora 23 machine, I installed jenkins (via dnf) and started it (via systemd). It is running and I can see it in my browser at http://localhost:8080.

我一直在尝试遵循 https://wiki.jenkins中的指示-ci.org/display/JENKINS/Jenkins+CLI .

我下载 http://localhost:8080/jnlpJars/jenkins-cli.jar 到我的计算机上.

I download http://localhost:8080/jnlpJars/jenkins-cli.jar to my computer.

然后我尝试运行程序java -jar jenkins-cli.jar http://127.0.0.1 -s help,我得到no main manifest attribute, in jenkins-cli.jar

Then I try to run the program java -jar jenkins-cli.jar http://127.0.0.1 -s help and I get no main manifest attribute, in jenkins-cli.jar

当我检查jenkins-cli.jar时,请确保清单文件中没有Main-Class条目.

When I check jenkins-cli.jar, sure enough there is no Main-Class entry in the manifest file.

调用jenkins cli的正确方法是什么?

What is the proper way to invoke the jenkins cli?

附录 https://wiki.jenkins-ci.org/display/JENKINS /Starting + and + Accessing + Jenkins 有一个使用jenkins cli的单独过程,但没有说明从何处获得jenkins.jar.

Addendum https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins has a separate procedure for using the jenkins cli, but it does not explain where to obtain jenkins.jar.

推荐答案

我已经解决了一个难题.我希望有人有更好的主意.

I have worked out a kludgy solution. I hope someone has a better idea.

在我的实例上运行

curl http://www.java2s.com/Code/JarDownload/localizer/localizer-1.9.jar.zip > localizaer-1.9.jar.zip
unzip localizaer-1.9.jar.zip
curl http://central.maven.org/maven2/commons-codec/commons-codec/1.9/commons-codec-1.9.jar > commons-code-1.9.jar
java -classpath /usr/share/jenkins/webroot/WEB-INF/jenkins-cli.jar:/usr/share/jenkins/webroot/WEB-INF/remoting.jar:/usr/share/jenkins/webroot/WEB-INF/slave.jar:/usr/share/jenkins/webroot/WEB-INF/classes:localizer-1.9.jar:commons-code-1.9.jar:localizer-1.9.jar hudson.cli.CLI -s http://localhost:8080 help

我不喜欢它,因为它超级笨拙,但似乎可以正常工作.

I don't like it because it is super-kludgy, but it seems to work.

这篇关于使用jenkins CLI(在fedora 23上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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