2
2
3
3
set -e
4
4
5
- # Define the relative path of API src and dst
6
- API_PATHS_MAP=(
7
- " apis/analysis:analysis"
8
- " apis/config:config"
9
- " apis/configuration:configuration"
10
- " apis/extension:extension"
11
- " apis/quota:quota"
12
- " apis/runtime:runtime"
13
- " apis/scheduling:scheduling"
14
- " apis/scheme:scheme"
15
- " apis/slo:slo"
16
- " apis/thirdparty:thirdparty"
17
- )
5
+ API_MAP_FILE_DIR=$( cd $( dirname $0 ) ; pwd )
6
+ API_MAP_FILE_PATH=" ${API_MAP_FILE_DIR} /api-files.sh"
7
+ source ${API_MAP_FILE_PATH}
18
8
19
9
help () {
20
10
echo " command format error, usage example"
21
11
echo " $0 \$ {koordinator_version_tag}"
22
12
}
23
13
24
- KOORDINATOR_REPO=" https://github.com/koordinator-sh/koordinator.git"
14
+ KOORDINATOR_REPO=${ENV_KOORDINATOR_REPO}
15
+
16
+ if [ -z " ${KOORDINATOR_REPO} " ]; then
17
+ KOORDINATOR_REPO=" https://github.com/koordinator-sh/koordinator.git"
18
+ fi
19
+
25
20
VERSION_TAG=" $1 "
26
21
if [[ -z ${VERSION_TAG} ]]; then
27
22
help
@@ -81,6 +76,14 @@ function remove_outdated_api_files() {
81
76
done
82
77
}
83
78
79
+ echo " >> remove excluded files from ${KOORDINATOR_REPO_DIR} "
80
+ for excluded_path in " ${EXCLUDED_PATHS[@]} " ;
81
+ do
82
+ rm_path=" ${KOORDINATOR_REPO_DIR} /${excluded_path} "
83
+ rm -rf ${rm_path}
84
+ echo " >> remove excluded file" ${rm_path}
85
+ done
86
+
84
87
API_REPO_DIR=$( cd $( dirname $0 ) /..; pwd )
85
88
86
89
echo " >> copy apis files from" ${KOORDINATOR_REPO_DIR}
90
93
dst_relative_path=" ${api_path_pair##*: } "
91
94
copy_api_files ${KOORDINATOR_REPO_DIR} /${src_relative_path} ${API_REPO_DIR} /${dst_relative_path}
92
95
remove_outdated_api_files ${KOORDINATOR_REPO_DIR} /${src_relative_path} ${API_REPO_DIR} /${dst_relative_path}
93
- done
96
+ done
0 commit comments