I have jenkins and job in jenkins with selection "Node" (Server) by users and "Label Expression" (ex. server1||server2). But, if my server1 is gone to offline, I want to start my job on server2 automatically. Can anyone help me?
Thanks.
I have jenkins and job in jenkins with selection "Node" (Server) by users and "Label Expression" (ex. server1||server2). But, if my server1 is gone to offline, I want to start my job on server2 automatically. Can anyone help me?
Thanks.
Jenkins' node labels are supposed to be used the other way round. See Manage Jenkins → Manage Nodes → select a node → Configure → Click to the right of the Labels field:
So each of your servers (Server1, Server2) should have the same label assigned to it. Let's say build. Define this in Label Expression in your project.
Select Ignore offline nodes under This build is parameterized → Node → Node eligibility.
Such, if a user selects an offline node the other one of the group should be taken (if this one is online).