Shell 脚本

./sh + 目录A + 目录B(A B是父子目录)

./file_name.sh + 父目录 + 子目录
file_name.sh所在目录与{父目录}是平行目录
目录内文件
xxlbuild
xxl-build.sh
xxl-config.sh

xxlbuild 文件内容如下

[weblogic@localhost version]$ pwd
/tools/SPH_ERP/version
[weblogic@localhost version]$ cat xxlbuild 
./xxl-build.sh Cert 1.0.0.1000001_Beta

xxl-build.sh 文件内容如下

[weblogic@localhost version]$ cat xxl-build.sh 
#!/bin/bash

vtype=$1;
version=$2;
if [ ! -n "$vtype" ]; then
  echo "vtype must be input!!!"
  exit
fi
if [ ! -n "$version" ]; then
  echo "version must be input!!!"
  exit
fi

.  ./clean.sh $vtype $version
.  ./update.sh $vtype $version
.  ./xxl-config.sh $vtype $version

mvn -B -f /tools/SPH_ERP/$vtype/$version/default/pom-for-tomcat.xml clean package | tee /tools/Maven/maven_build_erp_xxl_`date +%Y%m%d_%H%M%S`.log

if [  -f "/tools/SPH_ERP/$vtype/$version/default/targetTomcat/default.war" ];then
  echo "file default.war exists, xxl job build success!"
else
  echo "file default.war not exists, xxl job build failed!"
  exit
fi

scp /tools/SPH_ERP/$vtype/$version/default/targetTomcat/default.war [email protected]:/tools/SPH_ERP/deploy
exit 0

其中,内容处的 vtype=$1; version=$2; 相当于接收入参(./xxl-build.sh Cert 1.0.0.1000001_Beta) vtype 对应于 Cert ,version 对应于1.0.0.1000001_Beta
xxl-build.sh路径是 /tools/SPH_ERP/version

/tools/SPH_ERP/Cert/1.0.0.1000001_Beta/项目内容

你可能感兴趣的:(git,服务器,javascript)