随笔分类 - jenkins
摘要:前提nohup命令在命令行正常执行,仅限Jenkins执行脚本中nohup命令或SCM中执行错误或直接退出 1.问题 通过jenkins执行shell脚本时,脚本中是通过nohup java -jar &的方式启动,显示执行成功,但是服务却没启动,脚本如下: nohup /usr/src/java/
阅读全文
摘要:Jenkins备份和恢复 一、插件备份和恢复 1.安装备份插件 重启系统后查看 2.配置周期备份 点击进入,点击Settings Backup only builds marked to keep,如果启用此选项,则仅备份标记为“永久保留此生成”的生成结果/项目。如下图 Backup userCon
阅读全文
摘要:一、jenkins Python API 在线文档:https://python-jenkins.readthedocs.io/en/latest/ 项目地址:https://pypi.org/project/python-jenkins/ 1.注意支持的Python版本 目前只支持到3.6 2.简
阅读全文
摘要:一、部署jenkins master 1.创建Deployment YAML文件 apiVersion: apps/v1 kind: Deployment metadata: name: jenkins namespace: kube-ops spec: replicas: 1 selector:
阅读全文
摘要:一、配置JenkinsMaster挂载Docker docker run --name jenkins -itd --privileged=true -p 8081:8080 -p 50000:50000 -v /etc/localtime:/etc/localtime:ro -v /var/run
阅读全文
摘要:一、docker安装jenkins-master wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo um clean all && yum makecache fast yum install docker -
阅读全文
摘要:一、制品获取 1.安装及配置插件 配置插件(jenkins项目中) 2.选择对应的制品 3.修改jenkins file // 新增以下代码 String artifactUrl = "${env.artifactUrl}" // 下载制品,当前需要制品匿名用户可访问,后续可以通过shell或者an
阅读全文
摘要:一、docker安装nexus wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum clean all && yum makecache fast um install docker systemctl
阅读全文
摘要:由于sonarqube开源版本不支持多分支管理,在扫描所有分支的时候都会指定同一个sonar项目,不便于我们查看 一、下载开源插件 项目地址:https://github.com/mc1arke/sonarqube-community-branch-plugin 下载地址:https://githu
阅读全文
摘要:本章主要通过SonarSQube API在pipeline第一次执行时就指定自定义的质量配置和质量阈 API 文档:http://192.168.1.134:9000/web_api 一、编写sonar API(sonarapi.groovy) 注意替换代码中sonarserve的地址及认证凭据,凭
阅读全文
摘要:一、创建质量配置及关联项目 1.新建一个java代码质量配置 2.为配置添加规则 确认有4条规则了 为项目更换扫描配置 二、创建质量阈关联项目 1.创建质量阈 2.管理项目 3.添加指标 三、SonarSQube集成到pipeline 1.创建API访问凭证 2.创建sharelibrary //封
阅读全文
摘要:一、手动测试 注意此版本已经内置包含Java语言扫描插件,不再需要单独安装 1.clone代码 git clone git@192.168.1.128:root/demo-maven-service.git #demo-maven-service网上都有 2.手动编译项目 cd demo-maven
阅读全文
摘要:一、安装java依赖 要求参考:https://docs.sonarqube.org/latest/requirements/prerequisites-and-overview/ 1.内核参数调整并重启 vim /etc/sysctl.d/sonarqube.conf vm.max_map_cou
阅读全文
摘要:完整jenkinsfile 、sharelibrary 及jenkins配置见最后 一、gitlab push分支自动匹配 1.添加Generic Webhook插件参数,获取本次提交的分支信息 2.jenkinsfile添加判断,并切换到push的分支 3.新建分支并提交测试 二、增加build描
阅读全文
摘要:一、添加测试Maven项目 1.新建一个gitlab项目 2.导入simple-java-maven-app仓库代码(可以去github或者Gittree上都有) 3.配置mvn 国内源 参考:https://developer.aliyun.com/article/1039874 二、创建并配置测
阅读全文
摘要:1.github创建OAuth 2.jenkins安装并配置github认证插件 jenkins配置使用github认证 3.注销重新登录
阅读全文
摘要:1.gitlab创建新应用 2.jenkins安装gitlab插件 3.插件安装完成后全局安全配置中使用并配置gitlab认证 4.注销重新登录后自动使用gitlab当前登录账号登录 jenkins必须和gitlab使用同一浏览器,如果gitlab未登录,则jenkins登录时会自动跳转到gitla
阅读全文
摘要:一、.部署LDAP 这里使用容器部署,手动部署参考:https://www.cnblogs.com/panwenbin-logs/p/16101045.html 1.安装dockerwget -P /etc/yum.repos.d/ https://mirrors.aliyun.com/docker
阅读全文
摘要:一、新建library文件 build.groovy package org.devops // 构建类型 def Build(buildType,buildShell){ // M3 ANT等值都是配置相关全局工具是定义的名称 def buildTools = ["mvn":"M3","ant":
阅读全文
摘要:一、jienkins集成Maven 环境要求 安装jenkins Ant Gradle NodeJS Maven四个插件 1.安装Maven 下载地址:https://maven.apache.org/download.cgi wget --no-check-certificate https://
阅读全文