1、Jenkins环境搭建
#:wget https://pkg.jenkins.io/redhat/jenkins-2.230-1.1.noarch.rpm //下载rpm,或者上官网找最新版本下载:https://pkg.jenkins.io/
#:rpm -ivh jenkins-2.230-1.1.noarch.rpm
#:vim /etc/sysconfig/jenkins //修改默认端口,安全期限
#修改监听端口
JENKINS_PORT="50013"
#:vim /etc/sysconfig/jenkins //修改权限问题
#修改配置
$JENKINS_USER="root"
#:chown -R root:root /var/lib/jenkins
#:chown -R root:root /var/cache/jenkins
#:chown -R root:root /var/log/jenkins
#:ln -s /usr/local/java/jdk1.8.0_171/bin/java /usr/bin/java
#:service jenkins restart
#:ps -ef | grep jenkins
#:systemctl start jenkins
后序步骤:
安装git \maven \sonarqube scanner,并进行配置
再进行jenkins全局参数配置
2、jenkins初始化后要安装的插件如下:
-------------------------------------------------
Maven Integration
gitlab
gitlab hook
Pipeline RemoteLoader plugin
Git Parameter Plug-In
SonarQube Scanner
Pipeline Maven Integration
pipeline-utility-steps
Pipeline: Groovy HTTP
HTTP Request
Sonar Quality Gates
Quality Gates
requests-plugin
docker-build-step
SCM Filter Jervis
File System SCM
Publish over SSH
nodejs
Publish over SSH
docker-build-step
Docker Compose Build Step
docker
---------------------------------
3、node创建及配置
1、安装插件Publish Over SSH并配置如下
2、jdk的环境也要配置
3、NodeJS配置
4、sonarqube scanner安装
#:wget https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/3.0.3.778/sonar-scanner-cli-3.0.3.778.zip
#:unzip sonar-scanner-cli-3.0.3.778.zip
#:cd sonar-scanner-cli-3.0.3.778/conf/
#:vim sonar-scanner.properties
5、sonarscanner和maven配置
6、sonarqube参数配置
7、gitlab hook勾子的配置