Skip to content

Commit 0e8b8cb

Browse files
author
Chris Wiechmann
committed
Added the option to use a custom command
1 parent 37201c4 commit 0e8b8cb

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ inputs:
3030
userDirectory:
3131
description: "The directory containing your users. Each user in a separate directory."
3232
required: false
33-
apimCLIVersion:
34-
description: "If you would like to use a different APIM-CLI version than the default used by the action. Format is: x.y.z"
33+
apimCLICommand:
34+
description: "Control the APIM-CLI command yourself. For example: 'apim api check-certs'. You may combine this with apimExtraArgs depending on you the command you use."
3535
required: false
3636
runs:
3737
using: "docker"

entrypoint.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/bin/bash
22

3-
if ! [ -z ${INPUT_APIMCLIVERSION} ];then
4-
echo "Downloading specified APIM-CLI version: ${INPUT_APIMCLIVERSION}"
5-
curl -qO- https://github.com/Axway-API-Management-Plus/apim-cli/releases/download/apimcli-${INPUT_APIMCLIVERSION}/axway-apimcli-${INPUT_APIMCLIVERSION}.tar.gz | tar xvfz - -C /
6-
CLI=/apim-cli-${INPUT_APIMCLIVERSION}/scripts/apim.sh
7-
else
8-
CLI=/apim-cli-1.5.1/scripts/apim.sh
9-
fi
10-
3+
CLI=/apim-cli-1.5.1/scripts/apim.sh
114
apimCLIArgs="-h ${INPUT_APIMHOSTNAME} -u ${INPUT_APIMUSERNAME} -p ${INPUT_APIMPASSWORD} ${INPUT_APIMEXTRAARGS}"
125

6+
if ! [ -z ${INPUT_APIMCLICOMMAND} ];then
7+
echo "Calling APIM-CLI with given command: ${INPUT_APIMCLICOMMAND}"
8+
$CLI ${INPUT_APIMCLICOMMAND} ${apimCLIArgs} || exit 99;
9+
exit
10+
fi
11+
1312
# Import all users
1413
if ! [ -z ${INPUT_USERDIRECTORY} ];then
1514
echo "Importing users from directory: '${INPUT_USERDIRECTORY}'"

0 commit comments

Comments
 (0)