groovy

How do I trigger a job when another completes?

只谈情不闲聊 提交于 2020-01-15 01:21:15
问题 I have two jobs, consider them to be the super simple jobs that just print a line and have no triggers or timeouts defines. They work fine when I call them from a controller class through: <name of my class>Job.triggerNow() What I want is to trigger one job and, as it as it finishes, trigger a consequent different job. I have tried using the quartzScheduler , but I can't seem to get a JobDetail from my job classes, so I'm not sure what is the correct way for doing this. I also want to pass

Groovy delegates working as intended?

好久不见. 提交于 2020-01-14 16:56:25
问题 I have a short snippet where I try to delegate the variable resolution to the delegate. However the delegates value isnt used, instead the owners value is used. Is this intentional or is this a bug? class Person { int age } def age = -5 def closure = { -> age } closure.delegate = new Person(age: 99) closure.resolveStrategy == Closure.DELEGATE_ONLY assert closure.call() == 99 Above code fails, with the closure returning -5. 回答1: Your code returns -5 because the variable age is defined withing

Groovy delegates working as intended?

谁说我不能喝 提交于 2020-01-14 16:54:41
问题 I have a short snippet where I try to delegate the variable resolution to the delegate. However the delegates value isnt used, instead the owners value is used. Is this intentional or is this a bug? class Person { int age } def age = -5 def closure = { -> age } closure.delegate = new Person(age: 99) closure.resolveStrategy == Closure.DELEGATE_ONLY assert closure.call() == 99 Above code fails, with the closure returning -5. 回答1: Your code returns -5 because the variable age is defined withing

Groovy delegates working as intended?

纵然是瞬间 提交于 2020-01-14 16:54:25
问题 I have a short snippet where I try to delegate the variable resolution to the delegate. However the delegates value isnt used, instead the owners value is used. Is this intentional or is this a bug? class Person { int age } def age = -5 def closure = { -> age } closure.delegate = new Person(age: 99) closure.resolveStrategy == Closure.DELEGATE_ONLY assert closure.call() == 99 Above code fails, with the closure returning -5. 回答1: Your code returns -5 because the variable age is defined withing

How can i use 'parallel' option in jenkins pipeline in the 'post' section?

岁酱吖の 提交于 2020-01-14 14:01:22
问题 I looked at many pipeline examples and how to write the post build section in a pipeline script. But never got my answer i was looking for. I have 4 jobs - say Job A,B,C and D. I want job A to run first, and if successful it should trigger Job B,C,D in parallel. If Job A fails, it should trigger only Job B. Something like below: pipeline { agent any stages { stage('Build_1') { steps { sh ''' Build Job A ''' } } post { failure { sh ''' Build Job B ''' } success { sh ''' Build Job B,C,D in

General Problems With Geb (StaleElementReferenceException & Wait Timeouts)

爷,独闯天下 提交于 2020-01-14 13:51:03
问题 According to the "Book of Geb" I started to map our portal's web pages. I prefer to use variables defined within static content closure block and accessing them afterwards in page methods: static content = { buttonSend { $("input", type: "submit", nicetitle: "Senden") } } def sendLetter() { waitFor { buttonSend.isDisplayed() } buttonSend.click() } Unfortunately, sometimes I get an Geb waiting timeout exception (after 60 secs) or even worse I receive the well known

General Problems With Geb (StaleElementReferenceException & Wait Timeouts)

橙三吉。 提交于 2020-01-14 13:50:09
问题 According to the "Book of Geb" I started to map our portal's web pages. I prefer to use variables defined within static content closure block and accessing them afterwards in page methods: static content = { buttonSend { $("input", type: "submit", nicetitle: "Senden") } } def sendLetter() { waitFor { buttonSend.isDisplayed() } buttonSend.click() } Unfortunately, sometimes I get an Geb waiting timeout exception (after 60 secs) or even worse I receive the well known

get vs getProperty in groovy

拜拜、爱过 提交于 2020-01-14 10:33:31
问题 It surprise me! According to the document of groovy, groovy may use "getProperty" method to get the property of a object. So when I want to change the behavier of getting property on the special object, I use a category class to override the "getProperty" method. However, it does not work. At last, I found groovy framework use the "get" method in the category class to get property, even if the object is not a map. My question is that is it a bug or groovy just work like that. This is the

Asynchronous gradle copy task?

China☆狼群 提交于 2020-01-14 09:36:19
问题 So I create an archive, say a war, and then I want another copy with a different name for convenience. Thing is that I don't want that copy task to slow down the rest of this rather large build. Possible to execute it asynchronously? If so, how? 回答1: In some cases, it's very handy to use parallel execution feature for this. It works only with multiproject builds (the tasks you want to execute parallel must be in separate projects). project('first') { task copyHugeFile(type: Copy) { from "path

Groovy XmlSlurper: get value of attribute that has an associated namespace

送分小仙女□ 提交于 2020-01-14 09:04:31
问题 I have an XML document that contains attributes with qualified names. I want to get the attribute value using XmlSlurper, but trying to access the attribute without specifying the namespace does not work (below is a minimal example). def rootNode = new XmlSlurper().parseText( '''<root xmlns:ex="http://example.com"> <one ex:a1="uno!"/> <ex:two>Some text!</ex:two> </root>''' ) assert rootNode.one[0].@a1.text() == 'uno!' rootNode.one[0].@a1.text() will yield an empty string. If using rootNode