Jenkins Slack notifications

2019-06-27 Thread Stuart Cracraft
Hi,

I've got Jenkins interfaced with Slack so that the developers (including 
me) can see the build notifications from Jenkins after builds.

Unfortunately, the Open button in those messages does not reveal the detail 
due to a lockdown on the network between the Jenkins server and Slack which 
all developers carry.

So they simply have zero access.

In the event that the associated firewall cannot be opened (due to red tape 
or prohibition), is there a method to send the entire error from Jenkins 
via the Slack integration embedding it in place of or after or near the 
"Open" button in the notifications.

Anyone know?

Thanks!

--Stuart

-- 
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/da583c5b-059b-4a5f-b7b8-96444e6dbfcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issues running a Jenkins job with parameters via jquery/ajax - api

2019-06-27 Thread Cliff Hanger
Any suggestions??


On Tuesday, June 25, 2019 at 10:07:37 PM UTC-7, Cliff Hanger wrote:
>
> Hi,
>
> I have the below code, somehow I just cant seem to pass the parameters to 
> Jenkins:
>
>
>var parameters = '{"parameter": [{"name":"id", "value": "2"}, 
> {"name":"id2", "value": "testing"}]}';
>$.ajax({
> url: "https://abc/job/test/buildWithParameters;,
> beforeSend: function(xhr) {
> xhr.withCredentials = true;
> xhr.setRequestHeader('cache-control', 'no-cache, must-revalidate, 
> post-check=0, pre-check=0');
> xhr.setRequestHeader("Authorization", "Basic " + 
> btoa("abc:***"));
> },
> type: "POST",
> dataType: "jsonp",
> contentType: "application/json; charset=utf-8",
> cache: false,
> async: false,
> processData: false,
> data: 'json='+parameters,
> success: function (data) {
> alert(JSON.stringify(data));
> },
> error: function(){
> alert("Cannot get data");
> }});
>
>
>
> Can someone please help me with what am I doing wrong? Also it always goes 
> in the error function and not in the success, why is that the case?
>
> --Ishan
>
>

-- 
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/4a4aeaac-f0d3-44d6-9fa4-c5cf92da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Repeat Build with Parameters

2019-06-27 Thread R. Tyler Croy
(replies inline)

On Wed, 26 Jun 2019, Madhusudan G J wrote:

> I am new to jenkins and needs help, how do I build with parameters script till
> I pass "No" parameter.
>
> Currently, I have a script, which will run and complete, when I click on build
> with parameters. But I would like to gather the different parameters for
> different builds one after the other and build at once.
>
> How Can I achieve this, please help.
>
> Example, My script creates a .csv file when I click on build with parameters, 
> I
> would like to get this .csv file appended when I click on click on build 
> again.
> once I am done, I would like to build at once, how can I achieve this.


I believe that the Rebuilder plugin would help you here:



https://plugins.jenkins.io/rebuild

--
GitHub:  https://github.com/rtyler

GPG Key ID: 0F2298A980EE31ACCA0A7825E5C92681BEF6CEA2

-- 
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/2lP_jHbO_LgNcjKoQDHsN-V3faso8eCd9zcgqqV5hSWY571qxDlIr5WP3koDNpMFWC7okyvUUiAX7Jep2vG3CqZQgK6oaqGHCEXvN0lV6Wg%3D%40brokenco.de.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: jenkins-cli.jar stopped working for not apparent reason

2019-06-27 Thread Eric Pyle
I don't think that will help. The CLI changed in a recent release, and 
even without the reverse proxy you have to change how you use it. Did 
you have a look at the "Common Problems with the CLI client" in the 
docs? Remember that the username you are passing with -user is a Jenkins 
user id, not a Linux username. Have you added the public key for that 
user to Jenkins as shown in the doc?


One other thing: You are using "java -cp /path/to/cli.jar", while all 
the examples in the help show "java -jar /path/to/cli.jar". Might be 
worth trying. In any case, I ended up switching to the direct ssh method 
I showed in my shell script, and it's been working for me.


Good luck!
Eric

On 6/27/2019 10:17 AM, Eric Fetzer wrote:
Hi Eric, thanks for the reply.  I'm not using a reverse proxy on my 
Jenkins server.  It's pretty much out of the box.  I've been using the 
jenkins-cli.jar file for about 6 years.  I just recently upgraded it 
and it stopped working. Before, I was able to connect with just the -s 
and the -i.  Not sure why with the new version -i needs the ssh 
option.  Maybe I should just call straight to the jenkins-cli.jar on 
the server to bypass jenkins remote security functionality?


Thanks,
Eric


On Tue, Jun 25, 2019 at 11:10 AM Eric Pyle > wrote:


Have a look at the docs: https://jenkins.io/doc/book/managing/cli/
.  As stated there, if you are using a reverse proxy on your
Jenkins server, it won't work using the jenkins-cli.jar as you
are. You can try using the property
-Dorg.jenkinsci.main.modules.sshd.SSHD.hostName on Jenkins
startup, but that didn't work for our installation. I ended up
switching to accessing CLI via the ssh command, as documented
under "Using the CLI over SSH". Here's a little shell script I set
up to access CLI from a bash prompt:

$ *cat bin/jenkins*
if [ $# == 0 ]; then DEF_ARG=help;fi
port=`curl -Lv ${JENKINS_URL}/login 2>&1 | grep -i
'x-ssh-endpoint'|grep -oE '([0-9]+)'`
ssh -p $port starci $@ $DEF_ARG


On 6/25/2019 11:52 AM, Eric Fetzer wrote:

Thanks Eric!  I updated my java version to 1.8 and it appears my
command line has changed since the version of java-cli.jar I was
using.  the -i doesn't work together with the -s without a -ssh
and the -ssh needs a -user, lol.  But once I put all those
together, I get:

java -cp /my/path/to/jar/jenkins-cli.jar -s
http://myJenkinsServer:8080   -ssh
-user jenkins -i /my/key/.ssh/id_rsa help

Jun 25, 2019 9:48:19 AM
org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar
getOrCreateProvider
INFO: getOrCreateProvider(EdDSA) created instance of
net.i2p.crypto.eddsa.EdDSASecurityProvider
Jun 25, 2019 9:48:19 AM hudson.cli.SSHCLI sshConnection
WARNING: No header 'X-SSH-Endpoint' returned by Jenkins


I don't think this is a success as it didn't return help to me.


On Tuesday, June 25, 2019 at 9:33:37 AM UTC-6, Eric Pyle wrote:

It's telling you the Java version is not correct. What
version of Java are you using? Needs to be 1.8 for current
Jenkins.

On 6/25/2019 11:27 AM, Eric Fetzer wrote:

OK, that was a flop.  I downloaded the correct
jenkins-cli.jar from : http://myJenkinsServer:8080
/jnlpJars/jenkins-cli.jar
, and
now I get:

Exception in thread "main"
java.lang.UnsupportedClassVersionError: hudson/cli/CLI :
Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at
java.lang.ClassLoader.defineClass(ClassLoader.java:648)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at
java.net.URLClassLoader.defineClass(URLClassLoader.java:272)
        at
java.net.URLClassLoader.access$000(URLClassLoader.java:68)
        at
java.net.URLClassLoader$1.run(URLClassLoader.java:207)
        at
java.net.URLClassLoader$1.run(URLClassLoader.java:201)
        at
java.security.AccessController.doPrivileged(Native Method)
        at
java.net.URLClassLoader.findClass(URLClassLoader.java:200)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:325)
        at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:296)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:270)
        at
sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:406)

On Tuesday, June 25, 2019 at 8:12:58 AM UTC-6, Eric Fetzer
wrote:

This makes no sense.  When I run the command:

java -cp /my/path/to/jar/jenkins-cli.jar -s
   

Repeat Build with Parameters

2019-06-27 Thread Madhusudan G J
Hi,

I am new to jenkins and needs help, how do I build with parameters script 
till I pass "No" parameter.

Currently, I have a script, which will run and complete, when I click on 
build with parameters. But I would like to gather the different parameters 
for different builds one after the other and build at once.

How Can I achieve this, please help.

Example, My script creates a .csv file when I click on build with 
parameters, I would like to get this .csv file appended when I click on 
click on build again. once I am done, I would like to build at once, how 
can I achieve this.

Thanks
Madhu

-- 
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/66cb84d8-699d-41b9-8b5a-bf6b270b87ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.