问题描述
我需要在本地主机(CentOS)中安装Jenkins,并尝试通过以下链接发布程序:
I need to install Jenkins in my localhost(CentOS) and I tried issuing the procedures in the following link:
https://wiki.jenkins-ci. org/display/JENKINS/Installing + Jenkins + on + RedHat +发行版
但是它给出了一个错误信息,
But it gives an error saying,
解决pkg.jenkins-ci.org ... 63.246.20.93连接到pkg.jenkins-ci.org | 63.246.20.93 |:80 ...失败:连接被拒绝.
Resolving pkg.jenkins-ci.org... 63.246.20.93Connecting to pkg.jenkins-ci.org|63.246.20.93|:80... failed: Connection refused.
不过,wget http://pkg.jenkins-ci.org 可以正常工作.
Though, wget http://pkg.jenkins-ci.org works fine.
有人可以帮助我解决此问题吗?
Can anyone help me to resolve this issue?
推荐答案
我建议您先下载War,然后运行 java -jar jenkins.war
以查看其是否正常运行.它将以默认值开始.
I'd suggest you first download the war, and run java -jar jenkins.war
to see if it works properly. It will start with the defaults.
如果一切正常,也许只需将其包装成脚本并将其配置为作为服务运行即可.
If all is OK, maybe just wrap this with a script and configure it to run as a service.
我希望这会有所帮助.
编辑:这很老,但是值得一提的是,Jenkins有一个正式的Docker映像,您可以使用它来快速启动用于测试的本地实例.您还可以将本地目录挂载到容器中以进行持久性存储,这使其成为CI开发的理想选择.
EDIT: This is old, but worth mentioning that Jenkins has a formal Docker image you can use to quickly spin up a local instance for your tests. You can also mount a local directory into your container for persistence storage, which makes it a great option for your CI developments.
快速测试
docker run -p 8080:8080 jenkins
更好的用法(带有持久性存储)
Better usage (with persistence storage)
docker run -d --name jenkins -p 8080:8080 -p 50000:50000 -v /local/dir:/var/jenkins_home jenkins
将浏览器指向 http://localhost:8080
请参见 Github官方页面
这篇关于在本地安装jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!