11#! /bin/bash
2- set -x
32
43CLI=/apim-cli-1.5.1/scripts/apim.sh
54
@@ -9,9 +8,10 @@ apimCLIArgs="-h ${INPUT_APIMHOSTNAME} -u ${INPUT_APIMUSERNAME} -p ${INPUT_APIMPA
98if ! [ -z ${INPUT_USERDIRECTORY} ]; then
109 echo " Importing users from directory: '${INPUT_USERDIRECTORY} '"
1110 cd ${INPUT_USERDIRECTORY} || exit 99;
11+ echo " Import all Users from the following directories containing a file user-config.json:"
12+ ls -1
1213 for userDirectory in ` find . -mindepth 1 -type d`
1314 do
14- echo " Import user from config: $userDirectory "
1515 $CLI user import ${apimCLIArgs} -c ${userDirectory} /user-config.json
1616 done
1717fi
2020if ! [ -z ${INPUT_ORGDIRECTORY} ]; then
2121 echo " Importing organizations from directory: '${INPUT_ORGDIRECTORY} '"
2222 cd ${INPUT_ORGDIRECTORY} || exit 99;
23+ echo " Import all Organization from the following directories containing a file org-config.json:"
24+ ls -1
2325 for orgDirectory in ` find . -mindepth 1 -type d`
2426 do
25- echo " Import organization from config: $orgDirectory "
2627 $CLI org import ${apimCLIArgs} -c ${orgDirectory} /org-config.json
2728 done
2829fi
3132if ! [ -z ${INPUT_APPDIRECTORY} ]; then
3233 echo " Importing applications from directory: '${INPUT_APPDIRECTORY} '"
3334 cd ${INPUT_APPDIRECTORY} || exit 99;
35+ echo " Import all Applications from the following directories containing a file application-config.json:"
36+ ls -1
3437 for appDirectory in ` find . -mindepth 1 -type d`
3538 do
36- echo " Import applicaton from config directory: $appDirectory "
3739 $CLI app import ${apimCLIArgs} -c ${appDirectory} /application-config.json
3840 done
3941fi
4244if ! [ -z ${INPUT_APIDIRECTORY} ]; then
4345 echo " Importing APIs from directory: '${INPUT_APIDIRECTORY} '"
4446 cd ${INPUT_APIDIRECTORY} || exit 99;
47+ echo " Import all APIs from the following directories containing a file api-config.json:"
48+ ls -1
4549 for apiDirectory in ` find . -mindepth 1 -type d`
4650 do
47- echo " Import API from config directory: $apiDirectory "
4851 $CLI api import ${apimCLIArgs} -c ${apiDirectory} /api-config.json -force
4952 done
5053fi
0 commit comments