pipeline+sonar
前提需要在项目根目录下新建sonar-project.properties文件,内容如下:
# must be unique in a given SonarQube instance
sonar.projectKey=cynomys:0.0.
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=cynomys
sonar.projectVersion=0.0. # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.
sonar.exclusions=**/test/**,**/target/** sonar.java.source=1.8
sonar.java.target=1.8 # Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
# 项目的class文件地址
sonar.java.binaries=/root/.jenkins/workspace/e-content/e-content-controller/target/classes
pipeline脚本
node {
maven_home='/usr/local/apache-maven-3.5.4'
stage('Pull Code'){
git branch: 'master', credentialsId: 'gitlab_account', url: 'http://******.git'
}
stage('Code Check') {
echo "代码检查!"
}
stage('SonarQube analysis') {
// SonarQubeServer为系统配置的SonarQube servers的名称
withSonarQubeEnv('SonarQubeServer') {
sh '/usr/local/sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner'
}
}
stage('Unit Test') {
echo "单元测试 !"
}
stage('Compile') {
echo '编译开始'
// 暂时打包报错
sh "'$maven_home'/bin/mvn install"
}
stage('Build Images') {
echo '敬请期待!'
}
stage('Backup'){
echo '旧版本软件包已经备份'
}
stage('Delete Old war'){
echo "删除老的包"
}
stage('Deploy'){
echo '部署!'
sh 'echo hello'
// sh 'scp /root/.jenkins/workspace/e-trade/e-trade-mapper/target/e-trade-mapper-1.0-SNAPSHOT.jar root@10.132.131.51:/home/guchen_test'
}
stage('Integration Testing') {
echo "敬请期待!"
}
stage('UI Automated Testing') {
echo "敬请期待!"
}
stage('Send Testing Report') {
echo "敬请期待!"
}
}
pipeline+sonar的更多相关文章
- Jenkins Pipeline+sonar构建质量平台
前提: Jenkins JDK 目录: 1.安装sonar插件:SonarQube Scanner for Jenkins 2.安装SonarQube 3.安装sonar-scanner ++++++ ...
- pipeline配置sonar和自动化
1.sonar配置webhooks, 2.url填写jenkins的地址:http://jenkinsurl/sonarqube-webhook/ 3.前提:jenkins配置好sonar的scann ...
- jenkins2 pipeline 语法快速参考
jenkins2 pipeline中常用的语法快速参考. 文章来自:http://www.ciandcd.com文中的代码来自可以从github下载: https://github.com/ciand ...
- 在Jenkins中使用sonar进行静态代码检查
要解决的问题 jenkins自动构建完成后,希望能通过sonar静态代码检查生成一份报告,给与开发人员对当前代码的做一个质量评估和修改意见 1.安装并配置sonar服务器 懒得说,跟着官方文档走就行, ...
- [持续交付实践] pipeline使用:项目样例
项目说明 本文将以一个微服务项目的具体pipeline样例进行脚本编写说明.一条完整的pipeline交付流水线通常会包括代码获取.单元测试.静态检查.打包部署.接口层测试.UI层测试.性能专项测试( ...
- Jenkins Jfrog Artifactory 以及docker下的pipeline 容器编排实践
1. 测试环境情况: Docker主机 10.24.101.99 JFrog Artifactory 主机 (admin password) jenkinx github原始地址:https://gi ...
- jenkins pipeline 部署
一.git 版本控制结合jenkins 发布 sh-4.2$ git branch sh-4.2$ git chekout master sh-4.2$ git tag v1.1 sh-4.2$ gi ...
- Jenkins + Pipeline 构建流水线发布
Jenkins + Pipeline 构建流水线发布 利用Jenkins的Pipeline配置发布流水线 参考: https://jenkins.io/doc/pipeline/tour/depl ...
- 看到了一个pipeline例子,
pipeline { agent any options { timestamps() } parameters { string(name: 'GIT_BRANCH', defaultValue: ...
随机推荐
- “microsoft ace oledb 12.0 未注册”疑云
1. 有人说: 2015也是要安装32位的AccessDataengine,anycpu选32位优先才行,不然就是Microsoft.ACE.OLEDB.12.0未注册. hanstom,一个老调重弹 ...
- nginx基本配置与参数说明-【转】
#运行用户 user nobody; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 #error_log logs/error.log; ...
- bps、bit、byte的区别
bps是速度单位,bit是大小单位,byte也是大小单位1bps=1bit每秒, 8bit=1byte 1 Byte = 8 bits1 KB = 1024 Bytes1 MB = 10 ...
- Spring DI的配置使用
1.1.1 依赖和依赖注入Spring IOC容器的依赖有两层含义:Bean依赖容器和容器注入Bean的依赖资源:a.Bean依赖容器:也就是说Bean要依赖于容器,这里的依赖是指容器负责创建Bean ...
- 如何查看Mysql服务器上的版本
select version(); 1,mysql 的守护进程是mysqld [root@localhost ~]# service mysqld start 启动 MySQL: [确定] 你可以看看 ...
- Vuex笔记/axios笔记
每一个 Vuex 应用的核心就是 store(仓库).“store”基本上就是一个容器,它包含着你的应用中大部分的状态 (state).Vuex 和单纯的全局对象有以下两点不同: Vuex 的状态存储 ...
- 由Strurts2漏洞引开谈谈web代码安全问题
漏洞与补丁齐飞,蓝屏共死机一色. 最近struts2的安全漏洞影响面甚广,此后门为可以在url中直接远程调用脚本的漏洞和一个重定向漏洞.大家可以在s2-016远程执行脚本漏洞和s2-017重定向开放漏 ...
- 微信OAuth2.0网页授权php示例
1.配置授权回调页面域名,如 www.aaa.com 2.模拟公众号的第三方网页,fn_system.php <?php if(empty($_SESSION['user'])){ header ...
- mysql5.6配置semi_sync
测试环境:Red Hat Enterprise Linux Server release 6.3 (Santiago)Server version: 5.6.22-log MySQL Communit ...
- LoadRunner11学习记录五 -- 错误提示分析
LoadRunner测试结果具体分析: 一.错误提示分析 分析实例: 1.Error: Failed to connect to server “172.17.7.230″: [10060] Con ...