11#! /bin/bash
2+ set -x
23
34CLI=/apim-cli-1.5.1/scripts/apim.sh
45
5- echo " Run APIM-CLI with arguments: $@ "
6-
7- printenv
8-
9- $CLI
6+ apimCLIArgs=" -h ${INPUT_APIMHOSTNAME} -u ${INPUT_APIMUSERNAME} -p ${INPUT_APIMPASSWORD} ${INPUT_APIMEXTRAARGS} "
107
118# Import all users
129if ! [ -z ${INPUT_USERDIRECTORY} ]; then
@@ -15,7 +12,7 @@ if ! [ -z ${INPUT_USERDIRECTORY} ];then
1512 for userDirectory in ` find . -mindepth 1 -type d`
1613 do
1714 echo " Import user from config: $userDirectory "
18- $CLI user import -s ${APIM_CLI_STAGE } -c ${userDirectory} /user-config.json
15+ $CLI user import ${apimCLIArgs } -c ${userDirectory} /user-config.json
1916 done
2017fi
2118
@@ -26,7 +23,7 @@ if ! [ -z ${INPUT_ORGDIRECTORY} ];then
2623 for orgDirectory in ` find . -mindepth 1 -type d`
2724 do
2825 echo " Import organization from config: $orgDirectory "
29- $CLI org import -s ${APIM_CLI_STAGE } -c ${orgDirectory} /org-config.json
26+ $CLI org import ${apimCLIArgs } -c ${orgDirectory} /org-config.json
3027 done
3128fi
3229
@@ -37,7 +34,7 @@ if ! [ -z ${INPUT_APPDIRECTORY} ];then
3734 for appDirectory in ` find . -mindepth 1 -type d`
3835 do
3936 echo " Import applicaton from config directory: $appDirectory "
40- $CLI app import -s ${APIM_CLI_STAGE } -c ${appDirectory} /application-config.json
37+ $CLI app import ${apimCLIArgs } -c ${appDirectory} /application-config.json
4138 done
4239fi
4340
@@ -48,7 +45,7 @@ if ! [ -z ${INPUT_APIDIRECTORY} ];then
4845 for apiDirectory in ` find . -mindepth 1 -type d`
4946 do
5047 echo " Import API from config directory: $apiDirectory "
51- $CLI api import -s ${APIM_CLI_STAGE } -c ${apiDirectory} /api-config.json -force
48+ $CLI api import ${apimCLIArgs } -c ${apiDirectory} /api-config.json -force
5249 done
5350fi
5451
0 commit comments