How to get ip(public or private of one EC2 node and pass it to second

16 views
Skip to first unread message

Moshe Zuisman

unread,
Feb 2, 2017, 5:37:46 PM2/2/17
to Jenkins Users
I am quite a new bee in jenkins. So - it can happen , that  I ask something that already was asked. While - I did not find anything on those or another forums or documentation.

I have 2 jobs on my jenkins server. 
One creates node (EC2 amazon Windows machine) with application server installed on it.
Second should create secondary fail-over instance, thay have to "know" host of primary host (and keep it in application database).
At batch script, that I have put in primary job definition I have run power shell job that prints public host name of primary host into stdout. So - when I look at job stdout - I can copy from there those public IP.
Than I edit job definition of secondary node and put there primary host ip...
So - I can run my tests half automatically , but it require manual involvement in secondary node job, and prevent automatic execution of tests.
Is there any way to store those primary host ip during run of primary job run(in some jenkins intenal variables , storage , whatever) of even let us say file/local db - at machine running jenkins server. So - that later secondary job whould be able to get it automatically without human involvement...

To get it clear. I can not run primary job in advance and keep it alive with constant IP. Since all those test is test of ongoing development builds - both instances have to be each time recreated from scratch, since they are each time installed from last development build.
Thanks in advance 
Message has been deleted

Moshe Zuisman

unread,
Feb 3, 2017, 1:59:31 PM2/3/17
to Jenkins Users
Some additional thought. 
If there is some way to pass to slave information about jenkins server, that manages it - it could give a kind of workaround. For example I can start some web server or my_sql db server at jenkins node. And bootstrup script that deploy slaves can when deploying sserver node put its ip at those server, and client bootstrup script get from there server's ip..

Reply all
Reply to author
Forward
0 new messages