跳至主要内容

博文

目前显示的是 2020的博文

解决 Jenkins 中无法展示 HTML 样式的问题

 原文链接 问题描述 对于测试报告来说,除了内容的简洁精炼,样式的美观也很重要。常用的做法是,采用 HTML 格式的文档,并搭配 CSS 和 JS ,实现自定义的样式和动画效果(例如展开、折叠等)。 在 Jenkins 中要展示 HTML 文档,通常采用的方式有两种: 使用 HTML Publisher Plugin ; 使用 Files to archive 功能,在 Build Artifacts 中显示 HTML 文档链接。 第一种方式配合插件,可以通过图形化操作实现简易配置,并且展示效果也不错;而第二种方式的优势在于使用 Jenkins 自带的功能,不依赖插件也能实现基本的需求。 然而,不管是采用哪种方式,都有可能会遇到一种情况,就是展示出来的 HTML 报告样式全无。在浏览器的 Network 中查看资源加载情况,会发现相关的 CSS 和 JS 都没法正常加载。 1 2 3 4 Refused to load the stylesheet 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' because it violates the following Content Security Policy directive: "style-src 'self'". Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-0EZqoz+oBhx7gF4nvY2bSqoGyy4zLjNF+SDQXGp/ZrY='), or a nonce ('nonce-...') is required to enable inline execution. Blocked script execution in 'http://10.13.0.146:8888...

How change default SVN username and password to commit changes?

 原文链接 第一种方法: To use alternate credentials for a single operation, use the  --username  and  --password  switches for  svn . To clear previously-saved credentials, delete  ~/.subversion/auth . You'll be prompted for credentials the next time they're needed. These settings are saved in the user's home directory, so if you're using a shared account on "this laptop", be careful - if you allow the client to save your credentials, someone can impersonate you. The first option I provided is the better way to go in this case. At least until you stop using shared accounts on computers, which you shouldn't be doing. To change credentials you need to do: rm -rf ~/.subversion/auth svn up  ( it'll ask you for new username & password ) 第二种方法: since your local username on your laptop frequently does not match the server's username, you can set this in the ~/.subversion/servers file Add the server to the [groups] section with a name, then add a section with...

微信小程序集成jenkins自动打码

 原文链接 背景 小程序编译、打包、预览均需要依赖开发者工具进行,且团队中成员均需要开通代码仓库权限,比较繁琐。故在官方论坛中找到以下CI集成插件,并结合jenkins做成了自动打码,详细介绍如下 一、miniprogram-ci工具 概述 miniprogram-ci 是从微信开发者工具中抽离的关于小程序/小游戏项目代码的编译模块。开发者可不打开小程序开发者工具,独立使用 miniprogram-ci 进行小程序代码的上传、预览等操作。 详细介绍见官网 https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html 二、工具准备内容 密钥 IP白名单配置 appid 一个存放打包后二维码的目录 三、注意事项 密钥、存放二维码的目录不能和小程序代码同级,需要分开(不然小程序目录大小会超出限制) 需要提前安装nodejs(目前我安装的版本是v10.8.0,其他版本自行测试) ip白名单可能过期,具体在工具运行时会提示,按照提示,在小程序后台更新一下ip白名单即可 四、开始 安装miniprogram-ci npm install -g miniprogram-ci 运行CI命令 miniprogram-ci \ preview \ --pp ./demo-proj/ \ --pkp ./private.YOUR_APPID.key \ --appid YOUR_APPID \ --uv PACKAGE_VERSION \ -r 1 \ --enable-es6 true \ --proxy YOUR_PROXY \ --qrcode-format image \ --qrcode-output-dest '/tmp/x.jpg' 出现以下提示,则证明成功 如报错,按报错提示解决即可 五、集成到jenkins jenkins安装过程忽略,默认均安装成功 1、所需插件 OWASP Markup Formatter Git set build description( 转载注: 新版本为 Build Name and Description Setter ) Text Finders Git Parameter Plug-In 2、更换jenkins...

Gerrit资料

  Gerrit使用总结 Gerrit常见命令及最佳实践 sourceTree+gerrit管理代码 Push to gerrit using SourceTree I believe the answer provided by atlassian says to change the name of the remote branch when you see the Push dialog. Open the push dialog Click on the remote branch name under the "Remote Branch" column (mine is presently 'master') Type in the new remo branch name - which would be 'refs/for/master' for me Click OK. This appears to have properly pushed the commits into Gerrit for me. The problem I have now is that the 'refs/for/master' value doesn't persist. Now to figure that out. I will update this post once I've figured that out. Hope this helps even tho it's late to the game. Update: it turns out that you need to add a push entry under remote origin in the .git/config. You should do this via the git config command (tho i did edit the file manually i'm sure that's bad practice). the push line i wrote is: push = refs/heads/*:refs/for/* for clarity h...