可信空间运营发版
Showing
5 changed files
with
37 additions
and
109 deletions
| ... | @@ -4,7 +4,7 @@ VITE_APP_TITLE = 可信数据服务平台 | ... | @@ -4,7 +4,7 @@ VITE_APP_TITLE = 可信数据服务平台 |
| 4 | VITE_API_BASEURL = https://sz-tds.zgsjzc.com/ | 4 | VITE_API_BASEURL = https://sz-tds.zgsjzc.com/ |
| 5 | # VITE_API_BASEURL = http://49.4.26.201:31709/ | 5 | # VITE_API_BASEURL = http://49.4.26.201:31709/ |
| 6 | 6 | ||
| 7 | VITE_IDASS_BASEURL = https://sz-daop.zgsjzc.com/portalLogin | 7 | VITE_IDASS_BASEURL = http://121.237.182.65:32082/portalLogin |
| 8 | 8 | ||
| 9 | # # 平台用户 接口请地址 | 9 | # # 平台用户 接口请地址 |
| 10 | # VITE_APP_USER_API_BASEURL = gateway-server | 10 | # VITE_APP_USER_API_BASEURL = gateway-server | ... | ... |
| 1 | 1 | ||
| 2 | 2 | FROM 192.168.5.4:82/csbr/nginx:stable-alpine-arm | |
| 3 | FROM 192.168.5.4:82/csbr/nginx:stable-alpine | ||
| 4 | VOLUME /tmp | 3 | VOLUME /tmp |
| 5 | #将当前文件夹的dist文件复制到容器的/usr/share/nginx/html目录 | 4 | #将当前文件夹的dist文件复制到容器的/usr/share/nginx/html目录 |
| 6 | COPY ./dist/* /usr/share/nginx/html/ | 5 | COPY ./dist/* /usr/share/nginx/html/ |
| 7 | COPY ./dist/assets /usr/share/nginx/html/assets | 6 | COPY ./dist/assets /usr/share/nginx/html/assets |
| 7 | COPY ./dist/files /usr/share/nginx/html/files | ||
| 8 | COPY default.conf /etc/nginx/conf.d/ | 8 | COPY default.conf /etc/nginx/conf.d/ |
| 9 | #声明运行时容器暴露的端口(容器提供的服务端口) | 9 | #声明运行时容器暴露的端口(容器提供的服务端口) |
| 10 | RUN chown -R nginx:nginx /usr/share/nginx/html | 10 | RUN chown -R nginx:nginx /usr/share/nginx/html |
| 11 | EXPOSE 9901 | 11 | EXPOSE 29900 |
| 12 | #CMD:指定容器启动时要运行的命令 | 12 | #CMD:指定容器启动时要运行的命令 |
| 13 | CMD ["nginx", "-g", "daemon off;"] | 13 | CMD ["nginx", "-g", "daemon off;"] |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,25 +3,13 @@ pipeline { | ... | @@ -3,25 +3,13 @@ pipeline { |
| 3 | //环境定义 | 3 | //环境定义 |
| 4 | environment{ | 4 | environment{ |
| 5 | //服务名称 | 5 | //服务名称 |
| 6 | SVN_FOLD = "fe-data-development-trust-data-space-management" | 6 | SVN_FOLD = "fe-data-trusted-space" |
| 7 | //部署远程服务器 | 7 | SSH_PATH = "js-match" |
| 8 | //192.168.4.4服务器 | 8 | SVN_TYPE = "pre" |
| 9 | //SSH_PATH = "csbr4.4" | ||
| 10 | //192.168.5.4 | ||
| 11 | SSH_PATH = "csbr5.4" | ||
| 12 | SVN_TYPE = "temp" | ||
| 13 | //139.9.190.186 | ||
| 14 | //SSH_PATH = "csbr190.186" | ||
| 15 | //SVN_TYPE = "master" | ||
| 16 | //镜像版本号 | ||
| 17 | image_tag = "1.0.0" | 9 | image_tag = "1.0.0" |
| 18 | //docker私服ip | 10 | ip = "121.237.182.192:30002" |
| 19 | ip = "192.168.5.4:82" | 11 | port = "59900" |
| 20 | //前端端口号 | ||
| 21 | port = "80" | ||
| 22 | //映射端口号 | ||
| 23 | vport = "80" | 12 | vport = "80" |
| 24 | |||
| 25 | } | 13 | } |
| 26 | //定时任务 | 14 | //定时任务 |
| 27 | //triggers { pollSCM('H 4/* 0 0 1-5') } | 15 | //triggers { pollSCM('H 4/* 0 0 1-5') } |
| ... | @@ -50,13 +38,14 @@ pipeline { | ... | @@ -50,13 +38,14 @@ pipeline { |
| 50 | steps { | 38 | steps { |
| 51 | nodejs('node 16.20.2'){} | 39 | nodejs('node 16.20.2'){} |
| 52 | //配置私有npm仓库 | 40 | //配置私有npm仓库 |
| 53 | sh 'npm config set registry http://49.4.23.228:8001/repository/csbr-npm/' | 41 | sh 'npm config set registry http://49.4.23.228:8001/repository/csbr-npm/' |
| 54 | sh 'yarn config set registry http://49.4.23.228:8001/repository/csbr-npm/' | 42 | // sh 'yarn config set registry http://49.4.23.228:8001/repository/csbr-npm/' |
| 55 | // 配置后可通过下面方式来验证是否成功 | 43 | // 配置后可通过下面方式来验证是否成功 |
| 56 | sh 'npm config get registry' | 44 | sh 'npm config get registry' |
| 57 | sh 'npm install -g pnpm' | 45 | sh 'npm install -g pnpm' |
| 58 | sh 'pnpm config set registry http://registry.npm.taobao.org' | 46 | sh 'pnpm config set registry http://registry.npm.taobao.org' |
| 59 | sh 'pnpm install' | 47 | // sh 'pnpm install' |
| 48 | sh 'pnpm install --no-frozen-lockfile' | ||
| 60 | sh 'pnpm build:product' | 49 | sh 'pnpm build:product' |
| 61 | } | 50 | } |
| 62 | } | 51 | } |
| ... | @@ -64,9 +53,9 @@ pipeline { | ... | @@ -64,9 +53,9 @@ pipeline { |
| 64 | steps { | 53 | steps { |
| 65 | //分分支构建 | 54 | //分分支构建 |
| 66 | script{ | 55 | script{ |
| 67 | if(env.BRANCH_NAME=='master-zq-js'){ | 56 | if(env.BRANCH_NAME=='master-zq-copy'){ |
| 68 | //master-asset分支环境 | 57 | //develop分支环境 |
| 69 | echo 'start to deploy ${SVN_FOLD} on master-zq-js ...' | 58 | echo 'start to deploy ${SVN_FOLD} on develop ...' |
| 70 | sh ''' | 59 | sh ''' |
| 71 | #docker rmi -f $(docker images | grep "none" | awk '{print $3}') | 60 | #docker rmi -f $(docker images | grep "none" | awk '{print $3}') |
| 72 | CID=$(docker ps -a | grep "${SVN_FOLD}" | awk '{print $1}') | 61 | CID=$(docker ps -a | grep "${SVN_FOLD}" | awk '{print $1}') |
| ... | @@ -76,16 +65,16 @@ pipeline { | ... | @@ -76,16 +65,16 @@ pipeline { |
| 76 | echo "存在'${SVN_FOLD}'镜像,IID='$IID'" | 65 | echo "存在'${SVN_FOLD}'镜像,IID='$IID'" |
| 77 | cd "$WORKSPACE"/ | 66 | cd "$WORKSPACE"/ |
| 78 | ##构建镜像到远程仓库 | 67 | ##构建镜像到远程仓库 |
| 79 | docker login "${ip}" -u admin -p E6w611g864wQ2 | 68 | docker login "${ip}" -u admin -p O2x760m922pX8 |
| 80 | #docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}" | 69 | #docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}" |
| 81 | docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" . | 70 | docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" . |
| 82 | docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" | 71 | docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" |
| 83 | else | 72 | else |
| 84 | echo "不存在'${SVN_FOLD}'镜像,开始构建镜像" | 73 | echo "不存在'${SVN_FOLD}'镜像,开始构建镜像" |
| 85 | ##构建镜像到远程仓库 | 74 | ##构建镜像到远程仓库 |
| 86 | docker login "${ip}" -u admin -p E6w611g864wQ2 | 75 | docker login "${ip}" -u admin -p O2x760m922pX8 |
| 87 | #docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}" | 76 | #docker tag "${SVN_FOLD}":"${image_tag}" "${ip}"/csbr/"${SVN_FOLD}":"${image_tag}" |
| 88 | docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" . | 77 | docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" . |
| 89 | docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" | 78 | docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" |
| 90 | fi | 79 | fi |
| 91 | ''' | 80 | ''' |
| ... | @@ -94,37 +83,27 @@ pipeline { | ... | @@ -94,37 +83,27 @@ pipeline { |
| 94 | } | 83 | } |
| 95 | } | 84 | } |
| 96 | } | 85 | } |
| 97 | //测试(暂时不用) | ||
| 98 | //stage('Test') { | ||
| 99 | //steps { | ||
| 100 | //sh './gradlew check' | ||
| 101 | //sh 'mvn -f ${SVN_FOLD}/pom.xml test' | ||
| 102 | //sh 'mvn -f ${SVN_FOLD}/pom.xml test' | ||
| 103 | //} | ||
| 104 | //} | ||
| 105 | //部署 | 86 | //部署 |
| 106 | stage('Deploy') { | 87 | stage('Deploy') { |
| 107 | steps { | 88 | steps { |
| 108 | echo 'Deploying' | 89 | echo 'Deploying' |
| 109 | //分分支部署 | 90 | //分分支部署 |
| 110 | script{ | 91 | script{ |
| 111 | if(env.BRANCH_NAME=='master-zq-js'){ | 92 | if(env.BRANCH_NAME=='master-zq-copy'){ |
| 112 | //master-asset分支环境 | 93 | //develop分支环境 |
| 113 | echo 'start to deploy ${SVN_FOLD} on master-zq-js ...' | 94 | echo 'start to deploy ${SVN_FOLD} on develop ...' |
| 114 | //调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本 | 95 | //调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本 |
| 115 | sshPublisher(publishers: [sshPublisherDesc(configName: "csbr5.4", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """ | 96 | sshPublisher(publishers: [sshPublisherDesc(configName: "js-match", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """ |
| 116 | #使用k8s构建 | 97 | #使用k8s构建 |
| 117 | kubectl delete -f /mnt/k8s/daop/zq-production/daop-trust-data-space/fe-data-development-trust-data-space-management.yaml | 98 | kubectl delete -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml |
| 118 | kubectl apply -f /mnt/k8s/daop/zq-production/daop-trust-data-space/fe-data-development-trust-data-space-management.yaml | 99 | kubectl apply -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml |
| 119 | """, execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) | 100 | """, execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) |
| 120 | |||
| 121 | echo 'Depoly ${SVN_FOLD} success ...' | 101 | echo 'Depoly ${SVN_FOLD} success ...' |
| 122 | } | 102 | } |
| 123 | } | 103 | } |
| 124 | } | 104 | } |
| 125 | } | 105 | } |
| 126 | } | 106 | } |
| 127 | |||
| 128 | //归档 | 107 | //归档 |
| 129 | post { | 108 | post { |
| 130 | always { | 109 | always { |
| ... | @@ -132,6 +111,4 @@ pipeline { | ... | @@ -132,6 +111,4 @@ pipeline { |
| 132 | archiveArtifacts artifacts: "dist/**", excludes: "dist" | 111 | archiveArtifacts artifacts: "dist/**", excludes: "dist" |
| 133 | } | 112 | } |
| 134 | } | 113 | } |
| 135 | 114 | } | |
| 136 | |||
| 137 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,9 +2,7 @@ server { | ... | @@ -2,9 +2,7 @@ server { |
| 2 | listen 80; | 2 | listen 80; |
| 3 | listen [::]:80; | 3 | listen [::]:80; |
| 4 | server_name localhost; | 4 | server_name localhost; |
| 5 | # server_name http://192.168.6.20:8052; | ||
| 6 | client_max_body_size 100M; | 5 | client_max_body_size 100M; |
| 7 | |||
| 8 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | 6 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 |
| 9 | add_header 'Access-Control-Allow-Origin' * always; | 7 | add_header 'Access-Control-Allow-Origin' * always; |
| 10 | # 设置允许的 HTTP 方法 | 8 | # 设置允许的 HTTP 方法 |
| ... | @@ -20,69 +18,22 @@ server { | ... | @@ -20,69 +18,22 @@ server { |
| 20 | # if ($request_method = OPTIONS) { | 18 | # if ($request_method = OPTIONS) { |
| 21 | # return 204; | 19 | # return 204; |
| 22 | # } | 20 | # } |
| 23 | |||
| 24 | location / { | 21 | location / { |
| 25 | root /usr/share/nginx/html; | 22 | root /usr/share/nginx/html; |
| 26 | index index.html index.htm; | 23 | index index.html index.htm; |
| 27 | try_files $uri $uri/ /index.html; | 24 | try_files $uri $uri/ /index.html; |
| 28 | expires -1s; | 25 | expires -1s; |
| 29 | } | 26 | } |
| 30 | 27 | location /api/ { | |
| 31 | location /api { | 28 | resolver 169.254.25.10 valid=30s; |
| 32 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | 29 | proxy_pass http://ms-daop-trust-data-space-gateway-server-temp.tds:8052/; |
| 33 | add_header 'Access-Control-Allow-Origin' * always; | 30 | proxy_set_header Host $host; |
| 34 | # 设置允许的 HTTP 方法 | 31 | proxy_set_header X-Real-IP $remote_addr; |
| 35 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | 32 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 36 | # 设置允许的请求头 | 33 | proxy_set_header X-Forwarded-Proto $scheme; |
| 37 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | ||
| 38 | # 如果需要支持 cookie,可以设置以下 header | ||
| 39 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 40 | # 缓存设置 | ||
| 41 | add_header Cache-Control no-cache; | ||
| 42 | add_header Cache-Control private; | ||
| 43 | |||
| 44 | # 使用 rewrite 将 /api 替换为 /new-api | ||
| 45 | rewrite ^/api/(.*)$ /$1 break; | ||
| 46 | proxy_pass https://sz-tds.zgsjzc.com; | ||
| 47 | } | 34 | } |
| 48 | |||
| 49 | location /circulation { | ||
| 50 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | ||
| 51 | add_header 'Access-Control-Allow-Origin' * always; | ||
| 52 | # 设置允许的 HTTP 方法 | ||
| 53 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | ||
| 54 | # 设置允许的请求头 | ||
| 55 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | ||
| 56 | # 如果需要支持 cookie,可以设置以下 header | ||
| 57 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 58 | # 缓存设置 | ||
| 59 | add_header Cache-Control no-cache; | ||
| 60 | add_header Cache-Control private; | ||
| 61 | |||
| 62 | # 使用 rewrite 将 /circulation 替换为 /new-api | ||
| 63 | rewrite ^/circulation/(.*)$ /$1 break; | ||
| 64 | proxy_pass https://sz-lt.zgsjzc.com; | ||
| 65 | } | ||
| 66 | location /delivery { | ||
| 67 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | ||
| 68 | add_header 'Access-Control-Allow-Origin' * always; | ||
| 69 | # 设置允许的 HTTP 方法 | ||
| 70 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | ||
| 71 | # 设置允许的请求头 | ||
| 72 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | ||
| 73 | # 如果需要支持 cookie,可以设置以下 header | ||
| 74 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 75 | # 缓存设置 | ||
| 76 | add_header Cache-Control no-cache; | ||
| 77 | add_header Cache-Control private; | ||
| 78 | |||
| 79 | # 使用 rewrite 将 /circulation 替换为 /new-api | ||
| 80 | rewrite ^/delivery/(.*)$ /$1 break; | ||
| 81 | proxy_pass https://sz-jgjf.zgsjzc.com; | ||
| 82 | } | ||
| 83 | |||
| 84 | error_page 500 502 503 504 /50x.html; | 35 | error_page 500 502 503 504 /50x.html; |
| 85 | location = /50x.html { | 36 | location = /50x.html { |
| 86 | root /usr/share/nginx/html; | 37 | root /usr/share/nginx/html; |
| 87 | } | 38 | } |
| 88 | } | 39 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment