feat(cli): 增加服务分组方便批量启停服务
服务可以分在多个分组里
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
<#list services as service>
|
||||
${currentPath}/deploy-${service}.sh
|
||||
</#list>
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
<#list services as service>
|
||||
${currentPath}/stop-${service}.sh
|
||||
</#list>
|
||||
@@ -16,7 +16,7 @@ security_darkcode='${runtime.security.darkcode}'
|
||||
<#list hosts as host>
|
||||
host=${host.ip}
|
||||
echo "${info.name} ${host.ip} ${host.hostname} $datetime"
|
||||
ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar
|
||||
ssh $host 'bash -s' < ${currentPath}/stop.sh ${runtime.jarPath}/${info.name}.jar
|
||||
<#if selectedHosts?seq_contains(host.ip)>
|
||||
hostname=`ssh $host 'hostname'`
|
||||
hostname_full=`ssh $host 'hostname -f'`
|
||||
|
||||
@@ -13,5 +13,5 @@ for host in <#noparse>${hosts[@]}</#noparse>
|
||||
do
|
||||
hostname=`ssh $host 'echo $HOSTNAME'`
|
||||
echo "$host $hostname"
|
||||
ssh $host "cat ${runtime.logPath}/${info.name}.log" > logs/${info.name}/$hostname.log
|
||||
ssh $host "cat ${runtime.logPath}/${info.name}.log" > ${currentPath}/logs/${info.name}/$hostname.log
|
||||
done
|
||||
|
||||
@@ -10,5 +10,5 @@ for host in <#noparse>${hosts[@]}</#noparse>
|
||||
do
|
||||
hostname=`ssh $host 'echo $HOSTNAME'`
|
||||
echo "$host $hostname"
|
||||
ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar
|
||||
ssh $host 'bash -s' < ${currentPath}/stop.sh ${runtime.jarPath}/${info.name}.jar
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user