The command does not exit with 0 when the exit code is 10. This while the option to remap this has been specified. This happens for example when there are no changes found with the following warning:
2024-09-02 08:44:22,197 [APIManagerCLI] INFO : API-Manager CLI: 1.14.5
[20](redacted/-/jobs/81897#L20)24-09-02 08:44:22,200 [APIManagerCLI] INFO : Module: Organization - E X P O R T / U T I L S (1.14.5)
2024-09-02 08:44:23,507 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20240530) on: [redacted](redacted)
2024-09-02 08:44:25,964 [OrganizationApp] INFO : You may enable debug to get more details. See: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug
2024-09-02 08:44:25,965 [OrganizationApp] WARN : No changes detected between Desired- and Actual-Org: Example client org name.
We get ERROR: Job failed: command terminated with exit code 10 in our CI and can also validate the same behaviour locally when running echo $?
The -returnCodeMapping option does seem to work when using it in for example apim api import
2024-09-02 08:44:22,197 [APIManagerCLI] INFO : API-Manager CLI: 1.14.5
[20](redacted/-/jobs/81897#L20)24-09-02 08:44:22,200 [APIManagerCLI] INFO : Module: Organization - E X P O R T / U T I L S (1.14.5)
2024-09-02 08:44:23,507 [APIManagerAdapter] INFO : Successfully connected to API-Manager (7.7.20240530) on: [redacted](redacted)
2024-09-02 08:44:25,964 [OrganizationApp] INFO : You may enable debug to get more details. See: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug
2024-09-02 08:44:25,965 [OrganizationApp] WARN : No changes detected between Desired- and Actual-Org: Example client org name.
APIM-CLI version
1.14.5
API-Management version
7.7.20240530
Bug description
When using the following command:
apim org import -username $APIMGR_USERNAME -password $APIMGR_PASSWORD -apimanagerUrl $APIMGR_URL -s $CI_COMMIT_BRANCH -c ./${PROJECT_DIR}/client-organizations/Example-client-org-name/org-config.yaml -returnCodeMapping 10:0
The command does not exit with 0 when the exit code is 10. This while the option to remap this has been specified. This happens for example when there are no changes found with the following warning:
We get
ERROR: Job failed: command terminated with exit code 10
in our CI and can also validate the same behaviour locally when runningecho $?
The -returnCodeMapping option does seem to work when using it in for example
apim api import
Steps to reproduce
apim org import -username $APIMGR_USERNAME -password $APIMGR_PASSWORD -apimanagerUrl $APIMGR_URL -s $CI_COMMIT_BRANCH -c ./${PROJECT_DIR}/client-organizations/Example-client-org-name/org-config.yaml -returnCodeMapping 10:0
Relevant log output