groovy

Grails/Groovy regular expression- how to use (?i) to make everything case insensitive?

那年仲夏 提交于 2021-01-02 05:12:26
问题 I use the following RegEx: url (blank:false, matches: /^(https?:\/\/)(?:[A-Za-z0-9]+([\-\.][A-Za-z0-9]+)*\.)+[A-Za-z]{2,40}(:[1-9][0-9]{0,4})?(\/\S*)?/) I want to add (?i) to make everything case insensitive. How should I add this? 回答1: I can confirm the (?i) at the beginning of the regex makes it case insensitive. Anyway, if your purpose is to reduce the regex length you can use the groovy dollar slashy string form. It allows you to not escape slashes / (the escape char becomes $ ). In

How to import and run 3rd party Jenkins Plugin's extension DSL (githubPullRequest) with Gradle tool locally?

走远了吗. 提交于 2021-01-01 03:41:11
问题 I'm a newbie at Jenkins job-dsl scripting. I'm working to convert the Jenkins XML configuration to Groovy DSL script using a plugin (https://github.com/AOEpeople/gradle-jenkins-job-dsl-plugin) that uses Gradle tool for building the script and running Unit Test locally. However, currently, I'm facing an issue with the extension DSL from a 3rd Party Jenkins Plugin (https://github.com/jenkinsci/ghprb-plugin). triggers { githubPullRequest { orgWhitelist("Test") cron("H/5 * * * *") extensions {

How to import and run 3rd party Jenkins Plugin's extension DSL (githubPullRequest) with Gradle tool locally?

允我心安 提交于 2021-01-01 03:35:33
问题 I'm a newbie at Jenkins job-dsl scripting. I'm working to convert the Jenkins XML configuration to Groovy DSL script using a plugin (https://github.com/AOEpeople/gradle-jenkins-job-dsl-plugin) that uses Gradle tool for building the script and running Unit Test locally. However, currently, I'm facing an issue with the extension DSL from a 3rd Party Jenkins Plugin (https://github.com/jenkinsci/ghprb-plugin). triggers { githubPullRequest { orgWhitelist("Test") cron("H/5 * * * *") extensions {

How to import and run 3rd party Jenkins Plugin's extension DSL (githubPullRequest) with Gradle tool locally?

假装没事ソ 提交于 2021-01-01 03:34:46
问题 I'm a newbie at Jenkins job-dsl scripting. I'm working to convert the Jenkins XML configuration to Groovy DSL script using a plugin (https://github.com/AOEpeople/gradle-jenkins-job-dsl-plugin) that uses Gradle tool for building the script and running Unit Test locally. However, currently, I'm facing an issue with the extension DSL from a 3rd Party Jenkins Plugin (https://github.com/jenkinsci/ghprb-plugin). triggers { githubPullRequest { orgWhitelist("Test") cron("H/5 * * * *") extensions {

Generics with Spock Stub

谁都会走 提交于 2020-12-31 04:43:39
问题 I cannot make compile Spock stub for generic class. The signature of constructor is following: SomeClass(SerSup<Cap> capSup, String foo, String bar); I need to stub the first argument. The following are my failed attempts. First try: def someClass = new SomeClass(Stub(SerSup<Cap>), "foo", "bar") Error: Groovyc: unexpected token: > Status bar: ',' or ')' expected Another try: def someClass = new someClass(Stub(Cup) as SerSup<Cup>, "foo" ,"bar") groovy.lang.MissingMethodException: No signature

Generics with Spock Stub

故事扮演 提交于 2020-12-31 04:41:45
问题 I cannot make compile Spock stub for generic class. The signature of constructor is following: SomeClass(SerSup<Cap> capSup, String foo, String bar); I need to stub the first argument. The following are my failed attempts. First try: def someClass = new SomeClass(Stub(SerSup<Cap>), "foo", "bar") Error: Groovyc: unexpected token: > Status bar: ',' or ')' expected Another try: def someClass = new someClass(Stub(Cup) as SerSup<Cup>, "foo" ,"bar") groovy.lang.MissingMethodException: No signature

Generics with Spock Stub

一世执手 提交于 2020-12-31 04:41:19
问题 I cannot make compile Spock stub for generic class. The signature of constructor is following: SomeClass(SerSup<Cap> capSup, String foo, String bar); I need to stub the first argument. The following are my failed attempts. First try: def someClass = new SomeClass(Stub(SerSup<Cap>), "foo", "bar") Error: Groovyc: unexpected token: > Status bar: ',' or ')' expected Another try: def someClass = new someClass(Stub(Cup) as SerSup<Cup>, "foo" ,"bar") groovy.lang.MissingMethodException: No signature

How to make a curl request with json in jenkins pipeline groovy script

最后都变了- 提交于 2020-12-29 05:52:42
问题 I am trying to make a New Relic deployment API call as a Jenkins build step using the Groovy pipeline. I'm having trouble because of the use of both single and double quotes within the shell ('sh') command on the groovy script. Whenever I execute the following: node { //... def json = '''\ {"deployment": {"revision": "v1","user": "me"}}' ''' sh "curl -o /dev/null -s -X POST 'https://api.newrelic.com/v2/applications/[redacted]/deployments.json' \ -H 'X-Api-Key:[redacted]' \ -H 'Content-Type:

How to make a curl request with json in jenkins pipeline groovy script

╄→尐↘猪︶ㄣ 提交于 2020-12-29 05:52:36
问题 I am trying to make a New Relic deployment API call as a Jenkins build step using the Groovy pipeline. I'm having trouble because of the use of both single and double quotes within the shell ('sh') command on the groovy script. Whenever I execute the following: node { //... def json = '''\ {"deployment": {"revision": "v1","user": "me"}}' ''' sh "curl -o /dev/null -s -X POST 'https://api.newrelic.com/v2/applications/[redacted]/deployments.json' \ -H 'X-Api-Key:[redacted]' \ -H 'Content-Type:

How to make a curl request with json in jenkins pipeline groovy script

限于喜欢 提交于 2020-12-29 05:52:15
问题 I am trying to make a New Relic deployment API call as a Jenkins build step using the Groovy pipeline. I'm having trouble because of the use of both single and double quotes within the shell ('sh') command on the groovy script. Whenever I execute the following: node { //... def json = '''\ {"deployment": {"revision": "v1","user": "me"}}' ''' sh "curl -o /dev/null -s -X POST 'https://api.newrelic.com/v2/applications/[redacted]/deployments.json' \ -H 'X-Api-Key:[redacted]' \ -H 'Content-Type: