Jenkins插件学习之compress-build-log-plugin
compress-build-log-plugin 使用
Jenkins plugin to compress the log file after build completion
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384这个插件是用来压缩构建log的.会在builds目录下面把 原来的 log 文本文件压缩为 log.gz 文件. 例如下面的, 其中第1个构建 文本文件名称 还是叫 log, 但是第2个构建就是用这个插件压缩了,名称为log.gz了.$ tree work/jobs work/jobs└── test_pipeline ├── builds │ ├── 1 │ │ ├── build.xml │ │ ├── log │ │ ├── l ...
Jenkins插件学习之build-user-vars-plugin
插件源码地址 https://github.com/jenkinsci/build-user-vars-plugin
问题背景123之前有写过 一篇 https://blog.csdn.net/mmh19891113/article/details/105747729 一直在使用 BuildUserVars 和 BuildNameDescriptionSetter 这2个插件,当然是在自由风格的job中使用的,但是当我们转到 流水线 风格的job时候 发现 build-user-vars-plugin 不太好用了。
解决问题1234567891011121314151617通过翻阅资料,谷歌查询。我们从这里 https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/ 查到一个关于 wrap的用法。wrap: General Build WrapperThis is a special step that allows to call build wrappers (also called "Environ ...
Jenkins插件学习之build-name-setter-plugin
今天介绍一个插件 build-name-setter-plugin美化 构建 name 和 description 的默认的 样式 只显示 成 #1, #2, #3 这样的。 我们可以通过 jenkin上的变量 等值 设置到 构建名称上,
例如把参数设置上去,触发人设置上去,能一眼看出来这次构建是干什么的,用了哪些参数等等。
例如现这样,设置了这个job 在哪个 节点上执行的,构建类型,新片平台,分支名,触发人 等信息。
12#13034[another-docker-05][TriggerDailyBuild][sm8550][sm8550_s_master][mage]
用法自由风格中的使用123456构建环境 下面 勾选 Set Build Name and Description 那个就行。然后填上Build Name处填写 ${GERRIT_CHANGE_SUBJECT}"Build Description 处填写 Executed @ ${NODE_NAME}
这个支持的 参数 挺多的, 例如 环境变量的, j ...
Jenkins插件学习之build-history-metrics-plugin
今天介绍一个插件 build-history-metrics-plugin
Jenkins Build History Metrics PluginDisplay job parameter summary on main job page 在job主页上显示 metrics (翻译过来就是 衡量指标; 韵律学; 量度; 指标)
插件的源码地址: https://github.com/jenkinsci/build-history-metrics-plugin.git
插件wiki地址: https://plugins.jenkins.io/build-history-metrics-plugin/
当前支持的三种度量
Mean time to Failure 平均失败时间
Mean time to Recovery 平均复原时间
Build Time Standard Deviation 构建时间的标准差结果就类似下面这个图片
没什么用的一个插件
Jenkins插件学习之active-choices-plugin
今天介绍一个插件 active-choices-plugin级联参数 选择一个参数, 可以让另外一个参数选项 动态变化,
The plug-in includes the following parameter types:
Active Choices Parameter
Active Choices Reactive Parameter
Active Choices Reactive Reference Parameter
我自己魔改的 1, 仿照 extensible-choice-parameter-plugin 插件修改的。提供了几个 ChoiceListProvider 类型的class供选择。
本来是3个类型的 Parameter 的。现在改成一个,其他的都用 provicer 提供
2. 支持流水线:activeChoiceProvider, cascadeChoiceProvider, referenceChoiceProvider
3. 参数名改掉了, Active Choices Parameter 保持。
...
Jenkins插件学习之active_directory_plugin之DNS查询
jenkins的active directory plugin之DNS查询为什么在jenkins上Active Directory 插件那里的Domain Name只配置个 company.com 就行了呢?
DNS查询,通过udp通信查询到公司的所有的DC(domain controller)地址,然后进行AD域认证。其实是通过一个查询获取到了具体的dns服务器的IP,返回的是好几个ip,这个根据公司配置了几个DC(domain controller)服务器有关系的。
DNS报文格式,不论是请求报文,还是DNS服务器返回的应答报文,都使用统一的格式。
12345678910111213141516DNS format+--+--+--+--+--+--+--+| Header |+--+--+--+--+--+--+--+| Question |+--+--+--+--+--+--+--+| Answer |+--+--+--+--+--+--+--+| Authority |+--+--+--+- ...
Jenkins插件学习之active_directory_plugin之登录慢的问题
jenkins的active directory plugin 插件发现公司的jenkins在第一次登录的时候非常的慢,如果 去掉active directory plugin 插件的认证 第一次打开就很快,所以这里准备通过源码来分析 一些看看是哪里慢, 是哪个方法慢。
废话不多说,直接github上 克隆源码,然后编译调试运行。
123456789fork一个下载代码git clone https://github.com/mamh-java/active-directory-plugin.git编译调试运行代码mvn -DskipTests=true -Djava.util.logging.config.file=logging.properties package hpi:run一般的基于master分支先调试, 或者 需要特定版本的,看你插件的哪个版本号,然后代码仓库下面检出到对应的标签上。
12345678910111213141516主要看这个 public class ActiveDirectoryUnixAuthenticationProvider extends ...
Gerrit源码分析之ls-user-refs命令的实现
今天我们讲讲gerrit 的 ssh 命令的 ls-user-refs命令的实现的实现,采用的代码是gerrit的 stable2.15 分支的,因为我们使用的版本是 2.15.1的。
LsUserRefs 类详解12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970这个命令在 com.google.gerrit.sshd.commands.LsUserRefs 类中,@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)@CommandMetaData( name = "ls-user-refs", description = "List refs visible to a specific user", runsAt = MASTER_OR_SLAVE)publ ...
Gerrit学习之JS-Plugin-Development
gerrit 使用 JS 插件gerrit JS 插件Gerrit Code Review 支持用于 JavaScript 插件的 API,以与 Web UI 和服务器进程进行交互。
Plugin loading and initializationJavaScript 是使用标准的 ``` <script src='??'> ``` HTML 标签加载的。
插件应该通过 传递给 Gerrit.install() 的匿名函数中定义它们的代码来保护全局命名空间。
该插件将被传递一个描述其在 Gerrit 注册的对象。
该插件 pluginname.js,可以是独立文件,也可以是jar 中的静态资产作为Web UI 插件。
pluginname.js 包含对 Gerrit.install() 的调用。 每个文件应该只有一个 Gerrit.install() 调用。
Gerrit Web 应用程序导入 pluginname.js。
对于独立插件,入口点文件是位于 gerrit-site/plugins 文件夹中的 pluginname.js 文件,其中 pl ...
Gerrit学习之gerrit源码学习之提交页面
gerrit-3.4.3 的编译
对于 一个 提交 页面, 整个 页面是 在 mainContent 下面的
12345678910<div id="mainContent" class="container"> 对于 一个 提交 页面, 整个 页面是 在 mainContent 下面的 1. <section class="changeInfoSection"> 最上部分的 changeInfo 块。 2. <paper-tabs id="primaryTabs" role="tablist" tabindex="0" dir="null"> files/comments/findings 这个 tab 行 3. <section class="patchInfo"> 4. <paper-tabs id="secondaryTa ...
Gerrit学习之gerrit配置js插件
theme 主题插件,更改颜色主题在 服务器 上的 plugins 子目录 新建一个 theme.js 文件
12345678910111213141516171819202122232425// gerrit https://gerrit.googlesource.com/gerrit/+/master/polygerrit-ui/app/samples/theme-plugin.js// https://gerrit-review.googlesource.com/Documentation/pg-plugin-dev.html// https://groups.google.com/g/repo-discuss/c/tgvmGhfFcgU// https://stackoverflow.com/questions/19307964/customize-gerrit-home-pagelogo-and-colorGerrit.install(plugin => { const styleElement = document.createElement( ...
JPA学习之JSP对象持久化API总结
JPA 学习笔记
##jpa是什么
12345Java Persistence API:用于对象持久化的 APIJava EE 5.0 平台标准的 ORM 规范,使得应用程序以统一的方式访问持久层
JPA和Hibernate的关系12345678910111213JPA 是 hibernate 的一个抽象(就像JDBC和JDBC驱动的关系):JPA 是规范:JPA 本质上就是一种 ORM 规范,不是ORM 框架 —— 因为 JPA 并未提供 ORM 实现,它只是制订了一些规范,提供了一些编程的 API 接口,但具体实现则由 ORM 厂商提供实现Hibernate 是实现:Hibernate 除了作为 ORM 框架之外,它也是一种 JPA 实现从功能上来说, JPA 是 Hibernate 功能的一个子集
jpa的hello world程序首先弄个jpa的helloworld程序
persistence.xml 文件。这个要放到resources目录下面的META-INF目录下面.JPA规范要求在类路径的META-INF目录下面放persistence.xml,文件名称是固定的。
...