Skip to content
This repository was archived by the owner on Aug 15, 2022. It is now read-only.

Commit 8be5232

Browse files
committed
add helper function to be able to get ip address of nth instance
1 parent b8c5786 commit 8be5232

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

scripts/node-testing/helper.coffee

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
fs = require 'fs'
22

3-
module.exports =
3+
getNthInstanceData = (instanceData, n) ->
44

5-
getNthInstanceData : (instanceData, n) ->
6-
7-
# getting nth test instance's id and public ip
8-
instance = {}
5+
# getting nth test instance's id and public ip
6+
instance = {}
7+
8+
[ instance.instanceId, instance.publicIpAddress ] = fs.readFileSync instanceData
9+
.toString().split("\n")[n].split(' ')
910

10-
[ instance.instanceId, instance.publicIpAddress ] = fs.readFileSync instanceData
11-
.toString().split("\n")[n].split(' ')
12-
13-
return instance
11+
return instance
12+
13+
14+
getNthInstancePublicIpAddress = (instanceData, n) ->
15+
16+
return getNthInstanceData(instanceData, n).publicIpAddress
17+
1418

19+
module.exports = {
20+
getNthInstanceData
21+
getNthInstancePublicIpAddress
22+
}
23+
1524

0 commit comments

Comments
 (0)