File tree Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Expand file tree Collapse file tree 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,30 @@ const CFError = require('cf-errors'); // eslint-disable-line
33const { sendHttpRequest } = require ( './helper' ) ;
44const Environment = require ( '../entities/Environment' ) ;
55
6- const _extractFieldsForEnvironmentEntity = environment => ( {
7- id : environment . _id ,
8- status : environment . creationStatus ,
9- name : environment . name ,
10- } ) ;
6+ const _getServiceInfo = ( environment ) => {
7+ let services = [ ] ;
8+ for ( let i = 0 ; i < environment . instances . length ; i ++ ) {
9+ const service = environment . instances [ i ] ;
10+ services . push ( {
11+ serviceName : service . serviceName ,
12+ image : service . image ,
13+ sha : service . sha ,
14+ branch : service . branch ,
15+ repoName : service . repoName ,
16+ serviceURL : service . urls ,
17+ } ) ;
18+ } ;
19+ return services ;
20+ } ;
21+
22+ const _extractFieldsForEnvironmentEntity = ( environment ) => {
23+ return {
24+ id : environment . _id ,
25+ status : environment . creationStatus ,
26+ name : environment . name ,
27+ servicesInfo : _getServiceInfo ( environment ) ,
28+ } ;
29+ } ;
1130
1231const getEnvironmentById = async ( id ) => {
1332 const endcodeUri = encodeURIComponent ( id ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.8.37 " ,
3+ "version" : " 0.8.38 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments