Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cicdhtj
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xujian
cicdhtj
Commits
03c2047b
Commit
03c2047b
authored
Sep 25, 2024
by
xujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加锁
parent
0e33ded8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
49 deletions
+55
-49
Jenkinsfile
+25
-20
base-charts/values.yaml
+1
-1
core-charts/values.yaml
+8
-7
project.yaml
+21
-21
No files found.
Jenkinsfile
View file @
03c2047b
@Library
(
"cicdhtj@master"
)
_
def
repos
=
[
// [dir: 'BASE', type: 'mvn', isUpdate: true, url: '
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-basic
.git'],
// [dir: 'CORE', type: 'mvn', isUpdate: true, url: '
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcodecore
.git'],
// [dir: 'HTJ', type: 'mvn', isUpdate: true, url: '
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcode-htj
.git'],
// [dir: 'WEB', type: 'node', isUpdate: true, url: '
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcode-htj-vue
.git']
// [dir: 'BASE', type: 'mvn', isUpdate: true, url: '.git'],
// [dir: 'CORE', type: 'mvn', isUpdate: true, url: '.git'],
// [dir: 'HTJ', type: 'mvn', isUpdate: true, url: '.git'],
// [dir: 'WEB', type: 'node', isUpdate: true, url: '.git']
]
def
modules
=
[
]
def
web
=
[
]
def
push_path
=
"192.168.31.201/develop"
pipeline
{
...
...
@@ -80,14 +82,14 @@ pipeline {
}
}
if
(
smallfile
.
web
.
module
)
{
// modules
.add([
//
dir: smallfile.web.name,
//
name: module.name,
//
version: moudle.version,
//
isUpdate: moudle.isUpdate,
//
isEncryption: moudle.isEncryption,
//
path: moudle.path
//
])
web
.
add
([
dir:
smallfile
.
web
.
name
,
name:
module
.
name
,
version:
moudle
.
version
,
isUpdate:
moudle
.
isUpdate
,
isEncryption:
moudle
.
isEncryption
,
path:
moudle
.
path
])
}
}
...
...
@@ -110,7 +112,7 @@ pipeline {
script
{
for
(
repo
in
repos
)
{
dir
(
repo
.
dir
)
{
if
(
repo
.
isUpdate
&&
repo
.
type
==
'mvn'
)
sh
"mvn -Dmaven.test.failure.ignore=true -s /var/lib/jenkins/settings-itimQR.xml
clean
package install"
if
(
repo
.
isUpdate
&&
repo
.
type
==
'mvn'
)
sh
"mvn -Dmaven.test.failure.ignore=true -s /var/lib/jenkins/settings-itimQR.xml package install"
else
if
(
repo
.
isUpdate
&&
repo
.
type
==
'node'
)
sh
"npm install --registry=https://registry.npm.taobao.org && npm run build:prod-htj"
}
...
...
@@ -124,7 +126,8 @@ pipeline {
sh
"export DOCKER_HOST=192.168.31.250"
for
(
module
in
modules
)
{
if
(
module
.
isUpdate
&&
module
.
isEncryption
){
sh
"cd ${module.dir}/${module.path} && mvn classfinal:classFinal"
sh
"cd ${module.dir}/${module.path} && mvn -Dmaven.test.failure.ignore=true -s /var/lib/jenkins/settings-itimQR.xml package install"
sh
"cd ${module.dir}/${module.path} && mvn -Dmaven.test.failure.ignore=true -s /var/lib/jenkins/settings-itimQR.xml classfinal:classFinal"
sh
"docker build -f Docker/encryption/Dockerfile -t ${push_path}/${module.name}:${module.version} --build-arg FILE_NAME=${module.dir}/${module.path}/target/*-encrypted.jar ${workspace}"
sh
"echo Qrcode@2022 | docker login https://192.168.31.201 --username admin --password-stdin"
sh
"docker push ${push_path}/${module.name}:${module.version}"
...
...
@@ -132,6 +135,7 @@ pipeline {
}
if
(
module
.
isUpdate
&&
!
module
.
isEncryption
)
{
sh
"cd ${module.dir}/${module.path} && mvn -Dmaven.test.failure.ignore=true -s /var/lib/jenkins/settings-itimQR.xml package install"
sh
"docker build -f Docker/noencryption/Dockerfile -t ${push_path}/${module.name}:${module.version} --build-arg FILE_NAME=${module.dir}/${module.path}/target/*.jar ${workspace}"
sh
"echo Qrcode@2022 | docker login https://192.168.31.201 --username admin --password-stdin"
sh
"docker push ${push_path}/${module.name}:${module.version}"
...
...
@@ -152,11 +156,12 @@ pipeline {
steps
{
withCredentials
([
file
(
credentialsId:
'00789dc5-a86e-427d-9a57-f5d02a52cb6e'
,
variable:
'KUBECONFIG_FILE'
)])
{
script
{
for
(
repo
in
repos
){
if
(
repo
.
isUpdate
&&
repo
.
dir
==
"BASE"
)
sh
"KUBECONFIG=\$KUBECONFIG_FILE helm install base base-charts/ -n base -f project.yaml"
if
(
repo
.
isUpdate
&&
repo
.
dir
==
"CORE"
)
sh
"KUBECONFIG=\$KUBECONFIG_FILE helm install core core-charts/ -n core -f project.yaml"
if
(
repo
.
isUpdate
&&
repo
.
dir
==
"HTJ"
)
sh
"KUBECONFIG=\$KUBECONFIG_FILE helm install htj htj-charts/ -n htj -f project.yaml"
}
echo
"xxxx"
// for( repo in repos){
// if(repo.isUpdate && repo.dir == "BASE") sh "KUBECONFIG=\$KUBECONFIG_FILE helm upgrade base base-charts/ -n base -f project.yaml"
// if(repo.isUpdate && repo.dir == "CORE") sh "KUBECONFIG=\$KUBECONFIG_FILE helm upgrade core core-charts/ -n core -f project.yaml"
// if(repo.isUpdate && repo.dir == "HTJ") sh "KUBECONFIG=\$KUBECONFIG_FILE helm upgrade htj htj-charts/ -n htj -f project.yaml"
// }
}
}
}
...
...
base-charts/values.yaml
View file @
03c2047b
## 基础模块
version
:
v24.09.20
# 如果项目base.isUpdate: true / core.isUpdate: true / htj.isUpdate: true 构建整个项目
# 如果
项目为true并且
模块为true指定项目打包
# 如果模块为true指定项目打包
registry
:
192.168.31.201/develop
base
:
name
:
"
BASE"
...
...
core-charts/values.yaml
View file @
03c2047b
...
...
@@ -9,35 +9,35 @@ core:
type
:
"
mvn"
url
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcodecore.git"
namespace
:
qrcode-xxx
isUpdate
:
tru
e
isUpdate
:
fals
e
module
:
-
name
:
factory-tobacco-qrcode-modules-data-migrate
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-data-migrate
-
name
:
factory-tobacco-qrcode-modules-device
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-device
-
name
:
factory-tobacco-qrcode-modules-monitor-alarm
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-monitor-alarm
-
name
:
factory-tobacco-qrcode-modules-stmb-register
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-stmb-register
-
name
:
factory-tobacco-qrcode-modules-system
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-system
-
name
:
factory-tobacco-qrcode-modules-timesync
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-timesync
\ No newline at end of file
project.yaml
View file @
03c2047b
...
...
@@ -3,14 +3,14 @@ PARAMS: "--spring.cloud.nacos.discovery.namespace=qrcode-pcb --spring.cloud.nac
registry
:
192.168.31.201/develop
## 基础模块
version
:
v24.09.20
# 如果项目base.isUpdate:
true / core.isUpdate: true / htj.isUpdate: tru
e 构建整个项目
# 如果
项目为true并且
模块为true指定项目打包
# 如果项目base.isUpdate:
false / core.isUpdate: false / htj.isUpdate: fals
e 构建整个项目
# 如果模块为true指定项目打包
base
:
name
:
"
BASE"
type
:
"
mvn"
url
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-basic.git"
namespace
:
qrcode-xxx
isUpdate
:
tru
e
isUpdate
:
fals
e
module
:
-
name
:
factory-tobacco-qrcode-auth
version
:
v24.09.20
...
...
@@ -29,7 +29,7 @@ base:
path
:
factory-tobacco-qrcode-modules-file
-
name
:
factory-tobacco-qrcode-modules-gen
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-gen
...
...
@@ -38,36 +38,36 @@ core:
type
:
"
mvn"
url
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcodecore.git"
namespace
:
qrcode-xxx
isUpdate
:
tru
e
isUpdate
:
fals
e
module
:
-
name
:
factory-tobacco-qrcode-modules-data-migrate
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-data-migrate
-
name
:
factory-tobacco-qrcode-modules-device
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-device
-
name
:
factory-tobacco-qrcode-modules-monitor-alarm
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-monitor-alarm
-
name
:
factory-tobacco-qrcode-modules-stmb-register
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-stmb-register
-
name
:
factory-tobacco-qrcode-modules-system
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-system
-
name
:
factory-tobacco-qrcode-modules-timesync
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-timesync
...
...
@@ -76,7 +76,7 @@ htj:
type
:
"
mvn"
url
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcode-htj.git"
namespace
:
qrcode-xxx
isUpdate
:
tru
e
isUpdate
:
fals
e
module
:
# - name: factory-tobacco-qrcode-module-monitoring-platform
# version: v24.09.20
...
...
@@ -85,47 +85,47 @@ htj:
# path: factory-tobacco-qrcode-module-monitoring-platform
-
name
:
factory-tobacco-qrcode-module-product-syncmes
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-module-product-syncmes
-
name
:
factory-tobacco-qrcode-modules-db-version-control
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-db-version-control
-
name
:
factory-tobacco-qrcode-modules-iotege-relation
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-iotege-relation
-
name
:
factory-tobacco-qrcode-modules-product-bloomfilter
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-product-bloomfilter
-
name
:
factory-tobacco-qrcode-modules-product-relation
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-product-relation
-
name
:
factory-tobacco-qrcode-modules-product-report
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-product-report
-
name
:
factory-tobacco-qrcode-modules-product-statistics
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-product-statistics
-
name
:
factory-tobacco-qrcode-modules-product-upload
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
true
path
:
factory-tobacco-qrcode-modules-product-upload
-
name
:
factory-tobacco-qrcode-modules-wip-relation
version
:
v24.09.20
isUpdate
:
tru
e
isUpdate
:
fals
e
isEncryption
:
false
path
:
factory-tobacco-qrcode-modules-wip-relation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment