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: ...
随机推荐
- GeoServer之sqlserver插件使用
GeoServer之sqlserver插件使用 安装好sqlserver插件后,点击出现的第一个选项,开始创建wms服务. 输入参数: 工作区:为geoserver中创建的工作区 数据源名称:自定义 ...
- sortingOrder,sortingLayer
sortingOrder 是sortingLayer内的分级 sortingLayer是抽象的分层,用于决定2D物体绘制的先后顺序. 2D物体分两类:sprite和UI. sprite虽是2D,却可以 ...
- Lambda表达式在Android开发中的应用
在Java8中拥有Lambda表达式的新功能,如果现在Android项目中使用,首先,必须在项目中的build.gradle配置一下 使用Lambda表达式必须满足只有一个待实现方法这个规则,否则就不 ...
- Hash表算法详解
Hash表定义 散列表(Hash table,也叫哈希表),是根据关键字值(Key value)直接进行访问的数据结构.也就是说,它通过把关键字(关键字通过Hash算法生成)映射到表中一个位置来访问记 ...
- 封装baseControl
package com.huawei.base; import java.io.IOException;import java.io.OutputStream;import java.io.Print ...
- nodejs开发工具
我选择的是Hbuilder作为node项目的开发工具. 先在Hbuilder 里面安装nodeEclipse插件,然后重启工具. 点击添加项目,选择其他选项,出现下图选项,然后选择圈住的选项点击下 ...
- NormalMap & CubeMap
[NormalMap & CubeMap] 有时候我们需要CubeMap的环境反射也需要有凹凸信息,此时需要装将NormalMap与CubeMap结合. 因为要使用NormalMap,使用Pr ...
- glTexGen
[glTexGen] Rather than having to explicitly provide a texture coordinate for each vertex, we can use ...
- bootstrap-select用法详解
首先需要引入 <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href=&quo ...
- cdoj915-方老师的分身 II (长度不小于k的最短路)【spfa】
http://acm.uestc.edu.cn/#/problem/show/915 方老师的分身 II Time Limit: 10000/5000MS (Java/Others) Memo ...