Re: Why does somestring.digest('SHA-1') fail in pipeline

2019-05-01 Thread ZillaYT
Jenkins pipeline has been working for us so far, except for these little 
gotchas.

Thanks!

On Wednesday, May 1, 2019 at 1:55:16 PM UTC-4, Daniel Beck wrote:
>
>
>
> > On 1. May 2019, at 02:11, Slide > 
> wrote: 
> > 
> > I don't know what version pipeline is using right now. 
>
> We're on 2.4.x. 
>
> And as usual, don't (ab)use pipeline as a general purpose programming 
> environment. It's not intended to be, never was. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/49eb9169-9995-45ce-a844-66e2f08ce5e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does somestring.digest('SHA-1') fail in pipeline

2019-05-01 Thread Daniel Beck



> On 1. May 2019, at 02:11, Slide  wrote:
> 
> I don't know what version pipeline is using right now.

We're on 2.4.x.

And as usual, don't (ab)use pipeline as a general purpose programming 
environment. It's not intended to be, never was.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/48CE7C33-BEBE-41DB-9C79-C3643459F107%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Multi select option with open choice

2019-05-01 Thread Idan Shay
Hi,

I added Active choice parameter with multi select check box option where I 
got the info from groovy script and it works great.
I want to add one more checkbox with no value but empty textbox (String 
parameter) so the user can write something else that is not in the list 
that I show.

Is it possible ?
I know I can add new variable

Thanks




import groovy.sql.Sql

def output = []

def sql = Sql.newInstance('jdbc:mysql://dbUrl/schema', 'username', 
'password', 'com.mysql.jdbc.Driver')
String sqlString = Select name from table"
sql.eachRow(sqlString){ row ->  
output.push(row[0])
}

return output

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/39730b99-ebe1-43d3-8457-d3fc90fbe65b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i execute sql commands using jenkins

2019-05-01 Thread farrukhf
Hi My Scenario is that what if i want to run multiple queries using jenkins 
time to time . As using shell script i need to change the script every time 
for which i have to login server .

On Monday, January 23, 2017 at 7:13:07 PM UTC+5:30, Sivakrishna Yarra wrote:
>
> Hi,
> I am using Jenkins as a CI. how can i execute sql statements by using 
> jenkins tool. I am using Mysql is the database. Can you please help on this.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/aa4fd207-97cc-4653-913c-4ddaaf90548d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does somestring.digest('SHA-1') fail in pipeline

2019-05-01 Thread Mykola Nikishov
ZillaYT  writes:

> I have this simple code and it works on my Macs groovy
>
> String sigStr = 'iurpeirupru04790734'
> sigStr = sigStr.digest('SHA-1')
> println sigStr

Try

sigStr = sigStr.decodeBase64()

which is available since Groovy 1.0 [1]

digest() is available since 2.5.0 [2].

[1] 
http://docs.groovy-lang.org/2.4.0/html/api/org/codehaus/groovy/runtime/EncodingGroovyMethods.html
[2] 
http://docs.groovy-lang.org/latest/html/api/org/codehaus/groovy/runtime/EncodingGroovyMethods.html

> But I get this error when I run it in a Jenkins pipeline. Why? Thanks!

Different Groovy version?

> hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No 
> signature of method: java.lang.String.digest() is applicable for argument 
> types: (java.lang.String) values: [SHA-1] Possible solutions: getAt(java.
> lang.String), size(), toSet(), size(), next(), toList()

-- 
Mykola

Libre/Free Java Software Developer
https://manandbytes.gitlab.io/

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/87bm0mh469.fsf%40think.
For more options, visit https://groups.google.com/d/optout.