Skip to content

Commit

Permalink
Merge pull request #41 from entando/ENG-1624_extract-bundle-from-enta…
Browse files Browse the repository at this point in the history
…ndo-lacking-plugins

ENG-1624 support Entando app lacking plugin
  • Loading branch information
ffleandro authored Dec 4, 2020
2 parents 409ca05 + ea3a890 commit 969440d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/env-bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,21 @@ const componentResponseProcessor = {
return assets.map(a => objectMapper(a, schema)).filter(a => a.path !== undefined);
},
plugin: async (response, token) => {
if (response.data._embedded) {
const plugins = response.data._embedded.entandoPlugins;
const schema = {
'metadata.name': 'name',
'spec.image': 'image',
'spec.dbms': 'dbms',
'spec.healthCheckPath': 'healthCheckPath',
'spec.ingressPath': 'ingressPath',
'spec.roles[].code': 'roles[]',
'spec.permissions': 'permissions',
};
const plugins = response.data._embedded &&
response.data._embedded.entandoPlugins ||
[];

return plugins.map(p => objectMapper(p, schema));
}
const schema = {
'metadata.name': 'name',
'spec.image': 'image',
'spec.dbms': 'dbms',
'spec.healthCheckPath': 'healthCheckPath',
'spec.ingressPath': 'ingressPath',
'spec.roles[].code': 'roles[]',
'spec.permissions': 'permissions',
};

return plugins.map(p => objectMapper(p, schema));
},
group: async (response, token) => {
return response.data.payload;
Expand Down

0 comments on commit 969440d

Please sign in to comment.