国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

DevOps之Jenkins 集成 SonarQube 、Gitlab實(shí)現(xiàn)代碼自動(dòng)提交質(zhì)量檢測

這篇具有很好參考價(jià)值的文章主要介紹了DevOps之Jenkins 集成 SonarQube 、Gitlab實(shí)現(xiàn)代碼自動(dòng)提交質(zhì)量檢測。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

實(shí)驗(yàn)中相應(yīng)服務(wù)的安裝步驟略

準(zhǔn)備相關(guān)服務(wù)器,并實(shí)現(xiàn)各個(gè)服務(wù)器的DNS解析

[root@ubuntu2204 ~]#cat /etc/bind/hailin.org.zone

$TTL 1D

@ IN SOA master admin (

1 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

NS master

master A 10.0.0.201

gitlab A 10.0.0.179

jenkins A 10.0.0.171

harbor A 10.0.0.201

sonarqube A 10.0.0.178

安裝 GitLab 和準(zhǔn)備項(xiàng)目

安裝Gitlab ,安裝步驟略,并準(zhǔn)備JAVA項(xiàng)目

#可以從gitee碼云導(dǎo)入項(xiàng)目代碼

https://gitee.com/lbtooth/spring-boot-helloworld.git

?文章來源地址http://www.zghlxwxcb.cn/news/detail-785566.html

#生成如下項(xiàng)目倉庫路徑

http://gitlab.hailin.org/example/spring-boot-helloworld.git

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

安裝 Harbor 并配置 Jenkins 連接Harbor

安裝略

創(chuàng)建名為example的項(xiàng)目

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 服務(wù)器安裝Docker,并配置連接 Harbor

#在jenkins服務(wù)器安裝Docker

[root@jenkins ~]#apt update && apt install docker.io

?

[root@jenkins ~]#vim /etc/docker/daemon.json

{

"registry-mirrors": ["https://si7y70hh.mirror.aliyuncs.com"],

"insecure-registries": ["harbor.hailin.org"]

}

?

[root@jenkins ~]#systemctl restart docker

?

[root@jenkins ~]#docker info

Client:

Context: default

Debug Mode: false

?

Server:

Containers: 0

Running: 0

Paused: 0

Stopped: 0

Images: 3

Server Version: 20.10.21

Storage Driver: overlay2

Backing Filesystem: extfs

Supports d_type: true

Native Overlay Diff: true

userxattr: false

Logging Driver: json-file

Cgroup Driver: systemd

Cgroup Version: 2

Plugins:

Volume: local

Network: bridge host ipvlan macvlan null overlay

Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog

Swarm: inactive

Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc

Default Runtime: runc

Init Binary: docker-init

containerd version:

runc version:

init version:

Security Options:

apparmor

seccomp

Profile: default

cgroupns

Kernel Version: 5.15.0-60-generic

Operating System: Ubuntu 22.04.1 LTS

OSType: linux

Architecture: x86_64

CPUs: 4

Total Memory: 3.799GiB

Name: jenkins

ID: 5SU7:WISV:KNTZ:LJ7Y:VCTM:6K7Y:VX2V:SS4U:SDDE:32SX:OMWT:HUEL

Docker Root Dir: /var/lib/docker

Debug Mode: false

Registry: https://index.docker.io/v1/

Labels:

Experimental: false

Insecure Registries:

harbor.hailin.org

127.0.0.0/8

Registry Mirrors:

https://si7y70hh.mirror.aliyuncs.com

Live Restore Enabled: false

?

#測試登錄harbor,登錄后可在/root/.docker/config.json下存儲(chǔ)登錄信息

[root@jenkins sonarqube-scanner]#docker login harbor.hailin.org

Authenticating with existing credentials...

WARNING! Your password will be stored unencrypted in /root/.docker/config.json.

Configure a credential helper to remove this warning. See

https://docs.docker.com/engine/reference/commandline/login/#credentials-store

?

Login Succeeded

?

[root@jenkins ~]#cat /root/.docker/config.json

{

"auths": {

"10.0.0.201": {

"auth": "YWRtaW46MTIzNDU2"

},

"harbor.hailin.org": {

"auth": "YWRtaW46MTIzNDU2"

}

}

}

安裝Jenkins并安裝相關(guān)插件

安裝Jenkins步驟略

安裝相關(guān)插件和軟件:

#GitLab

#pipeline

#企業(yè)微信通知插件Qy Wechat Notification

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 創(chuàng)建憑據(jù)連接 Harbor

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 安裝Maven 工具

[root@jenkins ~]#apt update;apt install maven -y

?

#優(yōu)化編譯環(huán)境,提升編譯速度

[root@jenkins ~]#vim /etc/maven/settings.xml

.......................

<mirror>

<id>nexus-aliyun</id>

<mirrorOf>*</mirrorOf>

<name>Nexus aliyun</name>

<url>http://maven.aliyun.com/nexus/content/groups/public</url>

</mirror>

</mirrors>

........................

?

#查看Maven信息,記錄執(zhí)行結(jié)果供后續(xù)與Jenkins對接使用

[root@jenkins ~]#mvn -version

Apache Maven 3.6.3

Maven home: /usr/share/maven

Java version: 11.0.17, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64

Default locale: zh_CN, platform encoding: UTF-8

OS name: "linux", version: "5.15.0-60-generic", arch: "amd64", family: "unix"

在Jenkins是配置Maven環(huán)境

Mange Jenkins --- Global Tool configuration -- Maven

根據(jù)上面的 mvn -version 命令結(jié)果,填寫 MAVEN_HOME 的路徑

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 創(chuàng)建連接 GitLab 的憑據(jù)

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins上修改 Docker 的 socket 文件權(quán)限

默認(rèn)Jenkins以Jenkins用戶啟動(dòng),無法訪問Docker,構(gòu)建時(shí)會(huì)提示如下錯(cuò)誤:

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

解決方式

#other用戶無docker任何權(quán)限,所以導(dǎo)致jenkins權(quán)限啟動(dòng)的jenkins服務(wù)無權(quán)限訪問Docker

[root@jenkins ~]#ll /var/run/docker.sock

srw-rw---- 1 root docker 0 2月 1322:15 /var/run/docker.sock=

?

[root@jenkins ~]#id jenkins

用戶id=109(jenkins) 組id=113(jenkins) 組=113(jenkins)

?

#解決方式一,將jenkins賬號添加至docker組

[root@ubuntu2204 ~]#usermod -G docker jenkins

?

[root@ubuntu2204 ~]#id jenkins

用戶id=113(jenkins) 組id=118(jenkins) 組=118(jenkins),119(docker)

?

[root@ubuntu2204 ~]#systemctl restart jenkins

?

#解決方式二,修改jenkins以root權(quán)限啟動(dòng)

[root@jenkins ~]#vim /lib/systemd/system/jenkins.service

.................

#User=jenkins

User=root

#Group=jenkins

Group=root

.................

安裝 SonarQube 并創(chuàng)建用戶和令牌

安裝 Sonarqueb Server步驟略, ,并在 Sonarqube 創(chuàng)建用戶并授權(quán)

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

更新令牌,用于后續(xù)與jenkins對接

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

記錄令牌用于后續(xù)使用,此token 只能復(fù)制一次

squ_791bc70e1771a1d52a10b8b3cbb6d430111e3037

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

給與新建用戶相應(yīng)權(quán)限,這里給用戶分配置"執(zhí)行分析"和"置備項(xiàng)目"權(quán)限

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 SonarQube 添加 Jenkins 的回調(diào)接口

在SonarQube上添加webhook(網(wǎng)絡(luò)調(diào)用),以便于Jenkins通過SonarQube Quality Gate插件調(diào)用其"質(zhì)量閾"信息,決定是否繼續(xù)執(zhí)行下面的構(gòu)建步驟

配置 --- 網(wǎng)絡(luò)調(diào)用 webhook --- 創(chuàng)建

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

輸入名稱和下面 Jenkins的URL地址注意: 密碼防止攻擊使用, 可以隨意輸入注意:此處的密碼沒有復(fù)雜度和長度要求,但建議使用符合安全的密碼

http://jenkins.hailin.org:8080/sonarqube-webhook

?

#使用openssl生成secret,長度3的倍數(shù)

[root@jenkins ~]#openssl rand -base64 21

kzwrC4L+TkUDXSTpBZKzIcRQxn5T

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

Jenkins安裝SonarQube Scanner 插件

Jenkins—系統(tǒng)管理--插件管理

安裝插件 SonarQube Scanner

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

創(chuàng)建Jenkins訪問 Sonarqube的令牌憑據(jù)

用前面小節(jié)生成的Sonarqube令牌,在Jenkins 創(chuàng)建憑據(jù)

secret:squ_791bc70e1771a1d52a10b8b3cbb6d430111e3037

ID:sonarqube-jenkins-token

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 上配置系統(tǒng)的 SonarQube 服務(wù)器信息

Manage Jenkins -- Configure System

注意:Name名稱區(qū)分大小寫

注意:http://sonarqube.hailin.org:9000 地址最后不能加/

否則會(huì)報(bào)錯(cuò)誤 hudson.remoting.ProxyException: net.sf.json.JSONException: Invalid JSON String

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

注意:地址后面別有空格或者/,否則會(huì)導(dǎo)致異常

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

在 Jenkins 上安裝 SonarQube Scanner

[root@jenkins ~]#cd /usr/local/src

?

[root@jenkins ~]#wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip

?

[root@jenkins src]#ls

sonar-scanner-cli-4.8.0.2856-linux.zip

?

[root@jenkins src]#unzip sonar-scanner-cli-4.8.0.2856-linux.zip

?

[root@jenkins src]#ln -s /usr/local/src/sonar-scanner-4.8.0.2856-linux/ /usr/local/sonar-scanner

?

[root@jenkins src]#ln -s /usr/local/sonar-scanner/bin/sonar-scanner /usr/bin/

?

#配置sonar-scanner連接sonarqube服務(wù)器

[root@jenkins src]#vim /usr/local/sonar-scanner/conf/sonar-scanner.properties

?

#指向sonarqube服務(wù)器的地址和端口

sonar.host.url=http://sonarqube.hailin.org:9000

sonar.sourceEncoding=UTF-8

?

[root@jenkins ~]#sonar-scanner -v

INFO: Scanner configuration file: /usr/local/src/sonar-scanner-4.8.0.2856-linux/conf/sonar-scanner.properties

INFO: Project root configuration file: NONE

INFO: SonarScanner 4.8.0.2856

INFO: Java 11.0.17 Eclipse Adoptium (64-bit)

INFO: Linux 5.15.0-60-generic amd64

準(zhǔn)備微信機(jī)器人

注冊企業(yè)微信添加WebHook機(jī)器

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

#復(fù)制創(chuàng)建機(jī)器人生成的webhook地址,用于后續(xù)jenkins的對接

https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3ec91b6e-d5fc-46dd-8464-12fc730b6c9f

準(zhǔn)備Pipeline部署腳本

pipeline {

agent any

tools {

maven 'maven-3.6.3'

}

environment {

codeRepo="http://gitlab.hailin.org/example/spring-boot-helloworld.git"

harborServer='harbor.hailin.org'

projectName='spring-boot-helloworld'

imageUrl="${harborServer}/example/${projectName}"

imageTag="${BUILD_ID}"

}

stages {

stage('Source') {

steps {

git branch: 'main', credentialsId: 'gitlab-zhao', url: "${codeRepo}"

}

}

stage('Build') {

steps {

sh'mvn -B -DskipTests clean package'

}

}

stage('Test') {

steps {

sh'mvn test'

}

}

stage("SonarQube Analysis") {

steps {

withSonarQubeEnv('SonarQube-Server') {

sh'mvn sonar:sonar'

}

}

}

stage("Quality Gate") {

steps {

timeout(time: 30, unit: 'MINUTES') {

waitForQualityGate abortPipeline: true

}

}

}

stage('Build Docker Image') {

steps {

sh'docker image build . -t "${imageUrl}:${imageTag}"'

// input(message: '鏡像已經(jīng)構(gòu)建完成,是否要推送?')

}

}

stage('Push Docker Image') {

steps {

withCredentials([usernamePassword(credentialsId: 'harbor-user-credential', passwordVariable: 'harborPassword', usernameVariable: 'harborUserName')]) {

sh"docker login -u ${env.harborUserName} -p ${env.harborPassword} ${harborServer}"

sh"docker image push ${imageUrl}:${imageTag}"

}

}

}

}

post{

success{

qyWechatNotification failNotify: true, webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3ec91b6e-d5fc-46dd-8464-12fc730b6c9f'

}

failure{

qyWechatNotification failNotify: true, webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=3ec91b6e-d5fc-46dd-8464-12fc730b6c9f'

}

}

}

創(chuàng)建任務(wù)使用 Pipeline Script

根據(jù)前面的相應(yīng)配置創(chuàng)建Pipeline風(fēng)格的任務(wù)

直接使用Pipeline Script

任務(wù)名:pipeline-sonarqube-docker-spring-boot-helloWorld

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

安裝Pipeline Stage View 插件實(shí)現(xiàn)階段化視圖

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

執(zhí)行構(gòu)建驗(yàn)證結(jié)果

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

增加自動(dòng)觸發(fā)功能

Jenkins項(xiàng)目中配置自動(dòng)出發(fā)構(gòu)建功能
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

url地址:http://10.0.0.171:8080/project/pipeline-sonarqube-docker-spring-boot-helloWorld

token:0189b45ee628041d29b2015ccf8fc88d

Gitlab上設(shè)置webhook
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

測試推送事件

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

調(diào)整代碼實(shí)現(xiàn)代碼自動(dòng)上傳執(zhí)行構(gòu)建

#開發(fā)設(shè)備上調(diào)整代碼

[root@SonarQube-Server spring-boot-helloworld]#ls

deploy Jenkinsfile pom.xml sonar-project.properties

Dockerfile LICENSE README.md src

[root@SonarQube-Server spring-boot-helloworld]#vim src/

main/ test/

[root@SonarQube-Server spring-boot-helloworld]#vim sonar-project.properties

[root@SonarQube-Server spring-boot-helloworld]#git commit -m 'modify sonar-project.properties'

位于分支 main

您的分支與上游分支 'origin/main' 一致。

?

尚未暫存以備提交的變更:

(使用 "git add <文件>..." 更新要提交的內(nèi)容)

(使用 "git restore <文件>..." 丟棄工作區(qū)的改動(dòng))

修改: sonar-project.properties

?

修改尚未加入提交(使用 "git add" 和/或 "git commit -a")

[root@SonarQube-Server spring-boot-helloworld]#git add .

[root@SonarQube-Server spring-boot-helloworld]#git commit -m 'modify sonar-project.properties'

[main e9b8191] modify sonar-project.properties

1 file changed, 1 insertion(+), 1 deletion(-)

[root@SonarQube-Server spring-boot-helloworld]#git push

Username for 'http://gitlab.hailin.org': zhao

Password for 'http://zhao@gitlab.hailin.org':

枚舉對象中: 5, 完成.

對象計(jì)數(shù)中: 100% (5/5), 完成.

使用 2 個(gè)線程進(jìn)行壓縮

壓縮對象中: 100% (3/3), 完成.

寫入對象中: 100% (3/3), 321 字節(jié) | 321.00 KiB/s, 完成.

總共 3(差異 2),復(fù)用 0(差異 0),包復(fù)用 0

To http://gitlab.hailin.org/example/spring-boot-helloworld.git

d69bcfc..e9b8191 main -> main

?

gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔
gitlab sonar提交前檢查,linux,devops,jenkins,git,Powered by 金山文檔

到了這里,關(guān)于DevOps之Jenkins 集成 SonarQube 、Gitlab實(shí)現(xiàn)代碼自動(dòng)提交質(zhì)量檢測的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • DevOps極速入門丨Gitlab丨Jenkins丨h(huán)arbor丨CICD丨自動(dòng)化丨運(yùn)維開發(fā)

    DevOps極速入門丨Gitlab丨Jenkins丨h(huán)arbor丨CICD丨自動(dòng)化丨運(yùn)維開發(fā)

    一、DevOps介紹 軟件開發(fā)最開始是由兩個(gè)團(tuán)隊(duì)組成: 開發(fā)計(jì)劃由開發(fā)團(tuán)隊(duì)從頭開始設(shè)計(jì)和整體系統(tǒng)的構(gòu)建。需要系統(tǒng)不停的迭代更新。 運(yùn)維團(tuán)隊(duì)將開發(fā)團(tuán)隊(duì)的Code進(jìn)行測試后部署上線。希望系統(tǒng)穩(wěn)定安全運(yùn)行。 這看似兩個(gè)目標(biāo)不同的團(tuán)隊(duì)需要協(xié)同完成一個(gè)軟件的開發(fā)。 在開發(fā)

    2023年04月18日
    瀏覽(25)
  • sonarqube安裝以及jenkins集成sonarqube

    sonarqube安裝以及jenkins集成sonarqube

    docker 方式安裝是最簡便的,我選擇了這個(gè)安裝方式 1、下載鏡像 2、 創(chuàng)建掛載目錄 3、運(yùn)行容器 4、通過ip 端口訪問:http://ip:9090 1、jenkins下載插件: 進(jìn)入插件管理,搜索sonar,選擇SonarQube Scanner for Jenkins安裝,安裝好后重啟jenkins服務(wù)。 2、sonarqube創(chuàng)建訪問令牌 sonarqube中生成用戶

    2024年02月11日
    瀏覽(27)
  • 【業(yè)務(wù)功能115】微服務(wù)-springcloud-springboot-Kubernetes-k8s集群-Kubesphere實(shí)現(xiàn)DevOps流水線-CI/CD-SonarQube- Jenkins

    【業(yè)務(wù)功能115】微服務(wù)-springcloud-springboot-Kubernetes-k8s集群-Kubesphere實(shí)現(xiàn)DevOps流水線-CI/CD-SonarQube- Jenkins

    dev 怎么開發(fā) ops 怎么運(yùn)維 參考項(xiàng)目鏈接:https://github.com/kubesphere/devops-maven-sample 持續(xù)集成是指軟件個(gè)人的部分向軟件整體部分交付,頻繁進(jìn)行集成以便更快地發(fā)現(xiàn)其中錯(cuò)誤。 CI需要具備這些: 全面的自動(dòng)化測試 這是實(shí)踐持續(xù)集成持續(xù)部署的基礎(chǔ),同時(shí),選擇合適的自動(dòng)化測

    2024年02月04日
    瀏覽(43)
  • DevOps概念及搭建全過程(Jenkins、Harbor、SonarQube、K8s)

    DevOps概念及搭建全過程(Jenkins、Harbor、SonarQube、K8s)

    在如今互聯(lián)網(wǎng)的格局下,搶占市場變得尤為重要,因此敏捷開發(fā)越來越被大家所推崇。于是,慢慢的有了DevOps這個(gè)概念,大致意思是開發(fā)-運(yùn)維一體化。 1.1 基本概念 可以看到上圖是一個(gè)無窮大的一個(gè)符號,Dev對應(yīng)開發(fā),Ops對應(yīng)運(yùn)維。 DevOps的方式可以讓公司能夠更快地應(yīng)對更

    2023年04月17日
    瀏覽(20)
  • Devops系列六(CI篇之jenkinsfile)jenkins將gitlab helm yaml和argocd 串聯(lián),自動(dòng)部署到K8S

    Devops系列六(CI篇之jenkinsfile)jenkins將gitlab helm yaml和argocd 串聯(lián),自動(dòng)部署到K8S

    上文我們說了pipeline,已為本文鋪路不少,接下里就是將之串聯(lián)起來。 先想說下,為什么是jenkinsfile, 因?yàn)閖enkins job還支持pipeline方式。 這種方式,不建議實(shí)際使用,僅限于測試或調(diào)試groovy代碼。 下面貼出來,我們的使用方式。好處是:采用分布式的思想,改動(dòng)git上的jenkinsf

    2024年02月13日
    瀏覽(26)
  • 【Jenkins】持續(xù)集成與交付 (六):Gitlab代碼托管服務(wù)安裝

    ??The Begin??點(diǎn)點(diǎn)關(guān)注,收藏不迷路??

    2024年04月28日
    瀏覽(20)
  • DevOps系列文章 之 SpringBoot整合GitLab-CI實(shí)現(xiàn)持續(xù)集成

    DevOps系列文章 之 SpringBoot整合GitLab-CI實(shí)現(xiàn)持續(xù)集成

    在企業(yè)開發(fā)過程中,我們開發(fā)的功能或者是修復(fù)的BUG都需要部署到服務(wù)器上去,而這部分部署操作又是重復(fù)且繁瑣的工作,GitLab-CI 持續(xù)集成為我們解決了這一痛點(diǎn),將重復(fù)部署的工作自動(dòng)化,大大的節(jié)省了程序員們的寶貴時(shí)間。本文詳細(xì)講述了 GitLab-CI 持續(xù)集成的安裝、部署

    2024年02月13日
    瀏覽(23)
  • Devops系列五(CI篇之pipeline libraray)jenkins將gitlab helm yaml和argocd 串聯(lián),自動(dòng)部署到K8S

    Devops系列五(CI篇之pipeline libraray)jenkins將gitlab helm yaml和argocd 串聯(lián),自動(dòng)部署到K8S

    本文是CI篇的上文,因?yàn)樯弦黄呀?jīng)作了總體設(shè)計(jì),就不再贅述,有需要的請看前文。 我們將演示,使用CI工具–jenkins,怎么和CD工具–argocd串聯(lián),重點(diǎn)是在Jenkins該怎么做。準(zhǔn)備工作和argocd等相關(guān)事項(xiàng),在前文已鋪墊ok。 Jenkins,我們是使用k8s來部署的一個(gè)master-slave結(jié)構(gòu)的集群

    2024年02月13日
    瀏覽(33)
  • Jenkins流水線整合k8s實(shí)現(xiàn)代碼自動(dòng)集成和部署

    Jenkins流水線整合k8s實(shí)現(xiàn)代碼自動(dòng)集成和部署

    1、安裝好k8s集群 這里先要搭建好一個(gè)K8s集群,筆者這邊就采用使用了一個(gè)一主一叢的k8s集群,k8s集群的版本使用1.19.5版本,服務(wù)器的配置:2核4G,操作系統(tǒng): CentOS Linux release 7.9.2009 (Core) 主機(jī)名???????? ip k8smaster 192.168.19.8 k8sworker???????? 192.168.19.9 具體的安裝步驟可以

    2024年02月05日
    瀏覽(52)
  • Jenkins集成SonarQube保姆級教程

    Jenkins集成SonarQube保姆級教程

    Jenkins是自動(dòng)化部署平臺(tái),一個(gè)粗眉大眼的糙漢子! SonarQube是代碼掃描平臺(tái),一個(gè)眉目清秀的小女子! 有一天,上天交給我一個(gè)任務(wù),去撮合撮合他們! 我抬頭看了看天, 不,天花板。 這事兒有戲! 不廢話,開干! jenkins和SonarQube的搭建過程就忽略了,不知道的可以看:

    2024年02月15日
    瀏覽(17)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包