Windows Docker Master

2019-08-02 Thread Slide
I have been playing with bringing some of the Linux containers that are
available over to the Windows container land. My end goal is to have better
support on the Jenkins infra for building Windows stuff as necessary (e.g.
winsw, the Windows Installer, and plugin builds). I have played with
creating a Windows Docker Master image [1], but I am not sure if this is
really useful. The only use case for this that I really see is for when you
only have Windows docker available running Windows containers. Is this
something that people would generally be interested in, or does the Windows
docker master meet all needs?

Thanks,

Alex

1 -  https://github.com/jenkinsci/docker/pull/852

-- 
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/CAPiUgVc--be9TpF-LNEmWiAjNoObJjNXUP8RRpWa6sWpe1bHqA%40mail.gmail.com.


Re: WebStart Slave-Agent misbehaving when launched via Windows Task Scheduler

2019-08-02 Thread Slide
It might be better to run the agent as a service under the specific account
you want it to run under. Is there a reason you can't do this?

On Fri, Aug 2, 2019 at 12:11 PM Nef Rey  wrote:

> The problem was that I was selecting the option to start the slave task
> whether the user was logged on or not. This option was blocked in our
> company policy.  Weird that slave acted as if everything was alright  but,
> misbehaved.  I had to select the option to start when the user was logged
> on.  And additionally I had to also specify the "Start in (optional)"
> option in the task so windows knows the path where to begin.
>
> On Tuesday, June 25, 2019 at 11:08:47 AM UTC-5, Nef Rey wrote:
>>
>> I have this very peculiar problem: When I launch the slave agent manually
>> by right clicking and select launch, everything works normally and tests
>> can be executed on that node.
>>
>> However, when I launch the slave-agent via Windows Task Scheduler,
>> Jenkins can see it and can launch tests on that node,  although I do not
>> see the slave-agent window in the node being active, and I can start tests
>> from Jenkins on that node, but nothing runs at the node and eventually
>> Jenkins fails the project.  I have seen this problem several times already
>> to the point where I'm afraid of using task scheduler anymore.  I can not
>> use the slave-agent as a service because I'm running UI Tests.
>>
>> Have anyone seen this problem and have you found a solution?
>>
>> I'm using Jenkins 2.164.3 in Windows.
>>
> --
> 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/1c7a5205-1f41-4781-9b5d-dc2c9e0f1fbe%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/CAPiUgVdL4d1vT%3Da_Tc5meij6eU5MLc%2BPNjjio9AXS6TBfg4uwA%40mail.gmail.com.


Re: WebStart Slave-Agent misbehaving when launched via Windows Task Scheduler

2019-08-02 Thread Nef Rey
The problem was that I was selecting the option to start the slave task 
whether the user was logged on or not. This option was blocked in our 
company policy.  Weird that slave acted as if everything was alright  but, 
misbehaved.  I had to select the option to start when the user was logged 
on.  And additionally I had to also specify the "Start in (optional)" 
option in the task so windows knows the path where to begin.

On Tuesday, June 25, 2019 at 11:08:47 AM UTC-5, Nef Rey wrote:
>
> I have this very peculiar problem: When I launch the slave agent manually 
> by right clicking and select launch, everything works normally and tests 
> can be executed on that node.
>
> However, when I launch the slave-agent via Windows Task Scheduler, Jenkins 
> can see it and can launch tests on that node,  although I do not see the 
> slave-agent window in the node being active, and I can start tests from 
> Jenkins on that node, but nothing runs at the node and eventually Jenkins 
> fails the project.  I have seen this problem several times already to the 
> point where I'm afraid of using task scheduler anymore.  I can not use the 
> slave-agent as a service because I'm running UI Tests.
>
> Have anyone seen this problem and have you found a solution?
>
> I'm using Jenkins 2.164.3 in Windows.
>

-- 
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/1c7a5205-1f41-4781-9b5d-dc2c9e0f1fbe%40googlegroups.com.


Multi branch pipeline - build is failing while creating new branch or tag

2019-08-02 Thread Anish Kuti
Hi ,
I am using Jenkins ver. 2.176.2  and deployed in EC2 
(Ubuntu) . I am using multi branch pipeline . The jenkins file is as below 
.  While I am creating a new branch or tag I was expecting to start a 
build.  But it is not happening . 

What I want that in creation of tags or branch (even if no change in 
tags/branch) , there need to be a build triggered automatically . Pls help 



In creation of new tag -  it is showing below and no build is triggering
No changes in any of the builds, or multiple SCMs in use.
In creation of new branch  -  it is showing below and build is falling 

> git fetch --no-tags --progress 
> g...@gitlab.com:tcscmiiag/nextgenordermgmt/frameworkcode.git 
> +refs/heads/*:refs/remotes/origin/*
Checking out Revision fc72acd2362cc1dd00d4b1ba0125da7c9e2d3aca 
(feature_Z_branch)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f fc72acd2362cc1dd00d4b1ba0125da7c9e2d3aca
Commit message: "updated jenkins File"
First time build. Skipping changelog.



#!groovy
pipeline {
agent none
stages {
stage("Checkout") {
agent any
steps {
checkout scm
}
}
stage('Maven Install and Code Build') {
agent any
environment {
  def  GIT_TAG = sh(returnStdout: true, script: 'git log -n 1 
--pretty=format:\'%H\'').trim()
}

steps {
sh "mvn clean package -DskipTests --settings settings.xml"
}

/*agent {
docker {
image 'maven:3.5.0'
}
}
steps {
sh "mvn clean package --settings settings.xml"
}*/
}
stage('Unit Test') {
agent any

steps {
sh "mvn test --settings settings.xml"
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build --build-arg 
jarfile=framework-0.0.1-SNAPSHOT.jar ' +
'-t 
registry.gitlab.com/tcscmiiag/nextgenordermgmt/frameworkcode'+":$BUILD_NUMBER"+'
 
--pull=true --file=Dockerfile .'
sh 'sh clear-dangling-builds.sh'
}
}
stage('Automated Integration Test') {
agent any
steps {
echo 'Ship to Integration test Env'
echo 'Deploy the docker here '
echo 'Run Integration test suite'
input message: 'Finished Integration Test ? (Click 
"Proceed" to continue)'
echo 'Stop docker in the integration env #'

}
}
stage('Publish Docker image On Tag') {
agent any
when { buildingTag() }
steps {
withCredentials([usernamePassword(credentialsId: 
'gitlabRepo', passwordVariable: 'dockerRepoPassword', usernameVariable: 
'dockerRepoUser')]) {
sh "docker tag 
registry.gitlab.com/tcscmiiag/nextgenordermgmt/frameworkcode:$BUILD_NUMBER 
registry.gitlab.com/tcscmiiag/nextgenordermgmt/frameworkcode:$GIT_TAG"
sh "docker login registry.gitlab.com -u $dockerRepoUser 
-p $dockerRepoPassword"
sh "docker push 
registry.gitlab.com/tcscmiiag/nextgenordermgmt/frameworkcode:$GIT_TAG"

}
}
}
   stage('Deploy in Dev Environment') {
agent any
steps {
input message: 'You want to deploy in which env (dev) ? 
(Click "Proceed" to continue)'
echo 'Checkout docker from registry'
echo 'Connect to the desired environment'
echo 'Deploy here .. probaly use some plugin to deploy in 
the container or container orchestration'


}
}
stage('Deploy in CIT/E2E/Prod Environment') {
agent any
when { buildingTag() }
steps {
script {
// Show the select input modal
def INPUT_PARAMS = input message: 'Please Provide 
Parameters', ok: 'Next',
parameters: [
choice(name: 'ENVIRONMENT', choices: 
['CIT','E2E','PROD','NONE'].join('\n'), description: 'Please select the 
Environment'),
string(defaultValue: "NONE", 
description: 'What is the tag id?', name: 'TAG_ID')]
env.ENVIRONMENT = INPUT_PARAMS.ENVIRONMENT
env.TAG_ID = INPUT_PARAMS.TAG_ID
}
input message: 'You want to deploy in $env.ENVIRONMENT for 
commit-id $env.TAG_ID ? (Click "Proceed" to continue)'
echo 'Checkout docker from registry'
echo 'Connect to the desired environment'
echo 'Deploy here .. probaly use some plugin to deploy in 
the container or container orchestration'


  

Media Shuttle and Jenkins

2019-08-02 Thread t3knoid
Has anyone had experience on automating file transfers with Media Shuttle 
in Jenkins? I was hoping someone has sample code that I can check out. 
Thanks.

https://app.swaggerhub.com/apis-docs/Signiant/MediaShuttle/1.14.0

-- 
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/7a1b9e75-4a24-4e68-9fd5-a54bd12b9411%40googlegroups.com.


Re: Pipeline Input Step

2019-08-02 Thread Lukas Resch

Using

stages {
stage('input') {
input {
message 'Apply changes'
submitterParameter 'COMMITTER'
}//, parameters: [string(defaultValue: 'herp', description: 
'', name: 'derp')]

steps {
echo "${env.COMMITTER}"
}
}
}

I at least get the variable set within my stage, but still not in post. 
In my production file I would like to send out an email to request the 
approval from the team, so moving the input out of the stage is not 
really nice, as the mail would have to be sent from a different stage.


Regards,
Lukas

--
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/6123561c-53ac-afae-6e59-c3b21114f1b2%40ngworx.ag.


Pipeline Input Step

2019-08-02 Thread Lukas Resch

Hi,

I am trying to use the input step and send the name of the person 
accepting the change to an email address. Unfortunately the name in the 
variable is always "null". The name and link in the console output is 
working fine.


There are 2 issues in Jira that are both marked as resolved [0], [1]. 
Also setting an parameter did not change the behaviour for me. I also 
tried a different docker image or setting a submitter for the input step.


While I would understand that there is a scope problem if the name in 
the post stage would be null it is also null when I echo it in the same 
stage.


Is anyone using this successfully and can tell me where I am wrong or 
confirm that the behaviour is not as intended?


Versions:
Jenkins 2.187
Pipeline: Input Step 2.10

Minimal pipeline for reproduction:

pipeline {
agent {
docker {
image 'alpine'
}
}

stages {
stage('input') {
steps {
input message: 'Apply changes', submitterParameter: 
'COMMITTER'//, parameters: [string(defaultValue: 'herp', description: 
'', name: 'derp')]

echo "${env.COMMITTER}"
}
}
}
post {
success {
emailext body: "Changes were applied by ${env.COMMITTER}", 
subject: 'Changes', to: 't...@example.com'

}
}
}

Regards,
Lukas

[0] https://issues.jenkins-ci.org/browse/JENKINS-40594
[1] https://issues.jenkins-ci.org/browse/JENKINS-41421

--
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/9f823518-ee21-c358-6c2f-e7f17a997f81%40ngworx.ag.


Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread Cyrille Le Clerc
@drpm can you test 
https://github.com/jenkinsci/pipeline-maven-plugin/pull/224 ?

@daniel could you kindly review the code of 
https://github.com/jenkinsci/pipeline-maven-plugin/pull/224 it is a simple 
change ?

On Friday, August 2, 2019 at 12:12:01 PM UTC+2, Cyrille Le Clerc wrote:
>
> Thank you very much Daniel, I'll have a look
>
> On Friday, August 2, 2019 at 12:04:04 PM UTC+2, Daniel Beck wrote:
>>
>>
>>
>> > On 2. Aug 2019, at 11:49, Cyrille Le Clerc  
>> wrote: 
>> > 
>> > Do you understand why the downstream pipeline is seen as 
>> unauthenticated? Could there be a configuration glitch on your setup? 
>> > 
>>
>> My guess, not having debugged this further: 
>>
>> Pipeline Maven Plugin seems to have copied code from ReverseBuildTrigger 
>> in core (see your code snippet, 'cf. BuildTrigger') that wasn't adapted to 
>> JENKINS-22949 in https://jenkins.io/changelog/#v2.62 
>>
>> See 
>> https://github.com/jenkinsci/jenkins/commit/915543dca5399d3ba052219ddfe9c3c061e70726
>>  
>> for the change -- there's no need to set the auth to ANONYMOUS anymore if 
>> it's SYSTEM otherwise. 
>>
>>

-- 
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/090a4939-84f7-42c2-b94e-07c45d557b67%40googlegroups.com.


Re: How to automatically build the latest svn tag

2019-08-02 Thread Nico van de Kamp
Question:

I'm not familiar with this specific but I try to get the last version of a 
tag from SVN. I found this.

SVN is installed on another server than the Jenkins server. 

So to run command: *export SVN_TAG=`svn ls --username someuser --password 
somepass --non-interactive http://someproj.googlecode.com/svn/tags 
 |tail -1`* , I think an svn 
client needs to be installed on the jenkins server? Otherwise get the 
message "svn command not found". Is that right or do I miss something?

In the past I use (putty if I remember well) for tunneling: 
*svn+ssh://@*, is that also possible with this construction?

Or does someone have a better idea?

Nico

-- 
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/a5cb96cf-d384-4038-a0d5-16007f831852%40googlegroups.com.


Re: Statistics plugin to help identify bottlenecks

2019-08-02 Thread Mark Waite
You're correct that the DevOptics metrics are stored centrally in the cloud
rather than being hosted on your servers.

On Fri, Aug 2, 2019 at 5:54 AM Bjoern Hinrichs 
wrote:

> Hi Mark,
>
> thanks for your input.
> DevOptics seems promising, but as far as I can see DevOptics can't be
> hosted on-site, i.e. we would be dependent on (and sending internal data
> to) CloudBee's servers? Unfortunately, that's not possible for us.
>
> Regards
> Björn
>
> Am 8/1/2019 um 5:23 PM schrieb Mark Waite:
>
> I use CloudBees DevOptics to track utilization by label.  The label
> tracking portion ("Run Insights") is free.  I used it to confirm that my
> cluster is "unbalanced" and needs much more Windows execution capacity in
> order to be balanced.  See more at
> https://www.cloudbees.com/products/cloudbees-devoptics
>
> Here is a screenshot of a portion of the report showing my lack of Windows
> executors.  The top nodes listed are individual windows agents, then the
> bottom of the image is the aggregate "windows" label (maintained by the
> platform labeler plugin).
>
> [image: devoptics-labels.png]
>
> On Thu, Aug 1, 2019 at 9:13 AM Bjoern Hinrichs 
> wrote:
>
>> Hi,
>>
>> we use Matrix jobs for our build and test pipeline.
>> All of our test agents carry labels describing OS version, OS language,
>> whether other tools are installed (and in which version), ...
>>
>> To identify bottlenecks we need a plugin that allows us to see
>> statistics like utilization of our nodes and (especially) wait times in
>> queue per label.
>>
>> We tried several plugins, but couldn't find one that fits our needs; the
>> last one we tried was Cluster Statistics Plugin, which gives an average
>> wait time in queue, but unfortunately not per label.
>>
>> Are there any plugins out there that might work for us?
>>
>> Thanks in advance
>> Björn Hinrichs
>>
>> --
>> 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/39a95742-f7f7-bbf5-8244-7d9ec8b21237%40btc-es.de
>> .
>>
>
>
> --
> Thanks!
> Mark Waite
> --
> 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/CAO49JtEWbku0qFsYAXcwQuMpczGmubFmxC0sR_U5ZTOFxwrKGw%40mail.gmail.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/dc5909a4-1df5-aee3-28aa-119bfa849d04%40btc-es.de
> 
> .
>


-- 
Thanks!
Mark Waite

-- 
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/CAO49JtFj6X4y0rx-E9p-NKVNbs4yg39bLYz%3D4kxUd4BjioD9iQ%40mail.gmail.com.


Re: Increase Heap for Jenkins installed in Windows Server 2012 R2

2019-08-02 Thread Slide
The problem is that the current Windows installer is bundled with a 32-bit
JRE. If you install a 64-bit JRE and update the path to java.exe in the
jenkins.xml file, you should be able to allocate more.

On Fri, Aug 2, 2019, 04:12 Balaajee Perumalsamy 
wrote:

> Hello All,
>
> I have an instance of Jenkins running in Windows Server 2012 R2.
> I often get JVM Mem Starvation issue in this machine and all my slaves get
> terminated.
>
> The machine has 32GB RAM where as I'm not able to configure -Xmx more than
> 1024m. I get the following error.
> [image: image.png]
>
> Has anyone faced/solved this issue.
>
> Regards,
> Balaajee
>
> --
> 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/CAEO7OYi06kh%3DcVvK7bO0weLJscTASM0-Ei2f%2Barc%3Dip6HbaPbA%40mail.gmail.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/CAPiUgVejMiLEBKrOEuC7MV%3D%3DSzzN5hb%3D027D0-6EfViWEKCjeg%40mail.gmail.com.


Re: Statistics plugin to help identify bottlenecks

2019-08-02 Thread Bjoern Hinrichs

Hi Mark,

thanks for your input.
DevOptics seems promising, but as far as I can see DevOptics can't be 
hosted on-site, i.e. we would be dependent on (and sending internal data 
to) CloudBee's servers? Unfortunately, that's not possible for us.


Regards
Björn

Am 8/1/2019 um 5:23 PM schrieb Mark Waite:
I use CloudBees DevOptics to track utilization by label.  The label 
tracking portion ("Run Insights") is free.  I used it to confirm that 
my cluster is "unbalanced" and needs much more Windows execution 
capacity in order to be balanced. See more at 
https://www.cloudbees.com/products/cloudbees-devoptics


Here is a screenshot of a portion of the report showing my lack of 
Windows executors.  The top nodes listed are individual windows 
agents, then the bottom of the image is the aggregate "windows" label 
(maintained by the platform labeler plugin).


devoptics-labels.png

On Thu, Aug 1, 2019 at 9:13 AM Bjoern Hinrichs 
mailto:bjoern.hinri...@btc-es.de>> wrote:


Hi,

we use Matrix jobs for our build and test pipeline.
All of our test agents carry labels describing OS version, OS
language,
whether other tools are installed (and in which version), ...

To identify bottlenecks we need a plugin that allows us to see
statistics like utilization of our nodes and (especially) wait
times in
queue per label.

We tried several plugins, but couldn't find one that fits our
needs; the
last one we tried was Cluster Statistics Plugin, which gives an
average
wait time in queue, but unfortunately not per label.

Are there any plugins out there that might work for us?

Thanks in advance
Björn Hinrichs

-- 
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/39a95742-f7f7-bbf5-8244-7d9ec8b21237%40btc-es.de.



--
Thanks!
Mark Waite
--
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/CAO49JtEWbku0qFsYAXcwQuMpczGmubFmxC0sR_U5ZTOFxwrKGw%40mail.gmail.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/dc5909a4-1df5-aee3-28aa-119bfa849d04%40btc-es.de.


Increase Heap for Jenkins installed in Windows Server 2012 R2

2019-08-02 Thread Balaajee Perumalsamy
Hello All,

I have an instance of Jenkins running in Windows Server 2012 R2.
I often get JVM Mem Starvation issue in this machine and all my slaves get
terminated.

The machine has 32GB RAM where as I'm not able to configure -Xmx more than
1024m. I get the following error.
[image: image.png]

Has anyone faced/solved this issue.

Regards,
Balaajee

-- 
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/CAEO7OYi06kh%3DcVvK7bO0weLJscTASM0-Ei2f%2Barc%3Dip6HbaPbA%40mail.gmail.com.


How to setup jenkins master cluster

2019-08-02 Thread zhao chenxiao
Hi Jenkins experts,

We are using  a jenkins pipeline to launch our test jobs, which also 
defined in jenkins. If the pipeline starts to run, about 600+ Jenkins jobs 
will be triggered to run at the same time using kubernetes container as 
slaves.

A jenkins master connects to such many slaves may cause performance issue. 
So we want to create a jenkins master cluster. Our original design is to 
use mount the same NFS storage to different jenkins masters and use load 
balance to distribute the workload to different masters. 

But we found it's hard to implement this idea, because if master A changes 
the config, we have to reload master B, C to accept the configuration. 
There will be disconnect time for B and C. And there will be file conflicts 
when we change configuration at the same time.

My question is whether there are a good way to setup jenkins master cluster 
and what's the limit of the slaves number for a jenkins master. Looking 
forward to your reply. 

Thanks.

-- 
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/34991b90-33ba-4c2b-9e46-c2a8ec29868e%40googlegroups.com.


Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread Cyrille Le Clerc
Thank you very much Daniel, I'll have a look

On Friday, August 2, 2019 at 12:04:04 PM UTC+2, Daniel Beck wrote:
>
>
>
> > On 2. Aug 2019, at 11:49, Cyrille Le Clerc  > wrote: 
> > 
> > Do you understand why the downstream pipeline is seen as 
> unauthenticated? Could there be a configuration glitch on your setup? 
> > 
>
> My guess, not having debugged this further: 
>
> Pipeline Maven Plugin seems to have copied code from ReverseBuildTrigger 
> in core (see your code snippet, 'cf. BuildTrigger') that wasn't adapted to 
> JENKINS-22949 in https://jenkins.io/changelog/#v2.62 
>
> See 
> https://github.com/jenkinsci/jenkins/commit/915543dca5399d3ba052219ddfe9c3c061e70726
>  
> for the change -- there's no need to set the auth to ANONYMOUS anymore if 
> it's SYSTEM otherwise. 
>
>

-- 
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/74b51013-9cb7-4bb1-87e4-a4e33bd29f78%40googlegroups.com.


Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread Daniel Beck



> On 2. Aug 2019, at 11:49, Cyrille Le Clerc  wrote:
> 
> Do you understand why the downstream pipeline is seen as unauthenticated? 
> Could there be a configuration glitch on your setup?
> 

My guess, not having debugged this further:

Pipeline Maven Plugin seems to have copied code from ReverseBuildTrigger in 
core (see your code snippet, 'cf. BuildTrigger') that wasn't adapted to 
JENKINS-22949 in https://jenkins.io/changelog/#v2.62

See 
https://github.com/jenkinsci/jenkins/commit/915543dca5399d3ba052219ddfe9c3c061e70726
 for the change -- there's no need to set the auth to ANONYMOUS anymore if it's 
SYSTEM otherwise.

-- 
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/F1590A34-25AC-4499-BF96-13A93C79F03D%40beckweb.net.


Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread Cyrille Le Clerc
Thanks,

Could you by any chance create a bug on https://issues.jenkins-ci.org with 
the label pipeline-maven-plugin detailing the problem so that it will be 
easier to manage and easier to share knowledge with other users?

Do you understand why the downstream pipeline is seen as unauthenticated? 
Could there be a configuration glitch on your setup?

Cyrille

On Friday, August 2, 2019 at 11:32:57 AM UTC+2, drpm wrote:
>
> Oh It is using the anonymous user for it.
>
> isUpstreamBuildVisibleByDownstreamBuildAuth(org.jenkinsci.plugins.workflow.job.WorkflowJob@3e3adefa[],
>  
>> org.jenkinsci.plugins.workflow.job.WorkflowJob@7b2c0800[]): 
>> taskAuth: 
>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
>> Username: SYSTEM; Password: [PROTECTED]; Authenticated: false; Details: 
>> null; Not granted any authorities, downstreamPipelineAuth: 
>> org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken@ffc4: 
>> Username: *anonymous*; Password: [PROTECTED]; Authenticated: true; 
>> Details: null; Granted Authorities: anonymous, 
>> upstreamPipelineObtainedAsImpersonated:null, result: false
>>
>
>
> On Friday, August 2, 2019 at 6:15:48 PM UTC+9, Cyrille Le Clerc wrote:
>>
>> Can you please enable FINER 
>> on org.jenkinsci.plugins.pipeline.maven.service.PipelineTriggerService ? I 
>> am interested by the message of 
>> isUpstreamBuildVisibleByDownstreamBuildAuth
>>
>>
>> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.8.0/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/service/PipelineTriggerService.java#L332
>>
>> public boolean isUpstreamBuildVisibleByDownstreamBuildAuth(@Nonnull 
>>> WorkflowJob upstreamPipeline, @Nonnull Queue.Task downstreamPipeline) {
>>> Authentication auth = 
>>> Tasks.getAuthenticationOf(downstreamPipeline);
>>> Authentication downstreamPipelineAuth;
>>> if (auth.equals(ACL.SYSTEM) && 
>>> !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) {
>>> downstreamPipelineAuth = Jenkins.ANONYMOUS; // cf. 
>>> BuildTrigger
>>> } else {
>>> downstreamPipelineAuth = auth;
>>> }
>>> try (ACLContext ignored = ACL.as(downstreamPipelineAuth)) {
>>> WorkflowJob upstreamPipelineObtainedAsImpersonated = 
>>> getItemByFullName(upstreamPipeline.getFullName(), WorkflowJob.class);
>>> boolean result = upstreamPipelineObtainedAsImpersonated != 
>>> null;
>>> LOGGER.log(Level.FINE, 
>>> "isUpstreamBuildVisibleByDownstreamBuildAuth({0}, {1}): taskAuth: {2}, 
>>> downstreamPipelineAuth: {3}, upstreamPipelineObtainedAsImpersonated:{4}, 
>>> result: {5}",
>>> new Object[]{upstreamPipeline, downstreamPipeline, 
>>> auth, downstreamPipelineAuth, upstreamPipelineObtainedAsImpersonated, 
>>> result});
>>> return result;
>>> }
>>> }
>>
>>
>>
>> On Friday, August 2, 2019 at 1:31:49 AM UTC+2, drpm wrote:
>>>
>>> Hello,
>>>
>>> Thank you for your reply. 
>>>
>>> Yes I do have Jenkins Authorize Project 
>>> plugin. I tried running 
>>> it as a SYSTEM and user with admin privileges and still having the same 
>>> error. 
>>>
>>> *As SYSTEM user: *
>>>

 upstreamPipeline (, visibleByDownstreamBuildAuth: 
 false),  downstreamPipeline (, 
 visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
 org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
 Username: SYSTEM; Password: [PROTECTED]; Authenticated: false; Details: 
 null; Not granted any authorities
 Skip triggering of  by  
 #: downstreamVisibleByUpstreamBuildAuth: true, 
 upstreamVisibleByDownstreamBuildAuth: false
>>>
>>>
>>>
>>> *As USER WITH PRIV:*
>>>
>>> upstreamPipeline (, visibleByDownstreamBuildAuth: 
 false),  downstreamPipeline (, 
 visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
 org.acegisecurity.providers.UsernamePasswordAuthenticationToken@72da9556: 
 Username: ; Password: [PROTECTED]; Authenticated: 
 true; Details: null; Granted Authorities: authenticated
 Skip triggering of  by  
 #: downstreamVisibleByUpstreamBuildAuth: true, 
 upstreamVisibleByDownstreamBuildAuth: false
>>>
>>>
>>> I also use this plugin: Role+Strategy+Plugin 
>>> 
>>>
>>> Do I need to create a special role? 
>>>
>>> - drpm
>>>
>>> On Friday, August 2, 2019 at 6:02:11 AM UTC+9, Cyrille Le Clerc wrote:

 Hello,

 Could you be using the Jenkins Authorize Project Plugin 
  and impersonate your 
 builds with a user different from SYSTEM? What is the "" displayed 
 in 
 the log message "upstreamPipeline... Username: "?

 When not using the  Jenkins Authorize Project Plugin 
 , the user used to run 
 the 

Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread drpm
Oh It is using the anonymous user for it.

isUpstreamBuildVisibleByDownstreamBuildAuth(org.jenkinsci.plugins.workflow.job.WorkflowJob@3e3adefa[],
 
> org.jenkinsci.plugins.workflow.job.WorkflowJob@7b2c0800[]): 
> taskAuth: 
> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
> Username: SYSTEM; Password: [PROTECTED]; Authenticated: false; Details: 
> null; Not granted any authorities, downstreamPipelineAuth: 
> org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken@ffc4: 
> Username: *anonymous*; Password: [PROTECTED]; Authenticated: true; 
> Details: null; Granted Authorities: anonymous, 
> upstreamPipelineObtainedAsImpersonated:null, result: false
>


On Friday, August 2, 2019 at 6:15:48 PM UTC+9, Cyrille Le Clerc wrote:
>
> Can you please enable FINER 
> on org.jenkinsci.plugins.pipeline.maven.service.PipelineTriggerService ? I 
> am interested by the message of 
> isUpstreamBuildVisibleByDownstreamBuildAuth
>
>
> https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.8.0/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/service/PipelineTriggerService.java#L332
>
> public boolean isUpstreamBuildVisibleByDownstreamBuildAuth(@Nonnull 
>> WorkflowJob upstreamPipeline, @Nonnull Queue.Task downstreamPipeline) {
>> Authentication auth = 
>> Tasks.getAuthenticationOf(downstreamPipeline);
>> Authentication downstreamPipelineAuth;
>> if (auth.equals(ACL.SYSTEM) && 
>> !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) {
>> downstreamPipelineAuth = Jenkins.ANONYMOUS; // cf. 
>> BuildTrigger
>> } else {
>> downstreamPipelineAuth = auth;
>> }
>> try (ACLContext ignored = ACL.as(downstreamPipelineAuth)) {
>> WorkflowJob upstreamPipelineObtainedAsImpersonated = 
>> getItemByFullName(upstreamPipeline.getFullName(), WorkflowJob.class);
>> boolean result = upstreamPipelineObtainedAsImpersonated != 
>> null;
>> LOGGER.log(Level.FINE, 
>> "isUpstreamBuildVisibleByDownstreamBuildAuth({0}, {1}): taskAuth: {2}, 
>> downstreamPipelineAuth: {3}, upstreamPipelineObtainedAsImpersonated:{4}, 
>> result: {5}",
>> new Object[]{upstreamPipeline, downstreamPipeline, 
>> auth, downstreamPipelineAuth, upstreamPipelineObtainedAsImpersonated, 
>> result});
>> return result;
>> }
>> }
>
>
>
> On Friday, August 2, 2019 at 1:31:49 AM UTC+2, drpm wrote:
>>
>> Hello,
>>
>> Thank you for your reply. 
>>
>> Yes I do have Jenkins Authorize Project 
>> plugin. I tried running it 
>> as a SYSTEM and user with admin privileges and still having the same error. 
>>
>> *As SYSTEM user: *
>>
>>>
>>> upstreamPipeline (, visibleByDownstreamBuildAuth: 
>>> false),  downstreamPipeline (, 
>>> visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
>>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
>>> Username: SYSTEM; Password: [PROTECTED]; Authenticated: false; Details: 
>>> null; Not granted any authorities
>>> Skip triggering of  by  
>>> #: downstreamVisibleByUpstreamBuildAuth: true, 
>>> upstreamVisibleByDownstreamBuildAuth: false
>>
>>
>>
>> *As USER WITH PRIV:*
>>
>> upstreamPipeline (, visibleByDownstreamBuildAuth: 
>>> false),  downstreamPipeline (, 
>>> visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
>>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@72da9556: 
>>> Username: ; Password: [PROTECTED]; Authenticated: 
>>> true; Details: null; Granted Authorities: authenticated
>>> Skip triggering of  by  
>>> #: downstreamVisibleByUpstreamBuildAuth: true, 
>>> upstreamVisibleByDownstreamBuildAuth: false
>>
>>
>> I also use this plugin: Role+Strategy+Plugin 
>> 
>>
>> Do I need to create a special role? 
>>
>> - drpm
>>
>> On Friday, August 2, 2019 at 6:02:11 AM UTC+9, Cyrille Le Clerc wrote:
>>>
>>> Hello,
>>>
>>> Could you be using the Jenkins Authorize Project Plugin 
>>>  and impersonate your 
>>> builds with a user different from SYSTEM? What is the "" displayed in 
>>> the log message "upstreamPipeline... Username: "?
>>>
>>> When not using the  Jenkins Authorize Project Plugin 
>>> , the user used to run 
>>> the upstream pipelines is SYSTEM as we can see in the sample below
>>>
>>> upstreamPipeline (plugins/pipeline-maven-plugin/dependency-graph/my-jar, 
 visibleByDownstreamBuildAuth: true),  downstreamPipeline 
 (plugins/pipeline-maven-plugin/dependency-graph/my-war-multibranch/master, 
 visibleByUpstreamBuildAuth: true), *upstreamBuildAuth*: 
 org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
 *Username: 
 SYSTEM*; Password: [PROTECTED]; Authenticated: false; Details: null; 
 Not granted any authorities
>>>

Re: Jenkins Pipeline Maven Plugin - Always skipping downstream job

2019-08-02 Thread Cyrille Le Clerc
Can you please enable FINER 
on org.jenkinsci.plugins.pipeline.maven.service.PipelineTriggerService ? I 
am interested by the message of isUpstreamBuildVisibleByDownstreamBuildAuth

https://github.com/jenkinsci/pipeline-maven-plugin/blob/pipeline-maven-3.8.0/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/service/PipelineTriggerService.java#L332

public boolean isUpstreamBuildVisibleByDownstreamBuildAuth(@Nonnull 
> WorkflowJob upstreamPipeline, @Nonnull Queue.Task downstreamPipeline) {
> Authentication auth = 
> Tasks.getAuthenticationOf(downstreamPipeline);
> Authentication downstreamPipelineAuth;
> if (auth.equals(ACL.SYSTEM) && 
> !QueueItemAuthenticatorConfiguration.get().getAuthenticators().isEmpty()) {
> downstreamPipelineAuth = Jenkins.ANONYMOUS; // cf. BuildTrigger
> } else {
> downstreamPipelineAuth = auth;
> }
> try (ACLContext ignored = ACL.as(downstreamPipelineAuth)) {
> WorkflowJob upstreamPipelineObtainedAsImpersonated = 
> getItemByFullName(upstreamPipeline.getFullName(), WorkflowJob.class);
> boolean result = upstreamPipelineObtainedAsImpersonated != 
> null;
> LOGGER.log(Level.FINE, 
> "isUpstreamBuildVisibleByDownstreamBuildAuth({0}, {1}): taskAuth: {2}, 
> downstreamPipelineAuth: {3}, upstreamPipelineObtainedAsImpersonated:{4}, 
> result: {5}",
> new Object[]{upstreamPipeline, downstreamPipeline, 
> auth, downstreamPipelineAuth, upstreamPipelineObtainedAsImpersonated, 
> result});
> return result;
> }
> }



On Friday, August 2, 2019 at 1:31:49 AM UTC+2, drpm wrote:
>
> Hello,
>
> Thank you for your reply. 
>
> Yes I do have Jenkins Authorize Project 
> plugin. I tried running it 
> as a SYSTEM and user with admin privileges and still having the same error. 
>
> *As SYSTEM user: *
>
>>
>> upstreamPipeline (, visibleByDownstreamBuildAuth: 
>> false),  downstreamPipeline (, 
>> visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
>> Username: SYSTEM; Password: [PROTECTED]; Authenticated: false; Details: 
>> null; Not granted any authorities
>> Skip triggering of  by  #: 
>> downstreamVisibleByUpstreamBuildAuth: true, 
>> upstreamVisibleByDownstreamBuildAuth: false
>
>
>
> *As USER WITH PRIV:*
>
> upstreamPipeline (, visibleByDownstreamBuildAuth: false),  
>> downstreamPipeline (, visibleByUpstreamBuildAuth: 
>> true), upstreamBuildAuth: 
>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@72da9556: 
>> Username: ; Password: [PROTECTED]; Authenticated: 
>> true; Details: null; Granted Authorities: authenticated
>> Skip triggering of  by  #: 
>> downstreamVisibleByUpstreamBuildAuth: true, 
>> upstreamVisibleByDownstreamBuildAuth: false
>
>
> I also use this plugin: Role+Strategy+Plugin 
> 
>
> Do I need to create a special role? 
>
> - drpm
>
> On Friday, August 2, 2019 at 6:02:11 AM UTC+9, Cyrille Le Clerc wrote:
>>
>> Hello,
>>
>> Could you be using the Jenkins Authorize Project Plugin 
>>  and impersonate your 
>> builds with a user different from SYSTEM? What is the "" displayed in 
>> the log message "upstreamPipeline... Username: "?
>>
>> When not using the  Jenkins Authorize Project Plugin 
>> , the user used to run the 
>> upstream pipelines is SYSTEM as we can see in the sample below
>>
>> upstreamPipeline (plugins/pipeline-maven-plugin/dependency-graph/my-jar, 
>>> visibleByDownstreamBuildAuth: true),  downstreamPipeline 
>>> (plugins/pipeline-maven-plugin/dependency-graph/my-war-multibranch/master, 
>>> visibleByUpstreamBuildAuth: true), *upstreamBuildAuth*: 
>>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
>>> *Username: 
>>> SYSTEM*; Password: [PROTECTED]; Authenticated: false; Details: null; 
>>> Not granted any authorities
>>
>>
>> Cyrille
>>
>>
>> On Thursday, August 1, 2019 at 9:26:34 AM UTC+2, drpm wrote:
>>>
>>> I'm having an issue regarding Jenkins Pipeline Maven Plugin 
>>> (*https://wiki.jenkins.io/display/JENKINS/Pipeline+Maven+Plugin 
>>> *). It 
>>> always skips the downstream jobs even if "*Build whenever a SNAPSHOT 
>>> dependency is built*" is checked.
>>>
>>> Here's the FINER logs for Downstream listener(
>>> *org.jenkinsci.plugins.pipeline.maven.listeners.DownstreamPipelineTriggerRunListener*
>>> ):
>>>
>>> *upstreamPipeline (, visibleByDownstreamBuildAuth: 
>>> false),  downstreamPipeline (, 
>>> visibleByUpstreamBuildAuth: true), upstreamBuildAuth: 
>>> org.acegisecurity.providers.UsernamePasswordAuthenticationToken@1f: 
>>> Username: ; Password: [PROTECTED]; *
>>>
>>> *Skip triggering of  by  
>>> #: 

Re: POSTing zip file using httpRequest in Jenkinsfile

2019-08-02 Thread deepak t.s


On Tuesday, 31 January 2017 02:34:13 UTC+5:30, Christopher Burke wrote:
>
> Hey everyone
>
>Part of my build pipeline requires that I publish a zip file to a 
> server, so I'm trying the following:
>
> response = httpRequest httpMode: 'POST', contentType: 
> 'APPLICATION_OCTETSTREAM', body:"...", url: "${urlForPublish}"
>
>I'm not sure how to specify the body correctly, though. Could anyone 
> point me to an example or offer any suggestions? In the meantime, I've 
> worked around this by using curl, but it seems like using the httpRequest 
> step would be preferable.
>
>Thanks,
>
>--- Chris
>
> 
>
This worked for Me : 

def response =  httpRequest(acceptType: 'APPLICATION_JSON', contentType: 
'APPLICATION_ZIP',
 customHeaders  : [[name: "authorization" , value : 
"${authToken}"],[name: 'x-username' , value: 'admin']],
 httpMode: 'POST', ignoreSslErrors: true, 
multipartName: 'AppDefenseBundle.zip', timeout: 900,

 responseHandle: 'NONE', uploadFile: 
"${bundleUploadPath}", url: "${url}") 

-- 
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/f5877e61-7968-40de-bf0d-f5fb2c1beebe%40googlegroups.com.