Re: maven build success despite OOM

2020-02-26 Thread James Nord
I'm assuming if you run that outside of Jenkins that the maven command returns 
a non zero exit code?

-- 
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/d91777e2-908e-43d5-a454-38f2ea8bcb4b%40googlegroups.com.


Re: maven build success despite OOM

2020-02-26 Thread James Nord
that sounds like a bug in the maven job type.  if you can reproduce it with 
something you share can you file an issue in issues.jenkins-ci.org along with 
the source, Jenkins plugin versions jdk and maven versions.

you can get very similar results to the maven job type in pipeline using the 
pipeline-maven-plugin (with maven step), but it sounds like you may be invested 
in the maven job type.

-- 
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/3b206fb6-1ac6-4a83-a02e-4ee9bbb424d8%40googlegroups.com.


Re: Process the powershell result on the jenkins server

2020-02-26 Thread Eric Pyle
Extending on Slide's idea, you can write the result to a file in the 
workspace and save that file as a build artifact. Then in the downstream 
job that runs on the master you can retrieve the artifact from the 
upstream job (copy artifacts from other job) and read the value in your 
bash script. Or similarly, if you write the file in the upstream job as 
a properties file "VARNAME=$value" then you can use that file to set a 
parameter to pass to the downstream job (parameters from properties file).


Eric

On 2/26/2020 8:26 AM, Michael Renner wrote:

Moin,


I am new to this group but I have been using jenkins for many years.
Now I have a request that I don't know what to do next. My jenkins 
server (Linux) connect to an agent on a Windows server and calls a 
power shell script. The script reports a result back, for example, 
"day", "night", "red" or "blue". This should now be processed on the 
Jenkins server (a bash script). But how? An other build step would run 
at the Windows server again, a post build action won't start external 
processes like bash scripts. I could create a second job that runs on 
the Jenkins master itself. But how do I get the results of the Power 
Shell script?


Grateful for hints
--
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/7604abe1-01fd-4f07-94c9-0352318ebba7%40googlegroups.com 
.


--
Eric Pyle
Siemens Digital Industries Software
Simulation and Test Solutions, Product Development
eric.p...@siemens.com
https://www.sw.siemens.com/

--
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/ec42bd65-5454-ba03-8825-148a67323ca1%40siemens.com.


Re: Process the powershell result on the jenkins server

2020-02-26 Thread Slide
Hi Michael,

It sounds like you are using a Free Style job, is that correct? Something
like this is pretty easy to do in pipeline, but can be difficult in Free
Style jobs. One way to do it is to write the value to a properties file in
the powershell script and then use the EnvInject plugin to inject the
value(s) from the properties file into the environment of the job using the
'Environment Properties File Path' item. Look for the  'Inject environment
variables for your job' build step when setting up the job.

Hopefully that will at least get you started down the right path.

Regards,

Alex


On Wed, Feb 26, 2020 at 7:41 AM Michael Renner  wrote:

> Moin,
>
>
> I am new to this group but I have been using jenkins for many years.
>
> Now I have a request that I don't know what to do next. My jenkins server
> (Linux) connect to an agent on a Windows server and calls a power shell
> script. The script reports a result back, for example, "day", "night",
> "red" or "blue". This should now be processed on the Jenkins server (a
> bash script). But how? An other build step would run at the Windows server
> again, a post build action won't start external processes like bash
> scripts. I could create a second job that runs on the Jenkins master
> itself. But how do I get the results of the Power Shell script?
>
> Grateful for hints
>
> --
> 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/7604abe1-01fd-4f07-94c9-0352318ebba7%40googlegroups.com
> 
> .
>


-- 
Website: http://earl-of-code.com

-- 
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/CAPiUgVeE1V0He36Lnf3_bACrqOAWgsNbGEy6xr%2BN2rZdDBvVJQ%40mail.gmail.com.


Process the powershell result on the jenkins server

2020-02-26 Thread Michael Renner
Moin,


I am new to this group but I have been using jenkins for many years. 

Now I have a request that I don't know what to do next. My jenkins server 
(Linux) connect to an agent on a Windows server and calls a power shell 
script. The script reports a result back, for example, "day", "night", 
"red" or "blue". This should now be processed on the Jenkins server (a bash 
script). But how? An other build step would run at the Windows server 
again, a post build action won't start external processes like bash 
scripts. I could create a second job that runs on the Jenkins master 
itself. But how do I get the results of the Power Shell script?

Grateful for hints

-- 
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/7604abe1-01fd-4f07-94c9-0352318ebba7%40googlegroups.com.


Re: maven build success despite OOM

2020-02-26 Thread Ned
I've used maven project template in jenkins to create the job. The launch 
command
mvn -e clean test -Pmyprofile

Am Dienstag, 25. Februar 2020 22:02:31 UTC+1 schrieb James Nord:
>
> what kind of job are you using and how do you launch maven?

-- 
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/aedd8e2f-a890-4a0e-8579-12bfca4a193e%40googlegroups.com.


Customize conditions skipped message

2020-02-26 Thread judaondo
Hello, 

Having the following code: 

pipeline {
agent any
stages {
stage('Example Build') {
steps {
echo 'Hello World'
}
}
stage('Example Deploy') {
when {
branch 'production'
}
steps {
echo 'Deploying'
}
}
}
}


If condition is not run it displays:

*"Stage "Example Deploy" skipped due to when conditional"*

Is there any way tu customize this message?

Thank you.


-- 
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/bb6ac553-9f8d-43ed-8510-67afd9fc5047%40googlegroups.com.


AW: Use environment variable from upstream build

2020-02-26 Thread Stefan.Rademacher
Hi,

thanks for the suggestions.
Sidenote: This solution, using environment variables used to work and afaik, we 
didn't make any pipeline changes, related to this. Unfortunately I can't narrow 
down, since when exactly it broke.

I can confirm, that allowing undefined parameters (JENKINS-56875) does not help.

I realized, that the environment, returned by Run.getEnvironment() does not 
even contain my custom environment variables, when I call it on 
currentBuild.rawBuild.
So this issue is not even related to a upstream/downstream relation between two 
pipelines.
The getEnvironment() method simply seems to behave differently since…???

Here is my simplified example.
pipeline {
agent {
label 'Linux-Test'
}

environment {
name = 'foo'
}

stages {
stage('Set environment') {
environment {
name = 'bar'
}
steps {
echo 
"${currentBuild.rawBuild.getEnvironment(TaskListener.NULL)}"
}
}
}
}

environment (from console log):
[BUILD_DISPLAY_NAME:#5, BUILD_ID:5, BUILD_NUMBER:5, 
BUILD_TAG:jenkins-upstream-pipeline-5, BUILD_TIMESTAMP:2020-02-26_13-20-47, 
BUILD_URL:https://jenkins-test8080/job/upstream-pipeline/5/, CLASSPATH:, 
GIT_HOME:C:\ tools\git, HUDSON_HOME:c:\jenkins\jenkins-test, 
HUDSON_SERVER_COOKIE:662af83ef93bf80d, HUDSON_URL:https://jenkins-test:8080/, 
JDK_18_LATEST_X64:C:\SPU\ext64\jdk1.8.0_112, 
jenkins.slaves.DefaultJnlpSlaveReceiver.disableStrictVerification:true, 
JENKINS_HOME:c:\jenkins\jenkins-test, JENKINS_SERVER_COOKIE:662af83ef93bf80d, 
JENKINS_URL:https://jenkins-test.dst.tk-inline.net:8080/, 
JOB_BASE_NAME:upstream-pipeline, 
JOB_DISPLAY_URL:https://jenkins-test.dst.tk-inline.net:8080/job/upstream-pipeline/display/redirect,
 JOB_NAME:upstream-pipeline, 
JOB_URL:https://jenkins-test:8080/job/upstream-pipeline/, 
RUN_CHANGES_DISPLAY_URL:https://jenkins-test:8080/job/upstream-pipeline/5/display/redirect?page=changes,
 
RUN_DISPLAY_URL:https://jenkins-test:8080/job/upstream-pipeline/5/display/redirect]

Still hoping, that there is a way to get the complete environment…

Best regards
Stefan


Von: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] 
Im Auftrag von Mark Waite
Gesendet: Dienstag, 25. Februar 2020 19:07
An: Jenkins Users 
Betreff: Re: Use environment variable from upstream build

I wonder if you need to use  https://issues.jenkins-ci.org/browse/JENKINS-56875 
and its "allow undefined parameters" setting to grant permission for the 
environment variables from the preceding job to be visible in the successor job?

Alternatively, have you considered passing the values as parameters instead of 
using environment variables?

On Tue, Feb 25, 2020 at 8:24 AM 
mailto:stefan.rademac...@tk.de>> wrote:
Hi,

as a simple test case, I created these two pipelines.

First, the "upstream pipeline":
pipeline {
agent {
label 'Linux-Test'
}

environment {
name = 'foo'
}

stages {
stage('Set environment') {
environment {
name = 'bar'
}
steps {
echo "name=${name}"
}
}
}
}

Second, the "downstream pipeline":
pipeline {
agent {
label 'Linux-Test'
}

triggers {
upstream(
upstreamProjects: "upstream-pipeline",
threshold: hudson.model.Result.SUCCESS
)
}

stages {
stage('print upstream environment') {
steps {
script {
echo 
currentBuild.rawBuild.getCause(Cause$UpstreamCause).getUpstreamRun().getEnvironment(TaskListener.NULL).toMapString()
}
}
}
}
}

Anyone?

Best regards
Stefan


Von: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com]
 Im Auftrag von stefan.rademac...@tk.de
Gesendet: Montag, 24. Februar 2020 17:33
An: jenkinsci-users@googlegroups.com
Betreff: [SPAM-Verdacht] Use environment variable from upstream build

Hi everyone,

I used to set an environment variable via
  env.x = "…"
in my Jenkinsfile.
Another pipeline has an upstream trigger configured and runs right after the 
first pipeline build finishes. It reads the environment from the upstream build.
It used to work, that the downstream build could make decisions, based on the 
value of x of the upstream build.

Now,
  
currentBuild.rawBuild.getCause(Cause$UpstreamCause).getUpstreamRun().getEnvironment(TaskListener.NULL)
returns all well known environment variables, like BUILD_NUMBER, JENKINS_HOME, 
etc. but NOT x anymore.

I tried different things…
• set x in "environment { }"
• initialize x with a default value in the top level "environment { }" 
bevor setting it in later stages
• use env.x = …
•