adobe / aio-cli-plugin-aem-rde

Apache License 2.0
4 stars 13 forks source link

Implement exit code on errors #53

Closed angulito closed 10 months ago

angulito commented 11 months ago

Description

Implement exit codes on failures following codes defined on https://github.com/adobe/aio-cli-plugin-cloudmanager/issues/215

⚠️ I have set a special code for deployment warnings, including here the install staged case:

Logs:
> The analyser found the following errors for publish :
> [api-regions-exportsimports] com.adobe.aem.temp:com.adobe.aem.developer.console.support:0.1.19.202310190732: Bundle com.adobe.aem.developer.console.support:0.1.19.202310190732 is importing package(s) [Package org.apache.felix.cm.json;version=[1.0,2), Package org.apache.sling.feature;version=[1.8,2), Package com.fasterxml.jackson.dataformat.yaml;version=[2.13,3), Package com.adobe.granite.toggle.api;version=[1.3,1.4)] in start level 20 but no visible bundle is exporting these for that start level in the required version range.
> org.apache.felix.cm.json is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> com.fasterxml.jackson.dataformat.yaml is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> org.apache.sling.feature is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> com.adobe.granite.toggle.api is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> The analyser found the following errors for author :
> [api-regions-exportsimports] com.adobe.aem.temp:com.adobe.aem.developer.console.support:0.1.19.202310190732: Bundle com.adobe.aem.developer.console.support:0.1.19.202310190732 is importing package(s) [Package org.apache.felix.cm.json;version=[1.0,2), Package org.apache.sling.feature;version=[1.8,2), Package com.fasterxml.jackson.dataformat.yaml;version=[2.13,3), Package com.adobe.granite.toggle.api;version=[1.3,1.4)] in start level 20 but no visible bundle is exporting these for that start level in the required version range.
> org.apache.felix.cm.json is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> com.fasterxml.jackson.dataformat.yaml is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> org.apache.sling.feature is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
> com.adobe.granite.toggle.api is exported in regions [com.adobe.aem.internal] but it is imported in regions [com.adobe.aem.deprecated, global]
 ›   Error: [RDECLI:INSTALL_STAGED] Install command was staged, analysers
 ›   detected missing packages that can be fixed with another deployment on top
 ›   of this one. Please check logs. If this is expected, you can ignore exit
 ›   code 40
 ›   Code: INSTALL_STAGED

Therefore, you can check after the exit code in the script if the exit code is 40 then it means it is a deployment warning. So if you're expecting this case, you can ignore it. Otherwise, I consider it a failure.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

jsedding commented 10 months ago

For the record, this fixes #43.

angulito commented 10 months ago

Also fixes https://github.com/adobe/aio-cli-plugin-aem-rde/issues/18