Re: Create and push new git branch?

2018-08-07 Thread Jack Brooks
Aha! Thanks so much! I will have to get busy on this. I was looking at it
totally wrong.

On Tue, Aug 7, 2018, 9:10 PM Mark Waite  wrote:

> The git plugin has no facility to support creating a branch or pushing a
> branch from a Pipeline step.
>
> However, Pipeline can do it with an "sh" or "bat" step (depending on your
> platform).
>
> If your repository URL is an ssh URL ( g...@example.com:dir/repo.git or
> ssh://g...@example.com/dir/repo.git ) then you would use place the sh or
> bat step inside an ssh-agent block.  The ssh-agent block starts ssh-agent
> and then command line git will use ssh-agent to authenticate.
>
> If your repository is an http or https URL (
> https://example.com/dir/repo.git ) then you would use place the sh or bat
> step inside a withCredentials block.  The withCredentials block extracts
> username and password from the Jenkins credentials and makes them available
> as a variable.  Place that variable inside the git URL in the sh or bat
> step as in "git push https://${USERNAME}:${PASSWORD}@example.com/dir/repo;.
> There are examples of withCredentials on the jenkins.io site to give good
> techniques.
>
> Mark Waite
>
> On Tue, Aug 7, 2018 at 6:24 PM  wrote:
>
>> Hi folks,
>>
>> I've googled extensively, but I haven't seen any documentation or answers
>> on how to create a new git branch in Pipeline. I must be missing something
>> obvious, but the Git plugin page doesn't indicate anything other than
>> checking out code with credentials. Has anyone here used Jenkins to create
>> a branch and then push it to remote?
>>
>> Thanks!
>> Jack
>>
>> --
>> 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/22a42e16-f0df-4dad-9e1f-3996cae8d40a%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/37zGosGowKc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAO49JtFn_4Zte%3DmQ_QLDB4JvGiVbt8GY3WbxaqB9hMTxqjM61g%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAAk78BQPj2Xmw%3DapYA%2B-Do3yQ4uDRyfXsutshOWgRUw8swpRfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create and push new git branch?

2018-08-07 Thread Mark Waite
The git plugin has no facility to support creating a branch or pushing a
branch from a Pipeline step.

However, Pipeline can do it with an "sh" or "bat" step (depending on your
platform).

If your repository URL is an ssh URL ( g...@example.com:dir/repo.git or ssh:
//g...@example.com/dir/repo.git ) then you would use place the sh or bat
step inside an ssh-agent block.  The ssh-agent block starts ssh-agent and
then command line git will use ssh-agent to authenticate.

If your repository is an http or https URL (
https://example.com/dir/repo.git ) then you would use place the sh or bat
step inside a withCredentials block.  The withCredentials block extracts
username and password from the Jenkins credentials and makes them available
as a variable.  Place that variable inside the git URL in the sh or bat
step as in "git push https://${USERNAME}:${PASSWORD}@example.com/dir/repo;.
There are examples of withCredentials on the jenkins.io site to give good
techniques.

Mark Waite

On Tue, Aug 7, 2018 at 6:24 PM  wrote:

> Hi folks,
>
> I've googled extensively, but I haven't seen any documentation or answers
> on how to create a new git branch in Pipeline. I must be missing something
> obvious, but the Git plugin page doesn't indicate anything other than
> checking out code with credentials. Has anyone here used Jenkins to create
> a branch and then push it to remote?
>
> Thanks!
> Jack
>
> --
> 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/22a42e16-f0df-4dad-9e1f-3996cae8d40a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAO49JtFn_4Zte%3DmQ_QLDB4JvGiVbt8GY3WbxaqB9hMTxqjM61g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Create and push new git branch?

2018-08-07 Thread jbrooks
Hi folks,

I've googled extensively, but I haven't seen any documentation or answers 
on how to create a new git branch in Pipeline. I must be missing something 
obvious, but the Git plugin page doesn't indicate anything other than 
checking out code with credentials. Has anyone here used Jenkins to create 
a branch and then push it to remote?

Thanks!
Jack

-- 
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/22a42e16-f0df-4dad-9e1f-3996cae8d40a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Finding the master workspace from within a Java plugin (pipeline)

2018-08-07 Thread Tal Yanai
Hi,

As the perform section is running from within the Master, while the 
workspace retrieved by envVars.get("WORKSPACE") is from the slave host, I'm 
having hard time persisting some data into the workspace at the master 
location.

Is there a way to find out what is the workspace of the master?

Thanks,

Tal.

-- 
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/a21ecdbf-6681-49f9-8a39-591f00078c18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Klocwork result display with pipeline

2018-08-07 Thread Jean-Luc Pinardon
Dear all,

I am creating a pipeline using the declarative pipeline flavour, with 
clockwork steps enclosed within a klocworkWrapper.
Ok, analysis is launched, and I can see the results on the Klocwork server 
web interface.
But I cannot find a way to retrieve resulting diagrams on the Jenkins web 
interface, even when using the pipeline script generator.
Unless I am totally wrong, I think that I should use 
klocworkQualityGateway, but the generated script snippet is not correct.
Once copied within the wrapper, it fails lacking for some enableXYGateway 
or gatewayXYConfig property.
I really cannot find a way to make it work... so help would be appreciate.

Thanks for your help and best regards
J-L

-- 
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/613b7059-9218-45a2-90c0-b6fc26eb701a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HTML Publisher Plugin

2018-08-07 Thread jojo
404

On Tue, Aug 7, 2018, 17:50 Surjit Bains  wrote:

> What do you see on your browser?
>
>
> On Tue, 7 Aug 2018 at 14:18, yossibr9876  wrote:
>
>> Hi ,
>>
>> Unable to work with HTML Publisher Plugin.
>> I have created an index.html in shell script - the file was open by chrom
>> and it looks fine .
>> The problem is in plugin , what went wrong ?
>> Jemkins 2.60.3
>> Slave - Mac
>>
>> A link on the dashborad was created .
>>
>> Thanks a lot.
>> Yos
>>
>> --
>> 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/c7ebaf1c-73c0-493a-aa86-b415cce3a64c%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Surjit Bains
> e: surjit.ba...@gmail.com
> m: 07966 161 302
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/uIWoCU0Tock/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAMy1pK4bvBYQPk4NXpquwoYRZa9ieia7i1cfhab2B__WoLnAHA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CACuGLxi8WRUwXOH5rr0UOe7oU4HsEzVKTuyaxwhzn-yL6h7cog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar
Issue is fixed , by providing tools configuration in Jenkins file.

tools { 
maven 'JenkinsMaven' 
jdk 'JenkinsJDK' 
}

On Tuesday, 7 August 2018 18:54:11 UTC+5:30, yossibr9876 wrote:
>
> Hi,
> make sure u have a jdk !!! (I think you have jre ) .
>
> On Tuesday, August 7, 2018 at 3:48:36 PM UTC+3, suny nazar wrote:
>>
>>
>> i am getting below error when i am running maven goals via Jenkinsfile. I am 
>> not getting this issue when i am running freestyle project with maven goals.
>>
>>
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>> (default-compile) on project server: Compilation failure
>> [ERROR] Unable to locate the Javac Compiler in:
>> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
>> [ERROR] Please ensure you are using JDK 1.4 or above and
>> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
>> [ERROR] In most cases you can change the location of your Java
>> [ERROR] installation by setting the JAVA_HOME environment variable.
>>
>>
>> below code has been put in Jenkinsfile.
>>
>>
>> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
>> Files\Java\jdk1.8.0_181
>>
>>
>> pipeline {
>> agent any
>> stages{
>> stage('Build'){
>> steps {
>> bat 'mvn clean package'
>> }
>> post {
>> success {
>> echo 'Now Archiving...'
>> archiveArtifacts artifacts: '**/target/*.war'
>> }
>> }
>> }
>> }
>> }
>>
>>

-- 
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/9f1c0bd3-5cb6-4b7b-b704-f8c3052a641d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar
Did n't get you , actually i have tried two options in Global tool 
configuration.

1 Maven and JDK was given local paths.
2 Maven and JDK were set to be installed by Jenkins.

in both cases it did not work , when i am trying locally to run mvn compile 
, it works. It also works with freestyle project , i am having this issue 
with pipeline job using jenkinsfile.

can anyone , tell me if i need to change jenkinsfile to pickup correct 
paths.

On Tuesday, 7 August 2018 18:20:04 UTC+5:30, slide wrote:
>
> Is JAVA_HOME set to that for the user that Jenkins is running as?
>
> On Tue, Aug 7, 2018 at 5:48 AM suny nazar > 
> wrote:
>
>>
>> i am getting below error when i am running maven goals via Jenkinsfile. I am 
>> not getting this issue when i am running freestyle project with maven goals.
>>
>>
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
>> (default-compile) on project server: Compilation failure
>> [ERROR] Unable to locate the Javac Compiler in:
>> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
>> [ERROR] Please ensure you are using JDK 1.4 or above and
>> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
>> [ERROR] In most cases you can change the location of your Java
>> [ERROR] installation by setting the JAVA_HOME environment variable.
>>
>>
>> below code has been put in Jenkinsfile.
>>
>>
>> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
>> Files\Java\jdk1.8.0_181
>>
>>
>> pipeline {
>> agent any
>> stages{
>> stage('Build'){
>> steps {
>> bat 'mvn clean package'
>> }
>> post {
>> success {
>> echo 'Now Archiving...'
>> archiveArtifacts artifacts: '**/target/*.war'
>> }
>> }
>> }
>> }
>> }
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/d21780cd-fce0-48aa-b3bb-dc718317a212%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HTML Publisher Plugin

2018-08-07 Thread Surjit Bains
What do you see on your browser?


On Tue, 7 Aug 2018 at 14:18, yossibr9876  wrote:

> Hi ,
>
> Unable to work with HTML Publisher Plugin.
> I have created an index.html in shell script - the file was open by chrom
> and it looks fine .
> The problem is in plugin , what went wrong ?
> Jemkins 2.60.3
> Slave - Mac
>
> A link on the dashborad was created .
>
> Thanks a lot.
> Yos
>
> --
> 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/c7ebaf1c-73c0-493a-aa86-b415cce3a64c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Surjit Bains
e: surjit.ba...@gmail.com
m: 07966 161 302

-- 
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/CAMy1pK4bvBYQPk4NXpquwoYRZa9ieia7i1cfhab2B__WoLnAHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jmeter Test execution - Blank Performance Trend graphs

2018-08-07 Thread Ajith Raman
Hi Jan,



I did enable logging for "hudson.plugins.performance" (Logger level set to 
"ALL").

But the log is blank.


Please find below the steps performed (in order to enable logging):

1. Add a New Log Recorder.
2. Provide an appropriate name.
3. Click on "Add" (adjacent to Loggers).
4. Enter the Logger as "hudson.plugins.performance".
5. Set the Log level to "ALL".
6. Save.


Kindly find the Logger configuration attached.


Thanks for all the help.



Regards,
Ajith



On Tuesday, 7 August 2018 10:16:53 UTC+5:30, Jan Monterrubio wrote:
>
> I can’t find anything super obvious from a quick glance at the code. Can 
> you enable logging for: 
> hudson.plugins.performance
>
>
> Maybe it will show us how it’s evaluating whether there’s previous results 
> or not. 
>
> Looks like the class where we might find what’s happening might be 
>
>
> https://github.com/jenkinsci/performance-plugin/blob/master/src/main/java/hudson/plugins/performance/PerformancePublisher.java
>
>
> On Mon, Aug 6, 2018 at 04:21 Ajith Raman > 
> wrote:
>
>> Hi Jan,
>>
>> Thank you very much for the response. The plug-in used is Performance.hpi 
>> (version - 2.1).
>>
>> Regards,
>> Ajith
>>
>> On Sunday, 5 August 2018 09:20:27 UTC+5:30, Jan Monterrubio wrote:
>>>
>>> What plugin is generating the performance trends? 
>>>
>>> On Fri, Aug 3, 2018 at 3:06 PM Ajith Raman  wrote:
>>>
 Hello,
 I run a Jmeter test via Jenkins. Please find below the commands used: 
 Execute Windows Batch command (Build): cd 
 C:\Users\C51539A\Downloads\apache-jmeter-4.0\bin jmeter 
 -Jjmeter.save.saveservice.output_format=csv -n -t Sample_Framework.jmx -l 
 TestResults_%BUILD_NUMBER%.jtl -e -o 
 C:\Users\C51539A\Downloads\apache-jmeter-4.0\bin\HTML_%BUILD_NUMBER% 
 Publish Performance Test result report (Post-Build Actions): 
 C:\Users\C51539A\Downloads\apache-jmeter-4.0\bin\TestResults_${BUILD_NUMBER}.jtl
  
 Now the execution completes successfully. But the Performance Trend Graphs 
 are blank. Could you please help me on this? Note: All works fine, when 
 _${BUILD_NUMBER} is removed from the filename. Issue exists, only when 
 _${BUILD_NUMBER} is appended to the filename. Am performing this, in order 
 to make the output files unique. 
 Thanks in Advance!!

 -- 
 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-use...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-users/f87297df-97b4-4fe1-a857-c802dfcd225e%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/abe428d3-c392-4b24-b10c-7bd9c5cabc34%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/0471cf2e-38e6-4212-b09d-de2a94f8bfe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Logger_Config.docx
Description: MS-Word 2007 document


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread yossibr9876
Hi,
make sure u have a jdk !!! (I think you have jre ) .

On Tuesday, August 7, 2018 at 3:48:36 PM UTC+3, suny nazar wrote:
>
>
> i am getting below error when i am running maven goals via Jenkinsfile. I am 
> not getting this issue when i am running freestyle project with maven goals.
>
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
> (default-compile) on project server: Compilation failure
> [ERROR] Unable to locate the Javac Compiler in:
> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
> [ERROR] Please ensure you are using JDK 1.4 or above and
> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
> [ERROR] In most cases you can change the location of your Java
> [ERROR] installation by setting the JAVA_HOME environment variable.
>
>
> below code has been put in Jenkinsfile.
>
>
> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
> Files\Java\jdk1.8.0_181
>
>
> pipeline {
> agent any
> stages{
> stage('Build'){
> steps {
> bat 'mvn clean package'
> }
> post {
> success {
> echo 'Now Archiving...'
> archiveArtifacts artifacts: '**/target/*.war'
> }
> }
> }
> }
> }
>
>

-- 
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/31846d14-4aa3-449c-9ee9-2547a6b95942%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread Slide
Is JAVA_HOME set to that for the user that Jenkins is running as?

On Tue, Aug 7, 2018 at 5:48 AM suny nazar  wrote:

>
> i am getting below error when i am running maven goals via Jenkinsfile. I am 
> not getting this issue when i am running freestyle project with maven goals.
>
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile 
> (default-compile) on project server: Compilation failure
> [ERROR] Unable to locate the Javac Compiler in:
> [ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
> [ERROR] Please ensure you are using JDK 1.4 or above and
> [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
> [ERROR] In most cases you can change the location of your Java
> [ERROR] installation by setting the JAVA_HOME environment variable.
>
>
> below code has been put in Jenkinsfile.
>
>
> does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
> Files\Java\jdk1.8.0_181
>
>
> pipeline {
> agent any
> stages{
> stage('Build'){
> steps {
> bat 'mvn clean package'
> }
> post {
> success {
> echo 'Now Archiving...'
> archiveArtifacts artifacts: '**/target/*.war'
> }
> }
> }
> }
> }
>
> --
> 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/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPiUgVcOqc-0fSLJ9MMM9qQUrxpX-3wbPi1LyKcVEho4uJH9Xw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Unable to run Maven Goals using pipeline as code.

2018-08-07 Thread suny nazar



i am getting below error when i am running maven goals via Jenkinsfile. I am 
not getting this issue when i am running freestyle project with maven goals.


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) 
on project server: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR]   C:\Program Files\Java\jre1.8.0_181\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.


below code has been put in Jenkinsfile.


does anyone how to fix this , FYI - JAVA_HOME is set to C:\Program 
Files\Java\jdk1.8.0_181


pipeline {
agent any
stages{
stage('Build'){
steps {
bat 'mvn clean package'
}
post {
success {
echo 'Now Archiving...'
archiveArtifacts artifacts: '**/target/*.war'
}
}
}
}
}

-- 
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/f257a74a-c2a8-42ce-89d4-7a69a3c85e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can I have a reusable “post” block for my jenkins pipelines?

2018-08-07 Thread Jan Monterrubio
So, I think what you want is:

Project 1 Jenkins File:

pipeline {

stages {
Stage(‘’npm i’){}
}
commonPost()
}

Project 2 Jenkins file
Pipeline{
Script {
Echo{
}
}
commonPost()
}

Am I getting that correctly?


On Fri, Aug 3, 2018 at 08:20 red 888  wrote:

> wait there seems to be confusion about what i am asking for look at my SO
> post:
> https://stackoverflow.com/questions/51508234/can-i-have-a-reusable-post-block-for-my-jenkins-pipelines
>
>
> I also ready use shared libs, all my pipelines are there. Between those
> several pipelines they all have a post block that is nearly identical. I
> want to reference a parameterized post block ONLY. My post block now is
> like 80 lines of code at the end of each pipeline thats nearly tthe same.
> even after moving most of the post block steps into separate groovy files
> (that are referenced in the post block) the whole post block is still large.
>
> On Thursday, August 2, 2018 at 3:13:56 PM UTC-4, Jan Monterrubio wrote:
>>
>> We do this in our CI. Basically the shared library has some variable
>> parameters you can override and it lets you control what happens based on
>> those. I’ll see if I can scrounge up a sample later today.
>>
>> On Thu, Aug 2, 2018 at 11:04 red 888  wrote:
>>
> how does that work though? My pipelines are already in shared libraries. I
>>> want a shared post block specifically.
>>>
>>>
>>> On Monday, July 30, 2018 at 7:33:21 AM UTC-4, Johan Abildskov wrote:

 You should be able to do this with Shared Libraries:
 https://jenkins.io/doc/book/pipeline/shared-libraries/

 On Thursday, July 26, 2018 at 9:22:53 PM UTC+2, red 888 wrote:
>
> I have many jenkins pipelines for several different platforms but my
> "post{}" block for all those pipelines is pretty samey. And its quite 
> large
> at this point because I include success,unstable,failure and aborted in 
> it.
>
>
> Is there a way to parameterize a reusable post{} block I can import in
> all my pipelines? I'd like to be able to import it and pass it params as
> well (because while its *almost* the same it varies very slightly for
> different pipelines).
>
>
> Here is an example post block that is currently copy and pasted inside
> all my pipeline{}s
>
>
> post {
> success{
> script {
> // I'd like to be able to pass in values for param1 and param2
> someGroovyScript {
> param1 = 'blah1'
> param2 = 'blah2'
> }
> // maybe id want a conditional here that does something with 
> a passed in param
> if (param3 == 'blah3') {
> echo 'doing something'
> }
> }
> }
> unstable{
> ... you get the idea
> }
> aborted{
> ... you get the idea
> }
> failure{
> ... you get the idea
> }
> }
>
> --
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/aa1f5f13-a8c3-42b6-bccc-a35047f0c293%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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/5461e64c-d586-4151-bafd-ebd2076e550a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADgiF9JpX%2BKE2D6cL-42ad5ahVptsX-NKoL2CpUxXycncAzWjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Checkout code using jenkins pipeline in jenkins at a particular and perform build any available nodes/agents

2018-08-07 Thread gaurav pant


 am trying to checkout the code at a particular location (ex. *C:\scm\*) on 
windows using jenkins pipeline (jenkinsfile) and want to execute the build 
from the checkout location (*C:\scm\*) in any available nodes/agents at 
that particular time.

Can you please provide any leads? (Was able to do on linux machine)

Something like below:-

node ('win1')

{

stage ('checkout')

..

}


node ('win2')

{

stage ('build')



}

My requirement is I should checkout my code at particular location (master 
jenkins) whenever my job is triggered and able to build it on any available 
node at that particular time rather than building it on the master jenkins 
only (require this to not overload the jenkins master)

-- 
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/0a967f20-e16f-4cb1-a627-b42053eda381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Chinese Localization SIG

2018-08-07 Thread su suren


Hi all,


DevOps became more and more popular in recent years. As we see, Jenkins 
already takes a very important position. And Jenkins has lots of users in 
all around the world. So, localization became more and more important. In 
China, many people want to use Jenkins as CI server. and also have many 
companies are developing their own plugins.


My folks and I already do this. Like Jenkins website, Jenkins Core, popular 
plugins. But, I wish we can do better. And I wish to let more people know 
this, so they can join us. So I have some proposals:

   - translation rules
   - regular meetings
   - JAM

If you are an owner of some plugins and want us to do some localization 
work for it, you can also let us know it.


If you have any comments/proposals regarding the proposed designs and 
implementations, please respond.


Best regards,

Zhao XiaoJie

-- 
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/417ee932-f792-4a13-b45a-0ea466f608e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Manage Plugins > Check now gives an exception

2018-08-07 Thread David Aldrich
Further information on my problem:

*Manage Jenkins > Manage Plugins > Advanced > Update site* was empty. If I
set that entry to http://updates.jenkins-ci.org/stable/update-center.json
and click *Submit *I get an exception:

java.lang.ClassCastException: hudson.node_monitors.ResponseTimeMonitor
cannot be cast to hudson.model.UpdateSite
at hudson.PluginManager.doSiteConfigure(PluginManager.java:1541)
at 
java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at 
org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
at 
org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at 
org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734)
Caused: javax.servlet.ServletException
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:784)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
at org.kohsuke.stapler.MetaClass$2.doDispatch(MetaClass.java:186)
at 
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:734)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:864)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at 
org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at 
io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at 
com.cloudbees.jenkins.support.slowrequest.SlowRequestFilter.doFilter(SlowRequestFilter.java:37)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at 
io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at 
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
at 
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
at 
net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
at 
org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:114)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
at 
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at 
hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:99)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at 
hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at 
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at 

Manage Plugins > Check now gives an exception

2018-08-07 Thread David Aldrich
Hi

After a system change to our Jenkins master,  *Manage Jenkins > Manage
Plugins > Check now* gives an exception (see below).

What could be causing this?

Best regards

David

Caught exception evaluating: it.shouldDisplay() in /jenkins/log/.
Reason: java.lang.ClassCastException:
hudson.node_monitors.ResponseTimeMonitor cannot be cast to
hudson.model.UpdateSite
java.lang.ClassCastException: hudson.node_monitors.ResponseTimeMonitor
cannot be cast to hudson.model.UpdateSite
at hudson.model.UpdateCenter.getCoreSource(UpdateCenter.java:586)
at 
hudson.model.UpdateCenter$CoreUpdateMonitor.getData(UpdateCenter.java:1003)
at 
hudson.model.UpdateCenter$CoreUpdateMonitor.isActivated(UpdateCenter.java:998)
at 
jenkins.model.Jenkins.lambda$getActiveAdministrativeMonitors$0(Jenkins.java:2124)
at 
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at 
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at 
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at 
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at 
jenkins.model.Jenkins.getActiveAdministrativeMonitors(Jenkins.java:2124)
at 
jenkins.management.AdministrativeMonitorsDecorator.getActiveAdministrativeMonitors(AdministrativeMonitorsDecorator.java:81)
at 
jenkins.management.AdministrativeMonitorsDecorator.getActiveAdministrativeMonitorsCount(AdministrativeMonitorsDecorator.java:76)
at 
jenkins.management.AdministrativeMonitorsDecorator.shouldDisplay(AdministrativeMonitorsDecorator.java:139)
at sun.reflect.GeneratedMethodAccessor315.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
at 
org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
at 
org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
at 
org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
at 
org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
at 
hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
at 
org.apache.commons.jelly.expression.ExpressionSupport.evaluateRecurse(ExpressionSupport.java:61)
at 
org.apache.commons.jelly.expression.ExpressionSupport.evaluateAsBoolean(ExpressionSupport.java:71)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:97)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at 
org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
at 
org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at 
org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
at 
org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
at 

Re: Jenkins: How to run test on multiple hosts in parallel?

2018-08-07 Thread Vijay Hiremath
Thank you for the response.

Unfortunately build is parameterized and each slave connected to Jenkins
host have different parameters.
Hence, cannot use pssh

On Mon, Aug 6, 2018 at 10:20 PM,  wrote:

> If your nodes are on linux, try installing pssh on the server
>
> 1. Install pssh
>  yum install python-pip
>  pip install pssh
>
> 2. create a host file 'pssh-host' with the number of hosts along with IP
> address and port number
>  that you need to connect to remote systems using pssh.
>
> 3. Execute command using pssh from Jenkins Build > Execute shell:
> e.g pssh -h pssh-hosts -l root -A echo "Test"
>
> On Friday, August 3, 2018 at 5:49:24 PM UTC+5:30, Vijay Hiremath wrote:
>>
>> Hi All,
>> How to run test on multiple hosts in parallel? Below is the requirement.
>>
>>1. I have a Jenkins job A.
>>2. 5 hosts are connected to A.
>>3. Test X need to be run on all 5 hosts. Also need to see the status
>>of test on an independent console.
>>4. Result form the hosts need to be independently published
>>5. Currently test X is run on only one host and rest 4 hosts tests
>>are in Queue.
>>
>> I used *"Execute concurrent builds if necessary"* but, it just divides
>> same test on 5 hosts so it does not do what I intended. What is the
>> workaround here?
>> Regards
>> Vijay
>>
> --
> 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/d82a438f-68d4-4f8e-a30c-baf6cd103673%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAL6S71G1kDF4YYCFz9LRndL1VfCr%2BJtYRZtg-j%3DS%3D%3D0s0NoxRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.