Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
loit-build-common
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
loit-Infrastructure
loit-build-common
Commits
4442415b
提交
4442415b
authored
10月 03, 2021
作者:
chenshiying
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[新增] 演示环境配置
上级
8d3e064a
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
1051 行增加
和
1 行删除
+1051
-1
NginxTarREADEME.md
...-build-component/loit-build-deploy-env/NginxTarREADEME.md
+92
-0
SM2READEME.md
loit-build-component/loit-build-deploy-env/SM2READEME.md
+92
-0
SSHREADEME.md
loit-build-component/loit-build-deploy-env/SSHREADEME.md
+131
-0
BuildEnvEnum.java
...rc/main/java/com/loit/common/script/dto/BuildEnvEnum.java
+6
-1
deployInfo.xlsx
.../loit-build-deploy-env/src/main/resources/deployInfo.xlsx
+0
-0
jenkinsJobCreate.ftl
...in/resources/template/deploy/preView/jenkinsJobCreate.ftl
+1
-0
jobConfigBackend.ftl
...in/resources/template/deploy/preView/jobConfigBackend.ftl
+145
-0
jobConfigFront.ftl
...main/resources/template/deploy/preView/jobConfigFront.ftl
+150
-0
jenkinsJobCreateZww.ftl
...n/resources/template/push/preView/jenkinsJobCreateZww.ftl
+2
-0
zww-push-config.ftl
.../main/resources/template/push/preView/zww-push-config.ftl
+119
-0
nginx_config.ftl
...rc/main/resources/template/sh/preProduct/nginx_config.ftl
+2
-0
bootstrap.ftl
...-env/src/main/resources/template/sh/preView/bootstrap.ftl
+7
-0
copyNginxConfig.ftl
...rc/main/resources/template/sh/preView/copyNginxConfig.ftl
+4
-0
deploy-portal-web-sh.ftl
...in/resources/template/sh/preView/deploy-portal-web-sh.ftl
+52
-0
deploy-sh.ftl
...-env/src/main/resources/template/sh/preView/deploy-sh.ftl
+43
-0
deploy-web-sh.ftl
.../src/main/resources/template/sh/preView/deploy-web-sh.ftl
+52
-0
gateway.ftl
...oy-env/src/main/resources/template/sh/preView/gateway.ftl
+8
-0
hlw-nginx-upstream.ftl
...main/resources/template/sh/preView/hlw-nginx-upstream.ftl
+13
-0
logstash-conf.ftl
.../src/main/resources/template/sh/preView/logstash-conf.ftl
+38
-0
logstash-start.ftl
...src/main/resources/template/sh/preView/logstash-start.ftl
+8
-0
logstash-stop.ftl
.../src/main/resources/template/sh/preView/logstash-stop.ftl
+10
-0
nginx_config.ftl
...v/src/main/resources/template/sh/preView/nginx_config.ftl
+20
-0
zww-nginx-upstream.ftl
...main/resources/template/sh/preView/zww-nginx-upstream.ftl
+54
-0
nginx_config.ftl
...v/src/main/resources/template/sh/product/nginx_config.ftl
+2
-0
没有找到文件。
loit-build-component/loit-build-deploy-env/NginxTarREADEME.md
0 → 100644
浏览文件 @
4442415b
# 初始化脚本步骤
服务器(10.0.120.26 192.169.201.14) /home/soft/deploy 文件夹
```shell
pscp -r -h /home/soft/deploy/server/host_ip_ca.txt /usr/local/src/nginx-1.21.1.tar.gz /usr/local/src
```
host_ip_ca.txt
```
10.0.120.162 root
10.0.120.7 root
10.0.120.83 root
10.0.120.186 root
10.0.120.231 root
10.0.120.146 root
10.0.120.214 root
10.0.120.198 root
10.0.120.189 root
10.0.120.218 root
10.0.120.193 root
10.0.120.221 root
10.0.120.103 root
10.0.120.61 root
10.0.120.55 root
10.0.120.161 root
10.0.120.39 root
10.0.120.158 root
10.0.120.210 root
10.0.120.84 root
10.0.120.124 root
10.0.120.151 root
10.0.120.248 root
10.0.120.237 root
10.0.120.154 root
10.0.120.89 root
10.0.120.122 root
10.0.120.147 root
10.0.120.250 root
10.0.120.18 root
10.0.120.199 root
10.0.120.192 root
10.0.120.245 root
10.0.120.58 root
10.0.120.187 root
10.0.120.36 root
10.0.120.92 root
10.0.120.130 root
10.0.120.21 root
10.0.120.127 root
10.0.120.53 root
10.0.120.242 root
10.0.120.68 root
10.0.120.225 root
10.0.120.69 root
10.0.120.116 root
10.0.120.94 root
10.0.120.212 root
10.0.120.143 root
10.0.120.44 root
10.0.120.134 root
10.0.120.184 root
10.0.120.195 root
10.0.120.16 root
10.0.120.132 root
10.0.120.35 root
10.0.120.238 root
10.0.120.104 root
10.0.120.3 root
10.0.120.247 root
10.0.120.153 root
10.0.120.152 root
10.0.120.37 root
10.0.120.128 root
10.0.120.135 root
10.0.120.190 root
10.0.120.241 root
10.0.120.88 root
10.0.120.41 root
10.0.120.121 root
10.0.120.211 root
10.0.120.172 root
10.0.120.217 root
10.0.120.51 root
10.0.120.13 root
10.0.120.198 root
10.0.120.118 root
10.0.120.189 root
```
loit-build-component/loit-build-deploy-env/SM2READEME.md
0 → 100644
浏览文件 @
4442415b
# 初始化脚本步骤
服务器(10.0.120.26 192.169.201.14) /home/soft/deploy 文件夹
```shell
pscp -r -h /home/soft/deploy/server/host_ip_ca.txt /root/SM2ROOT /root
```
host_ip_ca.txt
```
10.0.120.162 root
10.0.120.7 root
10.0.120.83 root
10.0.120.186 root
10.0.120.231 root
10.0.120.146 root
10.0.120.214 root
10.0.120.198 root
10.0.120.189 root
10.0.120.218 root
10.0.120.193 root
10.0.120.221 root
10.0.120.103 root
10.0.120.61 root
10.0.120.55 root
10.0.120.161 root
10.0.120.39 root
10.0.120.158 root
10.0.120.210 root
10.0.120.84 root
10.0.120.124 root
10.0.120.151 root
10.0.120.248 root
10.0.120.237 root
10.0.120.154 root
10.0.120.89 root
10.0.120.122 root
10.0.120.147 root
10.0.120.250 root
10.0.120.18 root
10.0.120.199 root
10.0.120.192 root
10.0.120.245 root
10.0.120.58 root
10.0.120.187 root
10.0.120.36 root
10.0.120.92 root
10.0.120.130 root
10.0.120.21 root
10.0.120.127 root
10.0.120.53 root
10.0.120.242 root
10.0.120.68 root
10.0.120.225 root
10.0.120.69 root
10.0.120.116 root
10.0.120.94 root
10.0.120.212 root
10.0.120.143 root
10.0.120.44 root
10.0.120.134 root
10.0.120.184 root
10.0.120.195 root
10.0.120.16 root
10.0.120.132 root
10.0.120.35 root
10.0.120.238 root
10.0.120.104 root
10.0.120.3 root
10.0.120.247 root
10.0.120.153 root
10.0.120.152 root
10.0.120.37 root
10.0.120.128 root
10.0.120.135 root
10.0.120.190 root
10.0.120.241 root
10.0.120.88 root
10.0.120.41 root
10.0.120.121 root
10.0.120.211 root
10.0.120.172 root
10.0.120.217 root
10.0.120.51 root
10.0.120.13 root
10.0.120.198 root
10.0.120.118 root
10.0.120.189 root
```
loit-build-component/loit-build-deploy-env/SSHREADEME.md
0 → 100644
浏览文件 @
4442415b
find /root -name "
*
.sh" | xargs sed -i 's/
\r
$//g'
find /root -name "
*
.conf" | xargs sed -i 's/
\r
$//g'
find /root -name "
*
.properties" | xargs sed -i 's/
\r
$//g'
# 初始化脚本步骤
服务器(10.0.120.26 192.169.201.14) /home/soft/deploy 文件夹
```shell
pscp -r -h /home/soft/deploy/server/host_ip_ssh_zww.txt /root/openssh-clients-8.6p1-1.el7.x86_64.rpm /root
pscp -r -h /home/soft/deploy/server/host_ip_ssh_zww.txt /root/openssh-8.6p1-1.el7.x86_64.rpm /root
pscp -r -h /home/soft/deploy/server/host_ip_ssh_zww.txt /root/openssh-server-8.6p1-1.el7.x86_64.rpm /root
pscp -r -h /home/soft/deploy/server/host_ip_ssh_zww.txt /usr/local/src/openssl-1.1.1d.tar.gz /root
pscp -r -h /home/soft/deploy/server/host_ip_ssh_zww.txt /root/openssh.sh /root
```
host_ip_ca.txt
银河区
```
10.0.120.162 root
10.0.120.7 root
10.0.120.83 root
10.0.120.186 root
10.0.120.231 root
10.0.120.146 root
10.0.120.214 root
10.0.120.198 root
10.0.120.189 root
10.0.120.218 root
10.0.120.193 root
10.0.120.221 root
10.0.120.103 root
10.0.120.61 root
10.0.120.55 root
10.0.120.161 root
10.0.120.39 root
10.0.120.158 root
10.0.120.210 root
10.0.120.84 root
10.0.120.124 root
10.0.120.151 root
10.0.120.248 root
10.0.120.237 root
10.0.120.154 root
10.0.120.89 root
10.0.120.122 root
10.0.120.147 root
10.0.120.250 root
10.0.120.18 root
10.0.120.199 root
10.0.120.192 root
10.0.120.245 root
10.0.120.58 root
10.0.120.187 root
10.0.120.36 root
10.0.120.92 root
10.0.120.130 root
10.0.120.21 root
10.0.120.127 root
10.0.120.53 root
10.0.120.242 root
10.0.120.68 root
10.0.120.225 root
10.0.120.69 root
10.0.120.116 root
10.0.120.94 root
10.0.120.212 root
10.0.120.143 root
10.0.120.44 root
10.0.120.134 root
10.0.120.184 root
10.0.120.195 root
10.0.120.16 root
10.0.120.132 root
10.0.120.35 root
10.0.120.238 root
10.0.120.104 root
10.0.120.3 root
10.0.120.247 root
10.0.120.153 root
10.0.120.152 root
10.0.120.37 root
10.0.120.128 root
10.0.120.135 root
10.0.120.190 root
10.0.120.241 root
10.0.120.88 root
10.0.120.41 root
10.0.120.121 root
10.0.120.211 root
10.0.120.172 root
10.0.120.217 root
10.0.120.51 root
10.0.120.13 root
10.0.120.198 root
10.0.120.189 root
10.0.120.86 root
10.0.120.31 root
10.0.120.200 root
```
172.
16.11.32 192.168.188.15 前端应用服务器-指挥调度
```
shell
pscp
-r
-h
/home/soft/deploy/server/host_ip_ssh_hlw.txt /root/openssh-clients-8.6p1-1.el7.x86_64.rpm /root
pscp
-r
-h
/home/soft/deploy/server/host_ip_ssh_hlw.txt /root/openssh-8.6p1-1.el7.x86_64.rpm /root
pscp
-r
-h
/home/soft/deploy/server/host_ip_ssh_hlw.txt /root/openssh-server-8.6p1-1.el7.x86_64.rpm /root
pscp
-r
-h
/home/soft/deploy/server/host_ip_ssh_hlw.txt /usr/local/src/openssl-1.1.1d.tar.gz /root
pscp
-r
-h
/home/soft/deploy/server/host_ip_ssh_hlw.txt /root/openssh.sh /root
```
```
172.16.11.29 root
172.16.11.30 root
172.16.11.31 root
```
# 其他 配置 ssh
ssh-copy-id -i /root/.ssh/id_rsa.pub root@10.0.120.86
ssh-copy-id -i /root/.ssh/id_rsa.pub root@10.0.120.31
ssh-copy-id -i /root/.ssh/id_rsa.pub root@10.0.120.200
ssh-copy-id -i /root/.ssh/id_rsa.pub root@172.16.11.29
ssh-copy-id -i /root/.ssh/id_rsa.pub root@172.16.11.30
ssh-copy-id -i /root/.ssh/id_rsa.pub root@172.16.11.31
loit-build-component/loit-build-deploy-env/src/main/java/com/loit/common/script/dto/BuildEnvEnum.java
浏览文件 @
4442415b
...
@@ -14,7 +14,12 @@ public enum BuildEnvEnum {
...
@@ -14,7 +14,12 @@ public enum BuildEnvEnum {
/**
/**
* 准生产
* 准生产
*/
*/
PRE_PRODUCT
(
"preProduct"
,
"准生产"
);
PRE_PRODUCT
(
"preProduct"
,
"准生产"
),
/**
* 演示环境
*/
PRE_VIEW
(
"preView"
,
"演示环境"
);
private
String
code
;
private
String
code
;
...
...
loit-build-component/loit-build-deploy-env/src/main/resources/deployInfo.xlsx
浏览文件 @
4442415b
No preview for this file type
loit-build-component/loit-build-deploy-env/src/main/resources/template/deploy/preView/jenkinsJobCreate.ftl
0 → 100644
浏览文件 @
4442415b
curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -d "@config.xml" http://192.168.111.106:12012/createItem?name=${deployJobName}
loit-build-component/loit-build-deploy-env/src/main/resources/template/deploy/preView/jobConfigBackend.ftl
0 → 100644
浏览文件 @
4442415b
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>
false
</keepDependencies>
<properties>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty
plugin=
"gitlab-plugin@1.5.13"
>
<gitLabConnection>
gitlab140
</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<jenkins.model.BuildDiscarderProperty>
<strategy
class=
"hudson.tasks.LogRotator"
>
<daysToKeep>
-1
</daysToKeep>
<numToKeep>
3
</numToKeep>
<artifactDaysToKeep>
-1
</artifactDaysToKeep>
<artifactNumToKeep>
-1
</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>
deployName
</name>
<description>
文件名称
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
modelVersion
</name>
<description>
模块版本
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
modelServiceName
</name>
<description>
模块服务名
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
projectCode
</name>
<description>
项目编号
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.ChoiceParameterDefinition>
<name>
status
</name>
<description>
start 启动 ,stop停止,deploy部署
(deploy代码传递参数,界面不要选择此项)
</description>
<choices
class=
"java.util.Arrays$ArrayList"
>
<a
class=
"string-array"
>
<string>
start
</string>
<string>
stop
</string>
<string>
deploy
</string>
</a>
</choices>
</hudson.model.ChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm
class=
"hudson.scm.NullSCM"
/>
<canRoam>
true
</canRoam>
<disabled>
false
</disabled>
<blockBuildWhenDownstreamBuilding>
false
</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>
false
</blockBuildWhenUpstreamBuilding>
<authToken>
1156ddb265bc6ec3c190a17d74735d8f28
</authToken>
<triggers/>
<concurrentBuild>
false
</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>
echo
"
###################begin start#############
"
echo
'
deployName:
'
+ $deployName
echo
'
modelServiceName:
'
+ $modelServiceName
echo
'
modelVersion:
'
+ $modelVersion
echo
'
projectCode:
'
+ $projectCode
echo
'
status:
'
+ $status
echo
"
###################end print#############
"
echo
"
###################begin write#############
"
rm -rf updowncommand.txt
echo $status
>
updowncommand.txt
echo
"
###################end write###############
"
ls -la
if [
"
$status
"
=
"
deploy
"
]; then
rm -rf $deployName
destDir=
"
/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}/${r"${"}deployName}
"
echo
'
destDir:
'
+ $destDir
# copy jar to jenkins container
scp root@192.168.111.106:$destDir .
echo
"
################### jar file#############
"
ls -la
fi
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin
plugin=
"publish-over-ssh@1.20.1"
>
<consolePrefix>
SSH:
</consolePrefix>
<delegate
plugin=
"publish-over@0.22"
>
<publishers>
<jenkins.plugins.publish__over__ssh.BapSshPublisher
plugin=
"publish-over-ssh@1.20.1"
>
<configName>
${floatingIp}(${fixedIp})
</configName>
<verbose>
false
</verbose>
<transfers>
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
<remoteDirectory>
${deployPath}
</remoteDirectory>
<sourceFiles>
${deployJar},updowncommand.txt
</sourceFiles>
<excludes></excludes>
<removePrefix></removePrefix>
<remoteDirectorySDF>
false
</remoteDirectorySDF>
<flatten>
false
</flatten>
<cleanRemote>
false
</cleanRemote>
<noDefaultExcludes>
false
</noDefaultExcludes>
<makeEmptyDirs>
false
</makeEmptyDirs>
<patternSeparator>
[, ]+
</patternSeparator>
<execCommand>
cd ${deployPath}
exec bash ${deployShFileName} start
</execCommand>
<execTimeout>
120000
</execTimeout>
<usePty>
true
</usePty>
<useAgentForwarding>
false
</useAgentForwarding>
</jenkins.plugins.publish__over__ssh.BapSshTransfer>
</transfers>
<useWorkspaceInPromotion>
false
</useWorkspaceInPromotion>
<usePromotionTimestamp>
false
</usePromotionTimestamp>
</jenkins.plugins.publish__over__ssh.BapSshPublisher>
</publishers>
<continueOnError>
false
</continueOnError>
<failOnError>
false
</failOnError>
<alwaysPublishFromMaster>
false
</alwaysPublishFromMaster>
<hostConfigurationAccess
class=
"jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin"
reference=
"../.."
/>
</delegate>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
</publishers>
<buildWrappers/>
</project>
loit-build-component/loit-build-deploy-env/src/main/resources/template/deploy/preView/jobConfigFront.ftl
0 → 100644
浏览文件 @
4442415b
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>
false
</keepDependencies>
<properties>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty
plugin=
"gitlab-plugin@1.5.13"
>
<gitLabConnection>
gitlab140
</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<jenkins.model.BuildDiscarderProperty>
<strategy
class=
"hudson.tasks.LogRotator"
>
<daysToKeep>
-1
</daysToKeep>
<numToKeep>
3
</numToKeep>
<artifactDaysToKeep>
-1
</artifactDaysToKeep>
<artifactNumToKeep>
-1
</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>
deployName
</name>
<description>
文件名称
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
modelVersion
</name>
<description>
模块版本
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
modelServiceName
</name>
<description>
模块服务名
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>
projectCode
</name>
<description>
项目编号
</description>
<defaultValue></defaultValue>
<trim>
true
</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.ChoiceParameterDefinition>
<name>
status
</name>
<description>
start 启动 ,stop停止,deploy部署
(deploy代码传递参数,界面不要选择此项)
</description>
<choices
class=
"java.util.Arrays$ArrayList"
>
<a
class=
"string-array"
>
<string>
start
</string>
<string>
stop
</string>
<string>
deploy
</string>
</a>
</choices>
</hudson.model.ChoiceParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm
class=
"hudson.scm.NullSCM"
/>
<canRoam>
true
</canRoam>
<disabled>
false
</disabled>
<blockBuildWhenDownstreamBuilding>
false
</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>
false
</blockBuildWhenUpstreamBuilding>
<authToken>
1156ddb265bc6ec3c190a17d74735d8f28
</authToken>
<triggers/>
<concurrentBuild>
false
</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>
echo
"
###################begin start#############
"
echo
'
deployName:
'
+ $deployName
echo
'
modelServiceName:
'
+ $modelServiceName
echo
'
modelVersion:
'
+ $modelVersion
echo
'
projectCode:
'
+ $projectCode
echo
'
status:
'
+ $status
echo
"
###################end print#############
"
echo
"
###################begin write#############
"
rm -rf updowncommand.txt
echo $status
>
updowncommand.txt
echo
"
###################end write###############
"
ls -la
if [
"
$status
"
=
"
deploy
"
]; then
rm -rf $deployName
destDir=
"
/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}/${r"${"}deployName}
"
echo
'
destDir:
'
+ $destDir
# copy jar to jenkins container
scp root@192.168.111.106:$destDir .
tempFileName=
"
${r"${"}deployName}.temp
"
rm -rf tempFileName
echo
"
###################rename zip#############
"
mv $deployName $tempFileName
mv $tempFileName dist.zip
fi
ls -la
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin
plugin=
"publish-over-ssh@1.20.1"
>
<consolePrefix>
SSH:
</consolePrefix>
<delegate
plugin=
"publish-over@0.22"
>
<publishers>
<jenkins.plugins.publish__over__ssh.BapSshPublisher
plugin=
"publish-over-ssh@1.20.1"
>
<configName>
${floatingIp}(${fixedIp})
</configName>
<verbose>
false
</verbose>
<transfers>
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
<remoteDirectory>
${deployPath}
</remoteDirectory>
<sourceFiles>
dist.zip,updowncommand.txt
</sourceFiles>
<excludes></excludes>
<removePrefix></removePrefix>
<remoteDirectorySDF>
false
</remoteDirectorySDF>
<flatten>
false
</flatten>
<cleanRemote>
false
</cleanRemote>
<noDefaultExcludes>
false
</noDefaultExcludes>
<makeEmptyDirs>
false
</makeEmptyDirs>
<patternSeparator>
[, ]+
</patternSeparator>
<execCommand>
cd ${deployPath}
exec bash ${deployShFileName} start
</execCommand>
<execTimeout>
120000
</execTimeout>
<usePty>
true
</usePty>
<useAgentForwarding>
false
</useAgentForwarding>
</jenkins.plugins.publish__over__ssh.BapSshTransfer>
</transfers>
<useWorkspaceInPromotion>
false
</useWorkspaceInPromotion>
<usePromotionTimestamp>
false
</usePromotionTimestamp>
</jenkins.plugins.publish__over__ssh.BapSshPublisher>
</publishers>
<continueOnError>
false
</continueOnError>
<failOnError>
false
</failOnError>
<alwaysPublishFromMaster>
false
</alwaysPublishFromMaster>
<hostConfigurationAccess
class=
"jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin"
reference=
"../.."
/>
</delegate>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
</publishers>
<buildWrappers/>
</project>
loit-build-component/loit-build-deploy-env/src/main/resources/template/push/preView/jenkinsJobCreateZww.ftl
0 → 100644
浏览文件 @
4442415b
curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -d "@config.xml" http://192.169.200.175:12012/createItem?name=${deployJobName}
loit-build-component/loit-build-deploy-env/src/main/resources/template/push/preView/zww-push-config.ftl
0 → 100644
浏览文件 @
4442415b
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>
false
</keepDependencies>
<properties>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty
plugin=
"gitlab-plugin@1.5.13"
>
<gitLabConnection>
gitlab140
</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<jenkins.model.BuildDiscarderProperty>
<strategy
class=
"hudson.tasks.LogRotator"
>
<daysToKeep>
-1
</daysToKeep>
<numToKeep>
10
</numToKeep>
<artifactDaysToKeep>
-1
</artifactDaysToKeep>
<artifactNumToKeep>
-1
</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.TextParameterDefinition>
<name>
jarFile
</name>
<description>
源部署包路径
</description>
<defaultValue></defaultValue>
<trim>
false
</trim>
</hudson.model.TextParameterDefinition>
<hudson.model.TextParameterDefinition>
<name>
modelServiceName
</name>
<description></description>
<defaultValue>
模块服务名
</defaultValue>
<trim>
false
</trim>
</hudson.model.TextParameterDefinition>
<hudson.model.TextParameterDefinition>
<name>
projectCode
</name>
<description>
项目编号
</description>
<defaultValue></defaultValue>
<trim>
false
</trim>
</hudson.model.TextParameterDefinition>
<hudson.model.TextParameterDefinition>
<name>
modelVersion
</name>
<description></description>
<defaultValue>
模块版本
</defaultValue>
<trim>
false
</trim>
</hudson.model.TextParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm
class=
"hudson.scm.NullSCM"
/>
<canRoam>
true
</canRoam>
<disabled>
false
</disabled>
<blockBuildWhenDownstreamBuilding>
false
</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>
false
</blockBuildWhenUpstreamBuilding>
<authToken>
1156ddb265bc6ec3c190a17d74735d8f28
</authToken>
<triggers/>
<concurrentBuild>
false
</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>
echo
"
###################print param begin#############
"
echo
'
jarFile:
'
+ $jarFile
echo
'
modelServiceName:
'
+ $modelServiceName
echo
'
modelVersion:
'
+ $modelVersion
echo
'
projectCode:
'
+ $projectCode
echo
"
################### print param end#############
"
if [ -z
"
$jarFile
"
]; then
echo
'
jarFile must not be empty
'
exit -1
fi
if [ -z
"
$modelServiceName
"
]; then
echo
'
modelServiceName must not be empty
'
exit -1
fi
if [ -z
"
$modelVersion
"
]; then
echo
'
modelVersion must not be empty
'
exit -1
fi
if [ -z
"
$projectCode
"
]; then
echo
'
projectCode must not be empty
'
exit -1
fi
fileName=${r"${"}jarFile##*/}
rm -rf $fileName
# copy jar to docker container
scp -r root@10.0.120.128:$jarFile .
ls -la
# create remote dir
echo
"
##################create remote dir#############
"
destDir=
"
/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}
"
ssh root@10.0.120.13
"
pwd
&&
mkdir -p $destDir
&&
ls -la $destDir
"
echo
"
##################pushing jar begin#############
"
scp -r $fileName root@10.0.120.13:$destDir
echo
"
###################pushing jar end#############
"
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preProduct/nginx_config.ftl
浏览文件 @
4442415b
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
gzip_types application/javascript text/css text/xml;
gzip_types application/javascript text/css text/xml;
gzip_vary on;
gzip_vary on;
server_tokens off;
location /{
location /{
root ${deployPath}/;
root ${deployPath}/;
try_files $uri $uri/ =404;
try_files $uri $uri/ =404;
...
...
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/bootstrap.ftl
0 → 100644
浏览文件 @
4442415b
spring.profiles.active=${springProfilesActive}
spring.application.name=loit-${serviceName}
# Nacos \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u0135\ufffd\u05b7
spring.cloud.nacos.config.server-addr=192.169.201.94:81
spring.cloud.nacos.config.namespace=8b2a59c5-232d-4a12-949e-09062c046d8d
spring.cloud.nacos.config.file-extension=yaml
spring.main.allow-bean-definition-overriding=true
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/copyNginxConfig.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/bash
\c
p
-rf
/home/soft/nginxConfig/
*
/usr/local/nginx/conf/conf.d.start/
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/deploy-portal-web-sh.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/sh
params1
=
$1
command
=
$(
cat
updowncommand.txt
)
echo
'command:'
$command
if
[
-z
"
$params1
"
]
;
then
command
=
"start"
echo
'command reset value:'
$command
fi
if
[
"
$params1
"
=
"stop"
]
;
then
command
=
"stop"
echo
'command params value:'
$command
fi
nginxConf
=
"/
${
nginxConfigName
}
"
nginxPath
=
"/usr/local/nginx/"
startPath
=
$nginxPath
'conf/conf.d.start'
startConf
=
$startPath$nginxConf
stopPath
=
$nginxPath
'conf/conf.d.stop'
stopConf
=
$stopPath$nginxConf
echo
'startConf:'
$startConf
if
[
"
$command
"
=
"stop"
]
;
then
echo
'test'
if
[
-e
"
$startConf
"
]
;
then
echo
'copy to stop file'
mv
$startConf
$stopPath
fi
fi
if
[
"
$command
"
!=
"stop"
]
;
then
if
[
-e
"
$stopConf
"
]
;
then
echo
'copy to start file'
mv
$stopConf
$startPath
fi
cd
${
deployPath
}
rm
-rf
dist
rm
-rf
static
rm
-rf
vue-permission/static
unzip dist
*
.zip
cp
-r
dist/static static
cp
-r
dist/static vue-permission/static
fi
pid_file
=
$nginxPath
"logs/nginx.pid"
if
[
!
-e
"
$pid_file
"
]
;
then
/usr/local/nginx/sbin/nginx
fi
if
[
-e
"
$pid_file
"
]
;
then
/usr/local/nginx/sbin/nginx
-s
reload
fi
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/deploy-sh.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/sh
echo
'---------------kill_start----------------'
params1
=
$1
echo
"pramas1:"
$params1
command
=
$(
cat
updowncommand.txt
)
echo
'command:'
$command
if
[
-z
"
$params1
"
]
;
then
command
=
'start'
echo
'command reset value:'
$command
fi
if
[
"
$params1
"
=
"stop"
]
;
then
command
=
'stop'
echo
'command params value:'
$command
fi
KILL_PROCESS_NAME
=
'${deployPath}/${deployJar}'
PROCESS_ID
=
`
ps
-ef
|
grep
$KILL_PROCESS_NAME
|
grep
-v
'grep'
|
awk
'{print $2}'
`
echo
'ProcessId: '
$PROCESS_ID
for
id
in
$PROCESS_ID
do
echo
'KILL_ID: '
$id
kill
-s
9
$id
done
echo
'---------------killed_stop----------------'
if
[
"
$command
"
!=
"stop"
]
;
then
echo
'---------------start----------------'
nohup
/usr/local/java/jdk1.8/bin/java
-Xms256m
-Xmx256m
-jar
$KILL_PROCESS_NAME
--server
.port
=
${
port
}
--spring
.profiles.active
=
${
springProfilesActive
}
>
/dev/null 2>&1 &
echo
'---------------started----------------'
for
i
in
{
1..30
}
;
do
sleep
1
tail
-n5
${
deployPath
}
/logs/loit-
${
serviceName
}
.log
done
fi
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/deploy-web-sh.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/sh
params1
=
$1
command
=
$(
cat
updowncommand.txt
)
echo
'command:'
$command
if
[
-z
"
$params1
"
]
;
then
command
=
"start"
echo
'command reset value:'
$command
fi
if
[
"
$params1
"
=
"stop"
]
;
then
command
=
"stop"
echo
'command params value:'
$command
fi
nginxConf
=
"/
${
nginxConfigName
}
"
nginxPath
=
"/usr/local/nginx/"
startPath
=
$nginxPath
'conf/conf.d.start'
startConf
=
$startPath$nginxConf
stopPath
=
$nginxPath
'conf/conf.d.stop'
stopConf
=
$stopPath$nginxConf
echo
'startConf:'
$startConf
if
[
"
$command
"
=
"stop"
]
;
then
echo
'test'
if
[
-e
"
$startConf
"
]
;
then
echo
'copy to stop file'
mv
$startConf
$stopPath
fi
fi
if
[
"
$command
"
!=
"stop"
]
;
then
if
[
-e
"
$stopConf
"
]
;
then
echo
'copy to start file'
mv
$stopConf
$startPath
fi
cd
${
deployPath
}
rm
-rf
dist/
rm
-rf
${
serviceNameAbb
}
/
mkdir
-p
${
serviceNameAbb
}
/dist
unzip dist
*
.zip
cp
-r
dist/
*
${
serviceNameAbb
}
/dist
cp
-r
dist/static
${
serviceNameAbb
}
/
fi
pid_file
=
$nginxPath
"logs/nginx.pid"
if
[
!
-e
"
$pid_file
"
]
;
then
/usr/local/nginx/sbin/nginx
fi
if
[
-e
"
$pid_file
"
]
;
then
/usr/local/nginx/sbin/nginx
-s
reload
fi
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/gateway.ftl
0 → 100644
浏览文件 @
4442415b
- id: loit-${serviceName}
uri: lb://loit-${serviceName}
predicates:
- Path=/api-${serviceName}/**
filters:
- StripPrefix=1
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/hlw-nginx-upstream.ftl
0 → 100644
浏览文件 @
4442415b
upstream sone.${serviceNameSub}.${backendFrontType} {
server 192.169.201.191:80 weight=5 max_fails=5 fail_timeout=30s;
server 192.169.201.111:80 weight=5 max_fails=5 fail_timeout=30s;
server 192.169.201.184:80 weight=5 max_fails=5 fail_timeout=30s;
}
location /${serviceNameAbb} {
proxy_pass http://sone.${serviceNameSub}.${backendFrontType};
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/logstash-conf.ftl
0 → 100644
浏览文件 @
4442415b
input {
file {
path => [
<#list mapList as item>
"${item.deployPath}/logs/loit-${item.serviceName}.log"<#if item_has_next>,</#if>
</#list>
]
discover_interval => 15
stat_interval => 1
codec => multiline {
pattern => "^\["
negate => true
what => "previous"
charset => "UTF-8"
}
type => "elasticsearch"
start_position => "beginning"
}
}
filter {
# pattern matching logback pattern
grok {
match => {
"message" => "\[%{TIMESTAMP_ISO8601:exeTime}\]\s+%{DATA:appName}\s+\[%{DATA:reqInfo}\]\s+\[%{DATA:userId}\]\s+\[%{DATA:thread}\]\s+%{LOGLEVEL:logLevel}\s+%{DATA:class}\s+-\s+%{GREEDYDATA:msg}"
}
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => ["10.0.120.212:9200","10.0.120.44:9200","10.0.120.143:9200"]
index => "loit${esindex}-%{+YYYY.MM}-%{+xxxx.ww}"
}
}
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/logstash-start.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/sh
echo
'---------------start logstash portal----------------'
mkdir
-p
/home/soft/logstash/
${
folderName
}
nohup
/usr/local/logstash-6.4.3/bin/logstash
--path
.data
=
/home/soft/logstash/
${
folderName
}
-f
/home/soft/elkconfig/
${
fileName
}
>
/dev/null 2>&1 &
echo
'---------------end start logstash portal----------------'
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/logstash-stop.ftl
0 → 100644
浏览文件 @
4442415b
#!/bin/sh
echo
'---------------kill_${fileName}----------------'
KILL_PROCESS_NAME
=
'/home/soft/elkconfig/${fileName}'
PROCESS_ID
=
`
ps
-ef
|
grep
$KILL_PROCESS_NAME
|
grep
-v
'grep'
|
awk
'{print $2}'
`
echo
'ProcessId: '
$PROCESS_ID
for
id
in
$PROCESS_ID
do
echo
'KILL_ID: '
$id
kill
-s
9
$id
done
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/nginx_config.ftl
0 → 100644
浏览文件 @
4442415b
server{
listen ${port};
server_name localhost;
gzip on;
gzip_buffers 32 4K;
gzip_comp_level 6;
gzip_min_length 100;
gzip_types application/javascript text/css text/xml;
gzip_vary on;
server_tokens off;
location /{
root ${deployPath}/;
try_files $uri $uri/ =404;
index index.html;
}
}
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/preView/zww-nginx-upstream.ftl
0 → 100644
浏览文件 @
4442415b
upstream sone.${serviceNameSub}.gray.${backendFrontType} {
least_conn;
<#list grayList as gray>
server ${gray} weight=5 max_fails=5 fail_timeout=30s;
</#list>
}
upstream sone.${serviceNameSub}.normal.${backendFrontType} {
least_conn;
<#list normalList as normal>
server ${normal} weight=5 max_fails=5 fail_timeout=30s;
</#list>
}
upstream sone.${serviceNameSub}.all.${backendFrontType} {
<#list grayList as gray>
server ${gray} weight=5 max_fails=5 fail_timeout=30s;
</#list>
<#list normalList as normal>
server ${normal} weight=5 max_fails=5 fail_timeout=30s;
</#list>
}
location /${serviceNameAbb} {
set $gray_url "";
set $gray_url $cookie_${serviceNameCookie}_fronturl;
proxy_set_header HOST $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ($gray_url = "none") {
return 404;
}
if ($gray_url = "normal"){
proxy_pass http://sone.${serviceNameSub}.normal.${backendFrontType};
}
if ($gray_url = "gray"){
proxy_pass http://sone.${serviceNameSub}.gray.${backendFrontType};
}
if ($gray_url ~* ^(.*?)\.(.*?)\.(.*?)$){
proxy_pass http://$gray_url;
}
if ($gray_url = ''){
proxy_pass http://sone.${serviceNameSub}.all.${backendFrontType};
}
}
loit-build-component/loit-build-deploy-env/src/main/resources/template/sh/product/nginx_config.ftl
浏览文件 @
4442415b
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
gzip_types application/javascript text/css text/xml;
gzip_types application/javascript text/css text/xml;
gzip_vary on;
gzip_vary on;
server_tokens off;
location /{
location /{
root ${deployPath}/;
root ${deployPath}/;
try_files $uri $uri/ =404;
try_files $uri $uri/ =404;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论