@@ -9,35 +9,46 @@ printenv
99$CLI
1010
1111# Import all users
12- cd ${cliData} /Users || exit 99;
13- for userDirectory in ` find . -mindepth 1 -type d`
14- do
15- echo " Import user from config: $orgDirectory "
16- $CLI user import -s ${APIM_CLI_STAGE} -c ${cliData} /Organizations/$orgDirectory /org-config.json
17- done
12+ if [ ${INPUT_USERDIRECTORY} != " " ]; then
13+ echo " Importing users from directory: '${INPUT_USERDIRECTORY} '"
14+ cd ${INPUT_USERDIRECTORY} || exit 99;
15+ for userDirectory in ` find . -mindepth 1 -type d`
16+ do
17+ echo " Import user from config: $userDirectory "
18+ $CLI user import -s ${APIM_CLI_STAGE} -c ${userDirectory} /user-config.json
19+ done
20+ fi
1821
1922# Import all organizations
20- cd ${cliData} /Organizations || exit 99;
21- for orgDirectory in ` find . -mindepth 1 -type d`
22- do
23- echo " Import organization from config: $orgDirectory "
24- $CLI org import -s ${APIM_CLI_STAGE} -c ${cliData} /Organizations/$orgDirectory /org-config.json
25- done
23+ if [ ${INPUT_ORGDIRECTORY} != " " ]; then
24+ echo " Importing organizations from directory: '${INPUT_ORGDIRECTORY} '"
25+ cd ${INPUT_ORGDIRECTORY} || exit 99;
26+ for orgDirectory in ` find . -mindepth 1 -type d`
27+ do
28+ echo " Import organization from config: $orgDirectory "
29+ $CLI org import -s ${APIM_CLI_STAGE} -c ${orgDirectory} /org-config.json
30+ done
31+ fi
2632
2733# Import all applications
28- cd ${cliData} /ClientApps || exit 99;
29- for appDirectory in ` find . -mindepth 1 -type d`
30- do
31- echo " Import applicaton from config directory: $appDirectory "
32- $CLI app import -s ${APIM_CLI_STAGE} -c ${cliData} /ClientApps/$appDirectory /application-config.json
33- done
34+ if [ ${INPUT_APPDIRECTORY} != " " ]; then
35+ echo " Importing applications from directory: '${INPUT_APPDIRECTORY} '"
36+ cd ${INPUT_APPDIRECTORY} || exit 99;
37+ for appDirectory in ` find . -mindepth 1 -type d`
38+ do
39+ echo " Import applicaton from config directory: $appDirectory "
40+ $CLI app import -s ${APIM_CLI_STAGE} -c ${appDirectory} /application-config.json
41+ done
42+ fi
3443
3544# Import all APIs
36- cd ${cliData} /APIs || exit 99;
45+ if [ ${INPUT_APIDIRECTORY} != " " ]; then
46+ echo " Importing APIs from directory: '${INPUT_APIDIRECTORY} '"
47+ cd ${INPUT_APIDIRECTORY} || exit 99;
3748for apiDirectory in ` find . -mindepth 1 -type d`
3849do
3950 echo " Import API from config directory: $apiDirectory "
40- $CLI api import -s ${APIM_CLI_STAGE} -c ${cliData} /APIs/ $ apiDirectory /api-config.json -force
51+ $CLI api import -s ${APIM_CLI_STAGE} -c ${apiDirectory} /api-config.json -force
4152done
4253
4354exit
0 commit comments