Re: How can I inject environment variables into my groovy class?

2017-11-29 Thread red 888
So this is a problem for me because the APIs I'm using in the groovy class 
are looking for OS level environment variables.

Is there any way to set these variables with jenkins?

On Tuesday, November 28, 2017 at 5:54:37 PM UTC-5, mpapo - Michael 
Pailloncy wrote:
>
> Pipeline environment variables are not stored at the OS level. That's why 
> you are not able to get them using *System.getenv() *(which only list OS 
> level environment variables).
> But you should be able to retrieve them like any other classical 
> environment variables : with the "${MyVar}" syntax inside your shared lib 
> class.
>
> Hopefully it helps.
>
> Michaël
>
> 2017-11-28 22:30 GMT+01:00 red 888 >:
>
>> My pipeline is using the environment directive to set an environment var 
>> and then calls a groovy class:
>>
>> def call(int blah) {
>>
>> pipeline {
>> agent any
>>
>> environment {
>> MyVar = credentials('djsjflsjfljsf')
>> }
>>
>> stages {
>> stage('Stage ONE') {
>> steps {
>> echo test.methodA()
>>
>> 
>>
>>
>>
>> But from in my groovy class I don't see those environment variables:
>>
>> // vars/test.groovy
>>
>>
>> class test implements Serializable {
>> static methodA (){
>>
>> def env = System.getenv()
>> return env.dump()
>> //return ['powershell', 'ls env:'].execute().text
>>
>> }
>>
>>  
>> env.dump() and listing envs from the shell from inside the class doesn't 
>> show those variables I added in the environment directive. Can I change the 
>> scope of the class to give it access to these environment vars?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> 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/87b6e2b0-ed9a-4ede-b22c-3b06761345e1%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/6e7e1b97-7b9c-404f-9597-8577eb739b96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


The subscription id is not valid

2017-11-29 Thread Sabitha M
Hi Team,

Currently I am trying to configure Azure Agents on Jenkins

I am trying to add Microsoft Azure Service Principle  to Jenkins 
Credentials but failing even through have provided correct Subscription id

Error message while testing

The subscription id is not valid. (Verify Service Principle ) 

 

-- 
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/6d87cda1-f522-4d90-9728-4f3742f56f09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Triggering Jenkins Multibranch Pipeline by raising a Pull Request in GitHub

2017-11-29 Thread Stephen Connolly
On Wed 29 Nov 2017 at 13:27, Ramanathan Muthaiah 
wrote:

> So I need to trigger this Multibranch pipeline whenever there is a Pull
>> Request raised on GitHub. I want this pipeline to trigger automatically
>> when there is a PR on GitHub.
>> What do I need to do to achieve this approach?
>> Is it possible to trigger Multibranch pipeline automatically whenever a
>> PR is raised on GitHub?
>>
>
> Yes, configure webhook in GH repository to send event related to Pull
> Request, if that's sufficient for your requirement. Select all the events
> (don't remember the exact name) if you have need for all the events to be
> passed to jenkins master.
>
> NOTE:
> Jenkinsfile may or may not need the property (related to github push) to
> be set. There were few threads in this group on this setting.
>

If multibranch *do _not_ set* as multibranch is opinionated and will
respond to the events itself... setting the property may result in double
builds or other strange behaviour

>
> /Ram
>
> --
> 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/b99e6c4e-da0b-4582-a1b3-7534d6f84f93%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from my phone

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


Re: config.xml is overwritten on first start of docker container

2017-11-29 Thread Jose Gerardo Pineda Galindo
I think I am late by a year jeje. But I ran into the same problem. Later I 
realized the config.xml was overwritten because I had other 2 groovy 
scripts that created a new user, then when running the container I saw 
those groovy scripts being executed and the config.xml file was generated, 
overwritting the one I copied to jenkins. So just to be sure check that you 
don't have a groovy script that generates security settings for the user.

Best regards,

On Wednesday, December 28, 2016 at 3:48:45 PM UTC-6, Mark Waite wrote:
>
> That description seems like a bug to me, though I can't see anything in 
> the Docker scripts that helps me understand where the problem would be.  If 
> I understand your description correctly, you need both the init.groovy.d 
> scripts and the install-plugins.sh call before you see the problem.  The 
> groovy scripts seem to be making standard calls to load and save 
> configuration, and the install-plugins.sh script doesn't seem to make any 
> changes to the root config.xml file.
>
> I believe the https://github.com/jenkinsci/docker repository has a place 
> for bug reports.  You probably want to submit a detailed description there, 
> in hopes one of the maintainers is able to help.
>
> Mark Waite
>
> On Wed, Dec 28, 2016 at 8:39 AM Stefan Rademacher  > wrote:
>
>> Thanks for your reply. I tried to narrow things down:
>>
>> A simple Dockerfile, that only copies "my" config.xml to 
>> /usr/share/jenkins/ref/ works fine. The config.xml is kept unmodified as 
>> expected. 
>> (The only thing, that is different between "my" config.xml and a default 
>> config.xml is the line false, which is true 
>> by default.)
>> FROM jenkins:alpine
>> COPY config.xml /usr/share/jenkins/ref/
>> See 
>> https://github.com/sradi/jenkins-provisioning-problem/tree/5eea71d967cba618884aafb2b74245f75d0900e8
>>
>> Adding some scripts to init.groovy.d (change number of executors and 
>> create a default user 'admin')... Still everything works as expected.
>> See 
>> https://github.com/sradi/jenkins-provisioning-problem/tree/12a431ccac229b3d24f5404e0aedc7d02810a8b1
>>
>> Additionally run 'install-plugins.sh'... PROBLEM OCCURS: The config.xml 
>> is unexpectedly modified (disableSignup is reset to 'true').
>> FROM jenkins:alpine
>> RUN /usr/local/bin/install-plugins.sh matrix-auth 
>> COPY init.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/ 
>> COPY config.xml /usr/share/jenkins/ref/
>> See 
>> https://github.com/sradi/jenkins-provisioning-problem/tree/e073854ecd0e017d53f804c45a971399080efb46
>>
>> When I only keep the plugin installation in my Dockerfile and remove any 
>> init script, the problem again, does NOT occur.
>> See 
>> https://github.com/sradi/jenkins-provisioning-problem/tree/d1a8b5a70016701db2559804896a77921b67ab17
>>
>> *Summary*: As soon as I use an init script, that e. g. changes my numer 
>> of executors AND use install-plugins.sh in my Dockerfile, the problem 
>> occurs.
>>
>> The problem can be reproduced, if you checkout the different commits of 
>> the repository, mentioned above, and run the following commands:
>> docker build --rm -t jenkinsproblem:latest .
>> docker run -p 8080:8080 -p 5:5 -d --name jenkinsproblem_1 
>> jenkinsproblem
>> # run this several times, until you see, that numExecutors is changed to 
>> '0'. If 'disableSignup' changed from 'false' to 'true' the problem is 
>> reproduced.
>> docker exec jenkinsproblem_1 cat /var/jenkins_home/config.xml
>>
>> Hope, anyone can help me. Is this a bug?
>>
>> Thanks a lot and best regards
>> Stefan
>>
>>
>>
>> Am Montag, 19. Dezember 2016 17:59:21 UTC+1 schrieb Mark Waite:
>>
>>> Since you're adding the configuration in your Dockerfile, it should be 
>>> there when the docker image is created.  Since you can see it for the first 
>>> few seconds in the running image, I think that means the jenkins.sh startup 
>>> process which copies from "ref" to "/var/jenkins_home" did what it was 
>>> expected to do (though there is a risk you're seeing it before jenkins.sh 
>>> copies in the file from ref/config.xml).
>>>
>>> Since a change is happening after jenkins.sh has copied the ref content 
>>> into the runtime location, I assume it must be something other than the 
>>> jenkins.sh startup process which is replacing your modified ref/config.xml 
>>> file with a different config.xml file.  However, I don't know of anything 
>>> after that which could make that type of change.
>>>
>>> Are you entirely sure that the modified file is in the /var/jenkins_home 
>>> directory even after the jenkins.sh script has run?
>>>
>>> I regularly use a modified config.xml to configure a Jenkins Docker 
>>> instance, and it has worked quite well for me.  If you'd like to compare 
>>> how mine is configured, you could look at 
>>> https://github.com/MarkEWaite/docker/blob/lts-with-plugins/ref/config.xml
>>>  .
>>>
>>> Thanks,
>>> Mark Waite
>>>
>>> On Mon, Dec 19, 2016 at 12:27 AM Stefan Rademacher  
>>> wrote:
>>>
>> Hi there,

 I am

Re: Unable to connect to TFS server 2017 from Jenkins

2017-11-29 Thread CC
I checked and we do have "All Unassigned" setting for port 443. However, we 
do have Require Server Name Indication checkbox checked. Our IT department 
is hesitant to remove that check.

so is this is bug in TFS plugin? I am trying to understand the issue so 
that I can convince IT department.

Thank you! 

On Tuesday, November 28, 2017 at 4:13:33 PM UTC-6, CC wrote:
>
> Thank you so much for your reply.
>
> Could you please elaborate more on how did you add cert to "All 
> Unassigned" IP-addresses?
>
> On Tuesday, November 28, 2017 at 8:02:49 AM UTC-6, Andreas Lunderhage 
> wrote:
>>
>> I had the exact same problem.
>>
>> My problem was that there was no default certificate set on the TFS host 
>> in case no SNI name was sent in the TLS handshake. Adding the same cert to 
>> "All Unassigned" IP-addresses for port 443 as for the hostname of the cert 
>> for the port binding solved the problem.
>>
>

-- 
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/01fdfd81-8f01-47e9-a6f2-de90034b20ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Working pipeline has stopped working...

2017-11-29 Thread Peter Berghold
the only error I'm seeing is this:

[sendRPMS] touch: cannot touch
'/data/staging/repos/released@tmp/durable-e537873f/jenkins-log.txt


what would cause this to happen?

-- 
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/CAArvnv2E2SWPNt12fRFHsMH%2B2%3DhXvRtZbh_dPTcooWs6f-VGOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Pipelines and @tmp directories

2017-11-29 Thread Peter Berghold
Simple question:  is there a way to make a pipeline not create those? Or at
the very least clean up after them?

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


GitHub branch source plugin - pull request commits do not trigger builds

2017-11-29 Thread Hidde
We've an GitHub organization setup with a GitHub branch source configured 
to do the following:

*Discover branches:* Exclude branches that are also filled as PRs
*Discover pull requests from origin:* Merging the pull request with the 
current target branch revision
*Discover pull requests from forks: *Merging the pull request with the 
current target branch revision (Contributors)
*Filter by name (with regular expression): *master|PR.*

It does detect merges to the master branch (and successfully starts 
builds), it does however not detect new pushes to a pull request from 
origin. I can see that it receives a push from GitHub in the 'GitHub Hook 
Log' but the hook process does detect any changes (see the attached 
last-github-push.txt).
A new repository scan or a manual build trigger is the only thing that 
works.

I tried setting a second ref spec 
(+refs/pull/*:refs/remotes/@{remote}/pr/*) without any effect.

What could be the cause of the hook process not seeing changes on the PR 
branch?

-- 
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/01bdfb4a-efe8-427a-a9c8-53d29240cfd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Started on Nov 29, 2017 1:51:37 PM
Started by event from 192.30.252.40 ⇒ https://acme.com:8080/github-webhook/ on 
Wed Nov 29 13:51:37 GMT 2017
Using strategy: Specific revision
[poll] Last Built Revision: Revision 4adbe0ce378f242ba596058bf56d0ec6a5ae9386 
(PR-871)
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Default account for accessing GitHub
 > git ls-remote -h https://github.com/organization/repo.git # timeout=10
Found 8 remote heads on https://github.com/organization/repo.git
Using strategy: Specific revision
[poll] Last Built Revision: Revision 4adbe0ce378f242ba596058bf56d0ec6a5ae9386 
(PR-871)
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Default account for accessing GitHub
 > git ls-remote -h https://github.com/organization/repo.git # timeout=10
Found 8 remote heads on https://github.com/organization/repo.git
Done. Took 2 sec
No changes


Re: Triggering Jenkins Multibranch Pipeline by raising a Pull Request in GitHub

2017-11-29 Thread Ramanathan Muthaiah

>
> So I need to trigger this Multibranch pipeline whenever there is a Pull 
> Request raised on GitHub. I want this pipeline to trigger automatically 
> when there is a PR on GitHub.
> What do I need to do to achieve this approach?
> Is it possible to trigger Multibranch pipeline automatically whenever a PR 
> is raised on GitHub?
>

Yes, configure webhook in GH repository to send event related to Pull 
Request, if that's sufficient for your requirement. Select all the events 
(don't remember the exact name) if you have need for all the events to be 
passed to jenkins master.

NOTE:
Jenkinsfile may or may not need the property (related to github push) to be 
set. There were few threads in this group on this setting.

/Ram

-- 
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/b99e6c4e-da0b-4582-a1b3-7534d6f84f93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Starting Jenkins slave as Windows service

2017-11-29 Thread eid badr
OK, I was calling main method in hudson.remoting.jnlp.Main
set PR_STARTCLASS=hudson.remoting.jnlp.Main

Now im calling main method in hudson.remoting.Launcher and the service 
starts.

But when I stop the service it does not stop correctly because there is no 
stop method inside Launcher.
Is there a way to get the service to stop without the stop method?

-- 
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/cbd6f73a-9e38-4e91-a4ae-036dc1e2dd31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins test pipeline docker build + push

2017-11-29 Thread Walter Heestermans
Hi,

I'm new in Jenkins and trying to run a pipeline to get source from github, 
build docker image, test docker image and push image to local docker 
repository.

node {
def app
stage('Clone repository') {
checkout scm
}
stage('Build image') {
app = docker.build("test/hellonode")
}
stage('Test image') {
app.inside {
sh 'node --version'
}
}
stage('Push image') {
docker.withRegistry('http://test.xyz-europe.com', 'test-dtr') {
 /* app.push("${env.BUILD_NUMBER}") */
 app.push("latest")
}
}
}

Repository 'test/hellonode' is created inside the local docker repository.

The credentials 'test-dtr' are created inside Jenkins: Jenkins --> 
Credentials --> System --> Global credentials (unrestricted)

All stages goes fine, except the push. The push is initiated, but seems 
that the credentials are not taken, I don't see any docker login neither?

Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Push image)
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withDockerRegistry
Wrote authentication to /var/jenkins_home/.dockercfg
[Pipeline] {
[Pipeline] sh
[docker-hellonode] Running shell script
+ docker tag --force=true test/hellonode 
test.xyz-europe.com/test/hellonode:latest
unknown flag: --force
See 'docker tag --help'.
+ docker tag test/hellonode test.xyz-europe.com/test/hellonode:latest
[Pipeline] sh
[docker-hellonode] Running shell script
+ docker push test.xyz-europe.com/test/hellonode:latest
The push refers to a repository [test.xyz-europe.com/test/hellonode]
81c1e1c37cf0: Preparing
8455c73a933d: Preparing
41d2e9b986ab: Preparing
cdd2b48b0e16: Preparing
072b714c90b8: Preparing
ea2e97e9408f: Preparing
0da372da714b: Preparing
bf3841becf9d: Preparing
63866df00998: Preparing
2f9128310b77: Preparing
d9a5f9b8d5c2: Preparing
c01c63c6823d: Preparing
0da372da714b: Waiting
bf3841becf9d: Waiting
63866df00998: Waiting
2f9128310b77: Waiting
d9a5f9b8d5c2: Waiting
c01c63c6823d: Waiting
ea2e97e9408f: Waiting
denied: requested access to the resource is denied

The reason seems to be that the login is not done or taken. same issues 
when I do the above push via command line and not executing a 'docker login 
test.xyz-europe.com' first

What do I misconfigured? can somebody advise me here?

Regards
Walter






-- 
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/cdc61947-7662-44db-8515-684859788103%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Docker push local repository

2017-11-29 Thread Walter Heestermans
Hi,

I'm new in Jenkins and executing a simple pipeline to get source from 
github, build image, test image and then push to local DTR

node {
def app
stage('Clone repository') {
checkout scm
}
stage('Build image') {
app = docker.build("test/hellonode")
}
stage('Test image') {
app.inside {
sh 'node --version'
}
}
stage('Push image') {
docker.withRegistry('http://', credentials-dtr') {
  app.push("latest")
}
}
}

credentials-dtr are dfined inside the Jenkins --> Credentials --> System 
--> Global credentials (unrestricted)

The repository is created and I c
All works fine except the push

Pipeline] // withDockerContainer [Pipeline] } [Pipeline] // stage [Pipeline] 
stage [Pipeline] { (Push image) [Pipeline] withEnv [Pipeline] { [Pipeline] 
withDockerRegistry Wrote authentication to /var/jenkins_home/.dockercfg
[Pipeline] { [Pipeline] sh [docker-hellonode] Running shell script
+ docker tag --force=true toyota/hellonode /xyz/hellonode:latest
unknown flag: --force
See 'docker tag --help'.
+ docker tag xyz/hellonode 
dockerdtrtest.toyota-europe.com/toyota/hellonode:latest
[Pipeline] sh [docker-hellonode] Running shell script
+ docker push /xyz/hellonode:latest
The push refers to a repository 
[dockerdtrtest.toyota-europe.com/toyota/hellonode]
81c1e1c37cf0: Preparing
8455c73a933d: Preparing
41d2e9b986ab: Preparing
cdd2b48b0e16: Preparing
072b714c90b8: Preparing
ea2e97e9408f: Preparing
0da372da714b: Preparing
bf3841becf9d: Preparing
63866df00998: Preparing
2f9128310b77: Preparing
d9a5f9b8d5c2: Preparing
c01c63c6823d: Preparing
0da372da714b: Waiting
bf3841becf9d: Waiting
63866df00998: Waiting
2f9128310b77: Waiting
d9a5f9b8d5c2: Waiting
c01c63c6823d: Waiting
ea2e97e9408f: Waiting
denied: requested access to the resource is denied
[Pipeline] } [Pipeline] // withDockerRegistry [Pipeline] } [Pipeline] // 
withEnv [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node 
[Pipeline] 
End of Pipeline 


-- 
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/a1aceeed-38aa-46c1-910c-c6e161077889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Make "Waiting for next executor" configurable?

2017-11-29 Thread 'Günter Grodotzki' via Jenkins Users
Would it be possible to have jenkins-master launch cloud instances (be it 
ec2, digitalocean or ecs) instantly? Currently there is a waiting period 
before it waits to launch a new node if all nodes/executors are busy.

Cheers,
Gunter

-- 
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/484f5944-1ef7-4e26-8d70-427e900feaa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: gitblamer skips file annotation with relative path

2017-11-29 Thread Ullrich Hafner
This seems to be a bug: your relative path is converted to an absolute path by 
mistake. Can you please file an issue (don’t forget to add the affected parser).

> Am 28.11.2017 um 23:12 schrieb Mathieu Zhang :
> 
> I have the following workspace structure:
> 
> - ${WORKSPACE}/git-checkout
> - ${WORKSPACE}/artifacts
> 
> The codes are build with (from WORKSPACE)
> 
> make -C git-checkout ARTIFACTS_DIR=${WORKSPACE}/artifacts
> 
> which would write output files to ${WORKSPACE}/artifacts, including pylint 
> output, which contains lines like this
> 
> src/updates/update.py:028: [E0611(no-name-in-module), ] No name 'updates' in 
> module 'utils'
> 
> 
> gitblamer is unable the generate blames from this annotation, with series of 
> warnings like this:
> 
>  Using GitBlamer to create author and commit information for all 
> warnings.
>  GIT_COMMIT=c636547ad11d989ef8f984591468cc00c46fb345, 
> workspace=/var/jenkins/build/workspace/project-builder/git-checkout
>  Skipping non-workspace file 
> /var/jenkins/build/workspace/project-builder/git-checkout/src/updates/update.py
>  (workspace = /var/jenkins/build/workspace/project-builder/git-checkout, 
> absolute = /src/updates/update.py.
>  Skipping file src/updates/update.py, no result found.
> 
> Even though the gitblamer's workspace variable correctly identified the git 
> path, it does not appear to be able to deal with relative path in the file 
> annotation correctly.  Is this an issue with gitblamer? Or is it expected 
> that the file line annotation uses absolute path?
> 
> --
> 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/06c568fa-87a9-4da1-8959-cb30d25e75fe%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/4C4A2722-A6FD-49FA-8A3E-80A972797168%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP


Re: Starting Jenkins slave as Windows service

2017-11-29 Thread eid badr


At the node i got only 
java -jar agent.jar -jnlpUrl 
http://172.22.100.251/jenkins/computer/172.19.146.11/slave-agent.jnlp
without any other parameter.

and the slave starts with no problem when I test it on the command line.





Am Dienstag, 28. November 2017 19:29:47 UTC+1 schrieb itchymuzzle:
>
> Go to Jenkins server, select the node you have defined for this Windows 
> instance.  It will give you the command you need to run, on the command 
> line.  
>
> Test that that works on the command line, then figure our how to get 
> procron to do that for you.  
>
> The command will look something like this (use google for other examples): 
>
> "java -jar agent.jar -jnlpUrl 
> http://ip-of-jenkins-server:port-of-jenkins-server/computer/name-of-node/slave-agent.jnlp
>  -secret long-unique-number"
>
>
>

-- 
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/da010f10-6255-4ec0-8320-619af939530d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Injecting environmental variables in build thats uses NodeJS Plugin

2017-11-29 Thread Victor Martinez
Hi,

What about using 
https://wiki.jenkins.io/display/JENKINS/Mask+Passwords+Plugin? It might 
help you to create a global pass parameter to be used as an environment 
variable.

Cheers


-- 
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/07d1e656-e4bb-4ca2-9c0f-08353ba14f85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Injecting environmental variables in build thats uses NodeJS Plugin

2017-11-29 Thread Anthony Green
I have a job that publishes to a private NPM repo.

The job is uses the NodeJS Plugin to provide an instance of node

To publish to NPM you need an .npmrc file specifying your auth token

In Jenkins configuration I have a managed file containing

//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN

with the intention that $NPM_AUTH_TOKEN is injected as an environment 
variable

So under *Bindings*

I add it as a *Secret Text*

just using the system node this works but using the NodeJS Plugin it doesn't

If under *Build Environment* I


*Inject environment variables to the build process*
with the following groovy script


import jenkins.*
import jenkins.model.*
import com.cloudbees.plugins.credentials.Credentials

def credentials = 
com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(com.cloudbees.plugins.credentials.Credentials.class);

def npm_creds =[:]
for (c in credentials) {
  if (c.id == 'NPM_AUTH_TOKEN') {
npm_creds = ['NPM_AUTH_TOKEN': c.secret]
  }
}

return npm_creds

then the NodeJS plug does pick up the NPM_AUTH_TOKEN

Can anyone suggest either:

A simpler groovy script that just uses getCredentialById 

or a simpler way for NodeJS to pick up the environment variable ?

TIA

Anthony


-- 
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/0023c33f-a283-4d06-9d9c-96d3c1d5669b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.