关于jenkins更新后, job description只显示html代码的问题

相信很多人在jenkins 更新到1.553版本(及以上版本)后,发现自己之前在job description写好的html代码,都失效了,现在显示的都是html源码。

我看了1.553版本changelog,发现有以下改动(见标红)

What's new in 1.553 (2014/03/02)

  •     Build history widget only showed the last day of builds.    (Due to JENKINS-20892, even with this fix at most 20 builds are shown.)    (issue 21159)  
  •     Random class loading error mostly known to affect static analysis plugins.    (issue 12124)  
  •     After restarting Jenkins, users known only from changelogs could be shown as First Last _first.last@some.org_, breaking mail delivery.    (issue 16332)  
  •     CLI build -s -v command caused 100% CPU usage on the master.    (issue 20965)  
  •     Slave started from Java Web Start can now install itself as a systemd service.  
  •     Split the “raw HTML” markup formatter out of core into a bundled plugin.  
  •     Do not show Maven modules and matrix configurations in the Copy Job dialog.    (issue 19559)  
  •     Fix autocompletion for items in folders.    (pull request 1124)

 

原来在这次更新后,Configure Global Security页面有个Markup Formatter, 将它由Escaped HTML改成Raw HTML。

 

然后再去修改job description就好了

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在Python中使用jenkinsapi库来批量化创建Jenkins Job非常简单。我们可以使用jenkinsapi的Job类来创建一个新的job,并使用Job类的方法来设置job的参数,例如参数化构建、添加构建步骤等等。 以下是一个示例,演示如何使用jenkinsapi批量创建Jenkins Job: ```python from jenkinsapi.jenkins import Jenkins # 连接到Jenkins服务器 jenkins_url = 'http://localhost:8080' jenkins_username = 'your_username' jenkins_password = 'your_password' server = Jenkins(jenkins_url, username=jenkins_username, password=jenkins_password) # 待创建的job名称列表 job_names = ['job1', 'job2', 'job3'] # 待创建的job配置 job_config = ''' <project> <actions/> <description>My job description</description> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers class="vector"/> <concurrentBuild>false</concurrentBuild> <builders> <hudson.tasks.Shell> <command>echo "Hello World"</command> </hudson.tasks.Shell> </builders> <publishers/> <buildWrappers/> </project> ''' # 批量创建job for job_name in job_names: server.create_job(job_name, job_config) ``` 在这个示例中,我们首先连接到Jenkins服务器,然后定义了待创建的job名称列表和待创建的job配置。然后,我们使用循环来批量创建job,使用create_job方法创建job,并将待创建的job配置作为参数传递给它。 在这个示例中,我们使用的是静态的job配置,但实际上,我们也可以使用Python来动态生成job配置,例如根据参数化构建来生成job配置等等。 总之,jenkinsapi库提供了非常方便的接口来批量化创建Jenkins Job,并且可以根据实际情况进行灵活调整。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值