1 Star 0 Fork 10

云孟/anolis-ci-test

forked from anolis/anolis-ci-test 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run_package_citest.sh 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
zhangtaibo.ztb 提交于 2024-07-04 19:58 . disable anolis23_ai_repo
#!/bin/sh
# Usage:
# export PKG_CI_REPO_URL=<git_repo_url>
# export PKG_CI_REPO_BRANCH=<git_branch>
# export PKG_CI_PR_ID=<pull_request_id>
#
# Notes:
# PKG_CI_REPO_URL is url of the target git repo
# PKG_CI_REPO_BRANCH is branch of the target git repo
#
# #Get help list:
# ./run_package_citest.sh -h
# #Run a single test:
# ./run_package_citest.sh -t check_license
# #Run several tests:
# ./run_package_citest.sh -t check_license -t check_specfile
. ./lib/lib.sh
[ -n "$1" ] || { usage; exit 0; }
# parse args
test_list=""
while getopts "ht:" opt; do
case ${opt} in
t)
test_list="$test_list $OPTARG"
;;
h)
usage && exit 0
;;
\?)
echo "Invalid option: $OPTARG" 1>&2
;;
esac
done
shift $((OPTIND -1))
[ -n "$test_list" ] || die "No test case is specified, use '$0 -t casename'"
# main process
[ -n "$PKG_CI_REPO_URL" ] || die "PKG_CI_REPO_URL is required but not set!"
[ -n "$PKG_CI_REPO_BRANCH" ] || die "PKG_CI_REPO_BRANCH is required but not set!"
[ -n "$PKG_CI_PR_ID" ] || die "PKG_CI_PR_ID is required but not set!"
work_dir=$(readlink -f work_dir)
[ -d "$work_dir" ] || mkdir $work_dir
util_dir=$(readlink -f utils)
pkg_name=$(basename $PKG_CI_REPO_URL .git)
pkg_path="$work_dir/$pkg_name"
pr_branch="pull-request-${PKG_CI_PR_ID}"
ret=0
os_version=$(cat /etc/os-release | grep ID= |awk -F'"' '{print $2}'|xargs)
# if echo $os_version | grep "anolis 23"; then
# # creat_anolis23_build_repo
# create_anolis23_ai_repo
# fi
if echo $os_version | grep "anolis 8"; then
create_anolis8_ai_repo
fi
for t in $test_list; do
echo "====Run Test: $t"
$t
done
exit $ret
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yunmeng365524/anolis-ci-test.git
[email protected]:yunmeng365524/anolis-ci-test.git
yunmeng365524
anolis-ci-test
anolis-ci-test
master

搜索帮助