Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
csbr-daop
/
fe-data-trusted-space
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
09afcc2c
authored
2026-03-10 16:53:01 +0800
by
lihua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
可信空间运营发版
1 parent
a1b8b9ed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
109 deletions
.env.product
Dockerfile
Jenkinsfile
default.conf
public/config.json
.env.product
View file @
09afcc2
...
...
@@ -4,7 +4,7 @@ VITE_APP_TITLE = 可信数据服务平台
VITE_API_BASEURL = https://sz-tds.zgsjzc.com/
# VITE_API_BASEURL = http://49.4.26.201:31709/
VITE_IDASS_BASEURL = http
s://sz-daop.zgsjzc.com
/portalLogin
VITE_IDASS_BASEURL = http
://121.237.182.65:32082
/portalLogin
# # 平台用户 接口请地址
# VITE_APP_USER_API_BASEURL = gateway-server
...
...
Dockerfile
View file @
09afcc2
FROM
192.168.5.4:82/csbr/nginx:stable-alpine
FROM
192.168.5.4:82/csbr/nginx:stable-alpine-arm
VOLUME
/tmp
#将当前文件夹的dist文件复制到容器的/usr/share/nginx/html目录
COPY ./dist/* /usr/share/nginx/html/
COPY ./dist/assets /usr/share/nginx/html/assets
COPY ./dist/files /usr/share/nginx/html/files
COPY default.conf /etc/nginx/conf.d/
#声明运行时容器暴露的端口(容器提供的服务端口)
RUN
chown -R nginx:nginx /usr/share/nginx/html
EXPOSE
9901
EXPOSE
29900
#CMD:指定容器启动时要运行的命令
CMD
["nginx", "-g", "daemon off;"]
CMD
["nginx", "-g", "daemon off;"]
\ No newline at end of file
...
...
Jenkinsfile
View file @
09afcc2
...
...
@@ -3,25 +3,13 @@ pipeline {
//环境定义
environment{
//服务名称
SVN_FOLD = "fe-data-development-trust-data-space-management"
//部署远程服务器
//192.168.4.4服务器
//SSH_PATH = "csbr4.4"
//192.168.5.4
SSH_PATH = "csbr5.4"
SVN_TYPE = "temp"
//139.9.190.186
//SSH_PATH = "csbr190.186"
//SVN_TYPE = "master"
//镜像版本号
SVN_FOLD = "fe-data-trusted-space"
SSH_PATH = "js-match"
SVN_TYPE = "pre"
image_tag = "1.0.0"
//docker私服ip
ip = "192.168.5.4:82"
//前端端口号
port = "80"
//映射端口号
ip = "121.237.182.192:30002"
port = "59900"
vport = "80"
}
//定时任务
//triggers { pollSCM('H 4/* 0 0 1-5') }
...
...
@@ -50,13 +38,14 @@ pipeline {
steps {
nodejs('node 16.20.2'){}
//配置私有npm仓库
sh 'npm config set registry http://49.4.23.228:8001/repository/csbr-npm/'
sh 'yarn config set registry http://49.4.23.228:8001/repository/csbr-npm/'
sh 'npm config set registry http://49.4.23.228:8001/repository/csbr-npm/'
//
sh 'yarn config set registry http://49.4.23.228:8001/repository/csbr-npm/'
// 配置后可通过下面方式来验证是否成功
sh 'npm config get registry'
sh 'npm install -g pnpm'
sh 'pnpm config set registry http://registry.npm.taobao.org'
sh 'pnpm install'
// sh 'pnpm install'
sh 'pnpm install --no-frozen-lockfile'
sh 'pnpm build:product'
}
}
...
...
@@ -64,9 +53,9 @@ pipeline {
steps {
//分分支构建
script{
if(env.BRANCH_NAME=='master-zq-
js
'){
//
master-asset
分支环境
echo 'start to deploy ${SVN_FOLD} on
master-zq-js
...'
if(env.BRANCH_NAME=='master-zq-
copy
'){
//
develop
分支环境
echo 'start to deploy ${SVN_FOLD} on
develop
...'
sh '''
#docker rmi -f $(docker images | grep "none" | awk '{print $3}')
CID=$(docker ps -a | grep "${SVN_FOLD}" | awk '{print $1}')
...
...
@@ -76,16 +65,16 @@ pipeline {
echo "存在'${SVN_FOLD}'镜像,IID='$IID'"
cd "$WORKSPACE"/
##构建镜像到远程仓库
docker login "${ip}" -u admin -p
E6w611g864wQ2
docker login "${ip}" -u admin -p
O2x760m922pX8
#docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}"
docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" .
docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}"
docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}"
else
echo "不存在'${SVN_FOLD}'镜像,开始构建镜像"
##构建镜像到远程仓库
docker login "${ip}" -u admin -p
E6w611g864wQ2
docker login "${ip}" -u admin -p
O2x760m922pX8
#docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}"
docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" .
docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" .
docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}"
fi
'''
...
...
@@ -94,37 +83,27 @@ pipeline {
}
}
}
//测试(暂时不用)
//stage('Test') {
//steps {
//sh './gradlew check'
//sh 'mvn -f ${SVN_FOLD}/pom.xml test'
//sh 'mvn -f ${SVN_FOLD}/pom.xml test'
//}
//}
//部署
stage('Deploy') {
steps {
echo 'Deploying'
//分分支部署
script{
if(env.BRANCH_NAME=='master-zq-
js
'){
//
master-asset
分支环境
echo 'start to deploy ${SVN_FOLD} on
master-zq-js
...'
if(env.BRANCH_NAME=='master-zq-
copy
'){
//
develop
分支环境
echo 'start to deploy ${SVN_FOLD} on
develop
...'
//调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本
sshPublisher(publishers: [sshPublisherDesc(configName: "
csbr5.4
", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """
sshPublisher(publishers: [sshPublisherDesc(configName: "
js-match
", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """
#使用k8s构建
kubectl delete -f /mnt/k8s/daop/
zq-production/daop-trust-data-space/fe-data-development-trust-data-space-management
.yaml
kubectl apply -f /mnt/k8s/daop/
zq-production/daop-trust-data-space/fe-data-development-trust-data-space-management
.yaml
kubectl delete -f /mnt/k8s/daop/
release-tds/daop-trust-data-space/fe-data-trusted-space
.yaml
kubectl apply -f /mnt/k8s/daop/
release-tds/daop-trust-data-space/fe-data-trusted-space
.yaml
""", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
echo 'Depoly ${SVN_FOLD} success ...'
}
}
}
}
}
//归档
post {
always {
...
...
@@ -132,6 +111,4 @@ pipeline {
archiveArtifacts artifacts: "dist/**", excludes: "dist"
}
}
}
}
\ No newline at end of file
...
...
default.conf
View file @
09afcc2
...
...
@@ -2,9 +2,7 @@ server {
listen
80
;
listen
[::]:
80
;
server_name
localhost
;
# server_name http://192.168.6.20:8052;
client_max_body_size
100
M
;
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header
'Access-Control-Allow-Origin'
*
always
;
# 设置允许的 HTTP 方法
...
...
@@ -20,69 +18,22 @@ server {
# if ($request_method = OPTIONS) {
# return 204;
# }
location
/ {
root
/
usr
/
share
/
nginx
/
html
;
index
index
.
html
index
.
htm
;
try_files
$
uri
$
uri
/ /
index
.
html
;
expires
-
1
s
;
}
location
/
api
{
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header
'Access-Control-Allow-Origin'
*
always
;
# 设置允许的 HTTP 方法
add_header
'Access-Control-Allow-Methods'
'GET, POST, OPTIONS, DELETE, PUT'
;
# 设置允许的请求头
add_header
'Access-Control-Allow-Headers'
'Authorization, Content-Type, Accept, Origin, X-Requested-With'
;
# 如果需要支持 cookie,可以设置以下 header
add_header
'Access-Control-Allow-Credentials'
'true'
;
# 缓存设置
add_header
Cache
-
Control
no
-
cache
;
add_header
Cache
-
Control
private
;
# 使用 rewrite 将 /api 替换为 /new-api
rewrite
^/
api
/(.*)$ /$
1
break
;
proxy_pass
https
://
sz
-
tds
.
zgsjzc
.
com
;
location
/
api
/ {
resolver
169
.
254
.
25
.
10
valid
=
30
s
;
proxy_pass
http
://
ms
-
daop
-
trust
-
data
-
space
-
gateway
-
server
-
temp
.
tds
:
8052
/;
proxy_set_header
Host
$
host
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
X
-
Forwarded
-
Proto
$
scheme
;
}
location
/
circulation
{
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header
'Access-Control-Allow-Origin'
*
always
;
# 设置允许的 HTTP 方法
add_header
'Access-Control-Allow-Methods'
'GET, POST, OPTIONS, DELETE, PUT'
;
# 设置允许的请求头
add_header
'Access-Control-Allow-Headers'
'Authorization, Content-Type, Accept, Origin, X-Requested-With'
;
# 如果需要支持 cookie,可以设置以下 header
add_header
'Access-Control-Allow-Credentials'
'true'
;
# 缓存设置
add_header
Cache
-
Control
no
-
cache
;
add_header
Cache
-
Control
private
;
# 使用 rewrite 将 /circulation 替换为 /new-api
rewrite
^/
circulation
/(.*)$ /$
1
break
;
proxy_pass
https
://
sz
-
lt
.
zgsjzc
.
com
;
}
location
/
delivery
{
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header
'Access-Control-Allow-Origin'
*
always
;
# 设置允许的 HTTP 方法
add_header
'Access-Control-Allow-Methods'
'GET, POST, OPTIONS, DELETE, PUT'
;
# 设置允许的请求头
add_header
'Access-Control-Allow-Headers'
'Authorization, Content-Type, Accept, Origin, X-Requested-With'
;
# 如果需要支持 cookie,可以设置以下 header
add_header
'Access-Control-Allow-Credentials'
'true'
;
# 缓存设置
add_header
Cache
-
Control
no
-
cache
;
add_header
Cache
-
Control
private
;
# 使用 rewrite 将 /circulation 替换为 /new-api
rewrite
^/
delivery
/(.*)$ /$
1
break
;
proxy_pass
https
://
sz
-
jgjf
.
zgsjzc
.
com
;
}
error_page
500
502
503
504
/
50
x
.
html
;
location
= /
50
x
.
html
{
root
/
usr
/
share
/
nginx
/
html
;
}
}
}
\ No newline at end of file
...
...
public/config.json
View file @
09afcc2
{
"appKey"
:
"69
2656f4e4b0f359c26d424d
"
"appKey"
:
"69
afd501e4b08251f6cf6419
"
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment