我正在运行Ubuntu 11.10并且已经运行sudo apt-get install jenkins在这个系统上安装Jenkins.
我已经看过一些关于如何设置反向代理(Apache,Nginx等)的教程,但是这是一个专门用于jenkins的VM,我希望在jenkins在端口80上运行时保持尽可能精简.
我找到了upstart配置/etc/init/jenkins.conf并将端口修改为80env HTTP_PORT=80
当我启动jenkins via时service jenkins start,ps显示它运行了几秒钟然后终止.
这是因为jenkins作为jenkins特权端口上的用户运行吗?如果是这样,我该如何解决这个问题?欢迎任何其他想法.
这是upstart配置:
description "jenkins: Jenkins Continuous Integration Server"
author "James Page <james.page@ubuntu.com>"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
env USER="jenkins"
env GROUP="jenkins"
env JENKINS_LOG="/var/log/jenkins"
env JENKINS_ROOT="/usr/share/jenkins"
env JENKINS_HOME="/var/lib/jenkins"
env JENKINS_RUN="/var/run/jenkins"
env HTTP_PORT=80
env AJP_PORT=-1
env JAVA_OPTS=""
env JAVA_HOME="/usr/lib/jvm/default-java"
limit nofile 8192 8192
pre-start script
test -f $JENKINS_ROOT/jenkins.war || { stop ; exit 0; …Run Code Online (Sandbox Code Playgroud) 我正在收听声纳获取jacoco分析报告的问题.然而,詹金斯能够拿起报告并显示结果.我的项目是由詹金斯建造的maven构建.jacoco报告由maven生成(在pom中配置).通过使用Jenkins插件执行声纳.
这就是我在SonarQube上看到的:

这是我在詹金斯看到的项目报告.

maven插件配置:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.4.201312101107</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
Jenkins Sonar插件配置

这是我正在玩的代码
node {
stage 'build'
echo 'build'
stage 'tests'
echo 'tests'
stage 'end-to-end-tests'
def e2e = build job:'end-to-end-tests', propagate: false
result = e2e.result
if (result.equals("SUCCESS")) {
stage 'deploy'
build 'deploy'
} else {
?????? I want to just fail this stage
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法让我将"端到端测试"阶段标记为失败,而不会使整个工作失败?传播假只是总是将舞台标记为真,这不是我想要的,但传播真实标志着失败的工作,我也不想要.
我是詹金斯和git的新手.我创建了一个远程存储库github.com并制作了它的本地副本.
然后我想通过Jenkins链接它.我为git集成安装了所需的插件,但我不知道在配置新项目时我的本地存储库URL是什么.有人可以帮我找到它吗?
由于现在大约1周,Bitbucket没有(?)向我的Jenkins服务器发送请求.
我把这一切都设置得像这样:
Endpoint http://username:apitoken@jenkinshost/
username= Jenkins
apitoken中的用户名= apitoken连接到Jenkins中的用户名
jenkinshost=我运行Jenkins的主机
Project name是一个项目
Token:我可以在每个项目配置中设置的令牌.
我根据这个网站做了这个:http://felixleong.com/blog/2012/02/hooking-bitbucket-up-with-jenkins.
它确实有效,但现在已经不复存在了.Bitbucket改变了什么吗?我怎样才能解决这个问题?

我正在使用Scriptler插件,所以我可以运行一个groovy脚本作为构建步骤.我的Jenkins奴隶在服务模式下运行在Windows上.使用scriptler,我不需要使用Windows批处理脚本.
但我很难在构建步骤中获取环境变量...这是有效的:
System.getenv("BASE")
Run Code Online (Sandbox Code Playgroud)
哪里BASE是詹金斯启动将env-瓦尔的一部分.但是,我想得到
%JOB_NAME%
Run Code Online (Sandbox Code Playgroud)
如果我正在添加"执行Windows批处理命令"构建步骤:
echo %JOB_NAME%
Run Code Online (Sandbox Code Playgroud)
有用.如果我使用相同的设置添加脚本编写器脚本作为构建步骤:
println "JOB_NAME: " + System.getenv("JOB_NAME")
Run Code Online (Sandbox Code Playgroud)
我越来越:
JOB_NAME: null
Run Code Online (Sandbox Code Playgroud)
那么如何从groovy脚本中获取注入的环境变量作为构建步骤?
我正在使用jenkins来构建我的git远程项目.问题是日志说"10分钟后超时".接收对象开始,56%的事情发生.
我如何每分钟运行一次在詹金斯创建的工作?我错过了什么吗?
PS:我试图不使用:*/1****

假设我在Jenkins中有一个包含多行shell脚本的Groovy脚本.如何在该脚本中设置和使用变量?正常方式会产生错误:
sh """
foo='bar'
echo $foo
"""
Run Code Online (Sandbox Code Playgroud)
抓住:groovy.lang.MissingPropertyException:没有这样的属性:foo for class:groovy.lang.Binding
我正在研究Jenkins Pipeline:Multibranch的功能.据说最近推出的properties步骤在那里可能有用,但我无法理解它是如何工作的以及它的目的是什么.
它的提示信息似乎不是很清楚:
更新运行此步骤的作业的属性.主要用于多分支工作流,因此Jenkinsfile本身可以编码静态作业配置.
所以我用这个脚本创建了一个新的Pipeline(直接粘贴到Jenkins而不是SCM中):
properties [[$class: 'ParametersDefinitionProperty',
parameterDefinitions: [[$class: 'StringParameterDefinition',
defaultValue: '', description: '', name: 'PARAM1']]
]]
Run Code Online (Sandbox Code Playgroud)
我运行它并没有发生任何事情,工作没有收到一个新的参数,即使它确实我没有得到为什么我可能需要这个.有人可以解释一下吗?
UPDATE1:我尝试将带有属性步骤的虚拟管道放入我的git仓库,然后配置了一个多分支作业.
println 1
properties [[$class: 'ParametersDefinitionProperty', parameterDefinitions: [[$class: 'StringParameterDefinition', defaultValue: 'str1', description: '', name: 'PARAM1']]], [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false]]
println 2
Run Code Online (Sandbox Code Playgroud)
它找到了我的分支,创建了一个工作,但构建失败了:
groovy.lang.MissingPropertyException: No such property: properties for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:62)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:185)
at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:23)
at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17)
at WorkflowScript.run(WorkflowScript:2)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:62)
at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) …Run Code Online (Sandbox Code Playgroud)