35

I have a Fastfile,and I want to all lanes with parameters from within my lane .How can do this? Just like this:

lane :my_lane do
     other_lane paramter1_name:"1" parameter2:"2"
end
benomatis
  • 5,536
  • 7
  • 36
  • 59
H.WZ
  • 457
  • 1
  • 4
  • 9

2 Answers2

86

You should do it in this way:

lane :my_lane do
  other_lane(
    parameter1: '1', 
    parameter2: '2'
  )
end

Hope this helps!

So other lane should be

lane :other_lane do |values|
   parameter1  = values[:parameter1]
   parameter2  = values[:parameter2]
   puts parameter1
   puts parameter2
end
Artem Demchenko
  • 886
  • 8
  • 5
  • 1
    Lanes are like actions in this regard, so you have to supply parameters to them in the same way as well. – janpio Nov 30 '17 at 12:15
3

this will also work

lane :other_lane do |values|
    parameterValue1 = values[:parameterKey1]  #read from arguments
    parameterValue2 = values[:parameterKey2]  #read from arguments

    #call other_lane with arguments
    other_lane parameterKey1:parameterValue1 parameterKey2:parameterValue2
end
ir2pid
  • 5,604
  • 12
  • 63
  • 107