linux-tutorial/codes/git/startup.sh
2017-12-08 18:44:20 +08:00

28 lines
710 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
export LANG="zh_CN.UTF-8"
export JAVA_HOME=/opt/software/jdk1.8.0_121
##############################__MAIN__########################################
# 0. 检查传入的参数
repository=`echo $1`
branch=`echo $2`
target=`echo $3`
if [ "${repository}" == "" ] || [ "${branch}" == "" ];
then
echo "用法repository branch target"
echo " repository: git仓储。"
echo " branch: git分支。"
echo " target: 代码存放目录。可选参数,默认为脚本所在目录。"
exit 0
fi
# 1. 更新代码
sh update-code.sh ${repository} ${branch} ${target}
# 2. 编译
cd ${target}/codes
echo "编译开始"
mvn clean package -Dmaven.test.skip=true
echo "编译结束"