@@ -23,6 +23,19 @@ if [[ -z ${OAS_API_VERSIONS} ]]; then
2323 OAS_API_VERSIONS=" ${ROOT_DIR} /api-versions-lock.json"
2424fi
2525
26+ if [ -d " ${ROOT_DIR} /oas" ]; then
27+ echo " OAS folder found. Will be removed"
28+ rm -rf " ${ROOT_DIR} /oas"
29+ fi
30+
31+ git clone " ${OAS_REPO} " " ${ROOT_DIR} /oas" --quiet
32+ # OPTIONAL: Lock to a specific commit
33+ # cd "${ROOT_DIR}/oas"
34+ # git checkout <HASH>
35+
36+ # NOTE: Everything below is needed for the "compatibility layer" logic.
37+ # It can be completely removed once the compatibility layer isn't needed anymore in the SDK.
38+
2639# Create temp directory to clone OAS repo
2740work_dir=$( mktemp -d)
2841if [[ ! ${work_dir} || -d {work_dir} ]]; then
@@ -31,13 +44,7 @@ if [[ ! ${work_dir} || -d {work_dir} ]]; then
3144fi
3245trap " rm -rf ${work_dir} " EXIT # Delete temp directory on exit
3346
34- if [ -d " ${ROOT_DIR} /oas" ]; then
35- echo " OAS folder found. Will be removed"
36- rm -r " ${ROOT_DIR} /oas"
37- fi
38-
39- # Move oas to root level
40- mkdir " ${ROOT_DIR} /oas"
47+ mkdir " ${ROOT_DIR} /oas/legacy"
4148cd " ${work_dir} "
4249git clone " ${OAS_REPO} " --quiet
4350
6774 service_normalized=$( echo " ${service_normalized} " | tr ' [:upper:]' ' [:lower:]' ) # convert upper case letters to lower case
6875 service_normalized=$( echo " ${service_normalized} " | tr -d -c ' [:alnum:]' ) # remove non-alphanumeric characters
6976 echo " $service_normalized =$( git rev-parse HEAD) " >> oas_commits
70- # To support initial integrations of the IaaS API in an Alpha state, we will temporarily use it to generate an IaaS Alpha SDK module
71- # This check can be removed once the IaaS API moves all endpoints to Beta
72- if [[ ${service_normalized} == " iaas" ]]; then
73- echo " iaasalpha=$( git rev-parse HEAD) " >> oas_commits
74- fi
7577
7678 cd - > /dev/null
7779
8890 version=${version# v}
8991 # Check if version is alpha
9092 if [[ ${version} == * alpha* ]]; then
91- # To support initial integrations of the IaaS API in an Alpha state, we will temporarily use it to generate an IaaS Alpha SDK module
92- # This check can be removed once the IaaS API moves all endpoints to Beta
93- if [[ ${service} == " iaas" ]]; then
94- mv -f ${dir} /* .json ${ROOT_DIR} /oas/iaasalpha.json
95- continue
96- fi
9793 if [[ ${ALLOW_ALPHA} != " true" ]]; then
9894 continue
9995 fi
135131 echo " No elegible OAS found for ${service_dir} "
136132 continue
137133 fi
138- mv -f ${max_version_dir} /* .json ${ROOT_DIR} /oas
134+ mv -f ${max_version_dir} /* .json ${ROOT_DIR} /oas/legacy
139135done
140- mv -f ${work_dir} /${OAS_REPO_NAME} /oas_commits ${ROOT_DIR} /oas/oas_commits
136+ mv -f ${work_dir} /${OAS_REPO_NAME} /oas_commits ${ROOT_DIR} /oas/legacy/ oas_commits
0 commit comments