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
3
3
const { sendHttpRequest } = require ( './helper' ) ;
4
4
const Environment = require ( '../entities/Environment' ) ;
5
5
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
+ } ;
11
30
12
31
const getEnvironmentById = async ( id ) => {
13
32
const endcodeUri = encodeURIComponent ( id ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " codefresh" ,
3
- "version" : " 0.8.37 " ,
3
+ "version" : " 0.8.38 " ,
4
4
"description" : " Codefresh command line utility" ,
5
5
"main" : " index.js" ,
6
6
"preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments