[tek-nol-uh-jee]

Jenkins Pipeline: using string keys of a map to unstash artifacts in a loop

Just using my blog as my permanent public notepad.

def my_keys = build_result.keySet() as List;

for (int i = 0; i < my_keys.size(); ++i) {
  def key_to_unstash = my_keys[i];
  print 'Unstashing ' + key_to_unstash;
  unstash "${key_to_unstash}";
}

my_keys = test_result.keySet() as List;

for (int i = 0; i < my_keys.size(); ++i) {
  def key_to_unstash = my_keys[i];
  print 'Unstashing ' + key_to_unstash;
  unstash "${key_to_unstash}";
}

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *