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
c0357c5b
Commit
c0357c5b
authored
Sep 23, 2024
by
xujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xx
parent
7c437288
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
24 deletions
+40
-24
Jenkinsfile
+34
-21
project.yaml
+6
-3
No files found.
Jenkinsfile
View file @
c0357c5b
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: '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']
]
def
modules
=
[
[
dir:
'BASE'
,
name:
"factory-tobacco-qrcode-auth"
,
version:
"v24.09.20"
,
isUpdate:
true
,
isEncryption:
true
,
path:
"module/xxx/xxxx"
]
]
def
smallfile
...
...
@@ -12,7 +16,6 @@ def smallfile
pipeline
{
agent
any
parameters
{
gitParameter
branchFilter:
'origin/(.*)'
,
defaultValue:
'master'
,
name:
'BASE'
,
type:
'PT_BRANCH_TAG'
,
useRepository:
'.*factory-tobacco-basic.git'
// 后端
gitParameter
branchFilter:
'origin/(.*)'
,
defaultValue:
'master'
,
name:
'CORE'
,
type:
'PT_BRANCH_TAG'
,
useRepository:
'.*factory-tobacco-qrcodecore.git'
// 后端
...
...
@@ -27,12 +30,15 @@ pipeline {
}
stages
{
// stage('步骤一: 参数获取') {
// steps {
// script {
// def yamlFile = readFile('project.yaml')
// def smallfile = log.readYaml(yamlFile)
stage
(
'步骤一: 参数获取'
)
{
steps
{
script
{
def
yamlFile
=
readFile
(
'project.yaml'
)
def
smallfile
=
log
.
readYaml
(
yamlFile
)
repos
.
add
([
dir:
smallfile
.
base
.
name
,
type:
smallfile
.
base
.
type
,
isUpdate:
smallfile
.
base
.
isUpdate
,
url:
smallfile
.
base
.
url
])
repos
.
add
([
dir:
smallfile
.
core
.
name
,
type:
smallfile
.
core
.
type
,
isUpdate:
smallfile
.
core
.
isUpdate
,
url:
smallfile
.
core
.
url
])
repos
.
add
([
dir:
smallfile
.
htj
.
name
,
type:
smallfile
.
htj
.
type
,
isUpdate:
smallfile
.
htj
.
isUpdate
,
url:
smallfile
.
htj
.
url
])
repos
.
add
([
dir:
smallfile
.
web
.
name
,
type:
smallfile
.
web
.
type
,
isUpdate:
smallfile
.
web
.
isUpdate
,
url:
smallfile
.
web
.
url
])
// base = xxx.base.module
// core = xxx.core.module
// htj = xxx.htj.module
...
...
@@ -44,10 +50,10 @@ pipeline {
// }
// } else {
// echo "Base is not a list"
//
}
//
}
//
}
//
}
//
}
}
}
}
stage
(
'步骤一: 代码获取'
)
{
steps
{
script
{
...
...
@@ -65,19 +71,26 @@ pipeline {
script
{
for
(
repo
in
repos
)
{
dir
(
repo
.
dir
)
{
if
(
repo
.
isUpdate
&&
repo
.
type
==
'mvn'
)
sh
"mvn -T 1C -Dmaven.test.failure.ignore=true clean package install"
else
if
(
repo
.
isUpdate
&&
repo
.
type
==
'node'
)
sh
"npm run build:prod-htj"
if
(
repo
.
isUpdate
&&
repo
.
type
==
'mvn'
)
sh
"mvn -T 1C -Dmaven.test.failure.ignore=true clean package install"
else
if
(
repo
.
isUpdate
&&
repo
.
type
==
'node'
)
sh
"npm run build:prod-htj"
}
}
}
}
}
stage
(
'步骤三:
判断是否加密
'
){
stage
(
'步骤三:
加密并拷贝文件
'
){
steps
{
for
(
module
in
modules
){
dir
(
module
.
dir
)
{
sh
"cd ${module.path}/target/ && ls -la "
// if (module.isEncryption){
// sh "cd ${module.path} && mvn classfinal:classFinal"
// sh "cd ${module.path}/target/ && ls -la "
// }
}
}
}
}
}
...
...
project.yaml
View file @
c0357c5b
...
...
@@ -4,6 +4,7 @@ version: v24.09.20
# 如果项目为true并且模块为true指定项目打包
base
:
name
:
"
BASE"
type
:
"
mvn"
git
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-basic.git"
namespace
:
qrcode-xxx
isUpdate
:
false
...
...
@@ -27,6 +28,7 @@ base:
core
:
name
:
"
CORE"
type
:
"
mvn"
git
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcodecore.git"
namespace
:
qrcode-xxx
isUpdate
:
false
...
...
@@ -54,6 +56,7 @@ core:
htj
:
name
:
"
HTJ"
type
:
"
mvn"
git
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcode-htj.git"
namespace
:
qrcode-xxx
isUpdate
:
false
...
...
@@ -99,9 +102,10 @@ htj:
isUpdate
:
false
isEncryption
:
false
qrcode
:
web
:
name
:
"
WEB"
type
:
"
mvn"
git
:
"
http://114.116.202.8:18808/factory-tobacco/factory-tobacco-qrcode-htj-vue.git"
name
:
WEB
isUpdate
:
false
version
:
v24.09.20
isEncryption
:
false
\ No newline at end of file
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