提交 4442415b authored 作者: chenshiying's avatar chenshiying

[新增] 演示环境配置

上级 8d3e064a
# 初始化脚本步骤
服务器(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
```
# 初始化脚本步骤
服务器(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
```
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
......@@ -14,7 +14,12 @@ public enum BuildEnvEnum {
/**
* 准生产
*/
PRE_PRODUCT("preProduct", "准生产");
PRE_PRODUCT("preProduct", "准生产"),
/**
* 演示环境
*/
PRE_VIEW("preView", "演示环境");
private String code;
......
curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -d "@config.xml" http://192.168.111.106:12012/createItem?name=${deployJobName}
<?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 &quot;###################begin start#############&quot;
echo &apos;deployName:&apos; + $deployName
echo &apos;modelServiceName:&apos; + $modelServiceName
echo &apos;modelVersion:&apos; + $modelVersion
echo &apos;projectCode:&apos; + $projectCode
echo &apos;status:&apos;+ $status
echo &quot;###################end print#############&quot;
echo &quot;###################begin write#############&quot;
rm -rf updowncommand.txt
echo $status &gt; updowncommand.txt
echo &quot;###################end write###############&quot;
ls -la
if [ &quot;$status&quot; = &quot;deploy&quot; ]; then
rm -rf $deployName
destDir=&quot;/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}/${r"${"}deployName}&quot;
echo &apos;destDir:&apos; + $destDir
# copy jar to jenkins container
scp root@192.168.111.106:$destDir .
echo &quot;################### jar file#############&quot;
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>
<?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 &quot;###################begin start#############&quot;
echo &apos;deployName:&apos; + $deployName
echo &apos;modelServiceName:&apos; + $modelServiceName
echo &apos;modelVersion:&apos; + $modelVersion
echo &apos;projectCode:&apos; + $projectCode
echo &apos;status:&apos;+ $status
echo &quot;###################end print#############&quot;
echo &quot;###################begin write#############&quot;
rm -rf updowncommand.txt
echo $status &gt; updowncommand.txt
echo &quot;###################end write###############&quot;
ls -la
if [ &quot;$status&quot; = &quot;deploy&quot; ]; then
rm -rf $deployName
destDir=&quot;/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}/${r"${"}deployName}&quot;
echo &apos;destDir:&apos; + $destDir
# copy jar to jenkins container
scp root@192.168.111.106:$destDir .
tempFileName=&quot;${r"${"}deployName}.temp&quot;
rm -rf tempFileName
echo &quot;###################rename zip#############&quot;
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>
curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -d "@config.xml" http://192.169.200.175:12012/createItem?name=${deployJobName}
<?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 &quot;###################print param begin#############&quot;
echo &apos;jarFile:&apos; + $jarFile
echo &apos;modelServiceName:&apos; + $modelServiceName
echo &apos;modelVersion:&apos; + $modelVersion
echo &apos;projectCode:&apos; + $projectCode
echo &quot;################### print param end#############&quot;
if [ -z &quot;$jarFile&quot; ]; then
echo &apos;jarFile must not be empty&apos;
exit -1
fi
if [ -z &quot;$modelServiceName&quot; ]; then
echo &apos;modelServiceName must not be empty&apos;
exit -1
fi
if [ -z &quot;$modelVersion&quot; ]; then
echo &apos;modelVersion must not be empty&apos;
exit -1
fi
if [ -z &quot;$projectCode&quot; ]; then
echo &apos;projectCode must not be empty&apos;
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 &quot;##################create remote dir#############&quot;
destDir=&quot;/home/version/push-jar/${r"${"}projectCode}/${r"${"}modelServiceName}/${r"${"}modelVersion}&quot;
ssh root@10.0.120.13 &quot;
pwd &amp;&amp;
mkdir -p $destDir &amp;&amp;
ls -la $destDir&quot;
echo &quot;##################pushing jar begin#############&quot;
scp -r $fileName root@10.0.120.13:$destDir
echo &quot;###################pushing jar end#############&quot;</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>
......@@ -9,6 +9,8 @@
gzip_types application/javascript text/css text/xml;
gzip_vary on;
server_tokens off;
location /{
root ${deployPath}/;
try_files $uri $uri/ =404;
......
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
#!/bin/bash
\cp -rf /home/soft/nginxConfig/* /usr/local/nginx/conf/conf.d.start/
#!/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
#!/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
#!/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
- id: loit-${serviceName}
uri: lb://loit-${serviceName}
predicates:
- Path=/api-${serviceName}/**
filters:
- StripPrefix=1
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;
}
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}"
}
}
#!/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----------------'
#!/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
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;
}
}
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};
}
}
......@@ -9,6 +9,8 @@
gzip_types application/javascript text/css text/xml;
gzip_vary on;
server_tokens off;
location /{
root ${deployPath}/;
try_files $uri $uri/ =404;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论