Using CSS in html published on Jenkins build

閲覧: 313 回
最初の未読メッセージにスキップ

Hung L.

未読、
2017/08/29 10:32:012017/08/29
To: Jenkins Users
Hi,
I have a question on using CSS styles in html file that is being published on Jenkins build.  After each build, we publish a summary html file on Jenkins dashboard using the "Publish HTML Reports" plugin.  Our HTML has reference to some CSS.  Right now, we're using inline CSS but Jenkins does not allow inline CSS by default, see https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy.  I am able to override the default settings to allow the inline CSS, but I'm not sure if that's the right thing to do.  

Right now, I'm looking for an alternative.  I know Jenkins has some built-in CSS files which I hope to make a reference from our html.  However, I don't know how to do it as they are referenced by a random link (I think), for example:
<link rel="stylesheet" href="/static/xxxxxx/css/layout-common.css" type="text/css" />  where xxxxxx is random.  

An another alternative is to publish my own CSS file somewhere on Jenkins server and make a reference to that.  However, I'm not sure how to do that.

Any suggestions?  Thanks.

Reinhold Fuereder

未読、
2017/08/29 10:42:572017/08/29
To: jenkins...@googlegroups.com

Hi Hung,

 

You can use so-called Jenkins User Content: see https://wiki.jenkins-ci.org/display/JENKINS/User+Content for details.

 

E.g. I am using that for web resources in HTML Emails sent from Jenkins: I am provisioning/deploying "file.png" via Ansible to "<path to jenkins home folder, typically '/var/lib/jenkins'>/userContent". It is then accessible via: https://<jenkins URL>/userContent/diff.png

 

HTH Reinhold

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2b892ec2-9f0f-4866-855c-d6fc546a8ad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hung L.

未読、
2017/08/29 11:44:532017/08/29
To: Jenkins Users、r.fue...@xortex.com
Thanks for your reply.  I have problems accessing this repository through git.  When I clone it, it says I'm cloning an empty repository although I do see a readme.txt in it.  Any ideas?
全員に返信
投稿者に返信
転送
新着メール 0 件