"Added a missed class for missing class telemetry"

2020-07-17 Thread red 888
Im trying to run the test harness and im seeing a ton of these warnings

This says resolved but Im seeing it 
on "org.jenkins-ci.main:jenkins-war:2.235"
https://issues.jenkins-ci.org/browse/JENKINS-60725

# build.gradle
apply plugin: 'groovy'


ext {

jobDslVersion = '1.77'
}


sourceSets {
jobs {
groovy {
srcDirs 'jobs'
compileClasspath += main.compileClasspath
}
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}


repositories {
maven {
url 'https://repo.jenkins-ci.org/public/'
}
jcenter()
}


configurations {
testPlugins {}


testCompile {
exclude group: 'xalan'
exclude group: 'xerces'
}
}


dependencies {
compile "org.apache.ivy:ivy:2.5.0"
testCompile "org.spockframework:spock-core:1.3-groovy-2.4"


// Jenkins Test Harness
testCompile "org.jenkins-ci.main:jenkins-test-harness:2.64"
testCompile "org.jenkins-ci.main:jenkins-war:2.235"


// Job DSL plugin including dependencies
compile "org.jenkins-ci.plugins:job-dsl-core:${jobDslVersion}"
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}"
testCompile "org.jenkins-ci.plugins:job-dsl:${jobDslVersion}@jar"
testCompile "org.jenkins-ci.plugins:structs:1.20@jar"
testCompile "org.jenkins-ci.plugins:script-security:1.73@jar"


// Jenkins plugins to install
testPlugins "org.jenkins-ci.plugins:ghprb:1.31.4"
testPlugins "com.coravy.hudson.plugins.github:github:1.19.0"
}


task resolveTestPlugins(type: Copy) {
from configurations.testPlugins
into new File(sourceSets.test.output.resourcesDir, 'test-dependencies')
include "*.hpi"
include "*.jpi"


doLast {
def baseNames = source.collect { it.name[0..it.name.lastIndexOf('.'
)-1] }
new File(destinationDir, 'index').setText(baseNames.join("\n"), 
"UTF-8")
}
}


test {
dependsOn tasks.resolveTestPlugins
inputs.files sourceSets.jobs.groovy.srcDirs


// set build directory for Jenkins test harness
systemProperty 'buildDirectory', project.buildDir.absolutePath
}

-- 
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/c8314bd8-b3ed-4276-a540-193877f3268fo%40googlegroups.com.


Re: Jenkins job dsl- any way to dry run before affecting changes?

2019-12-30 Thread red 888
Hey, thanks for the suggestions! I know about the testing framework and 
while I may wind up using it out of necessity I think dry-run is more 
valuable than a unit test here. Let me ask you this, could I have a unit 
test that I could run locally but that that jenkins could also run first 
before executing the actual job that will accurately output what jobs are 
going to be changed and what settings are going to change for them? For 
applying configuration changes like this I think a unit test might be 
convoluted and overkill.

I agree with daspilker when he out points that the dsl can contain 
arbitrary code which is not quite the same as a purely declarative language 
such as terraform but i'm still trying to treat it that way. I have a main 
entrypoint that reads a bunch of json files to find what jobs and settings 
to create- so consumers/job creators just need to add an element to a json 
config to add a new job. A dry run would allow everyone to view what is 
going to be changed before its changed. This is different then adding a new 
method or functionality to a class or adding a new feature to an 
application- this is just config which we want to confirm before applying.


On Monday, December 30, 2019 at 8:16:58 AM UTC-5, Victor Martinez wrote:
>
> I've just seen your comment in the open PR regarding 
> https://issues.jenkins-ci.org/browse/JENKINS-27182
>
> > What I want is for my seed job to first output what it's going to change 
> and wait for user input, then if the user confirms make the changes
> IIUC, you would like to mimic a kind of code review similar to the GitHub 
> Pull Request view process, if so, I'd say you can use the proposal from 
> Daniel Spilker (
> https://github.com/jenkinsci/job-dsl-plugin/pull/395#issuecomment-132346716) 
> with https://github.com/jenkinsci/job-dsl-plugin/wiki/Testing-DSL-Scripts and 
> the pipeline to validate it:
>
> > There is currently no built-in way to do this but are there at least any 
> hacky workarounds? For example is there any way I can wrap the 
> multibranchPipelineJob('example'){} closure or extend it in some way where 
> I could have it output what changes its going to make?
>
> https://plugins.jenkins.io/jobConfigHistory might help you
>
> My two cents
>

-- 
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/ac15984c-9c36-4266-8f11-5c6f0d778855%40googlegroups.com.


Jenkins job dsl- any way to dry run before affecting changes?

2019-12-29 Thread red 888
I opened an SO post (that no one seems to be interested in) 
https://stackoverflow.com/questions/59314501/jenkins-job-dsl-some-way-to-do-a-dry-run

I use the jenkins job dsl to create my multibranch pipeline jobs. It works 
great with one glaring issue- safely confirming changes _before_ applying 
them.

A tool like terraform presents the ideal workflow for this- run "plan" 
_first_ and see what is going to happen, then run "apply" and make those 
changes

There is currently no built-in way to do this but are there at least any 
hacky workarounds? For example is there any way I can wrap the 
multibranchPipelineJob('example'){} closure or extend it in some way where 
I could have it output what changes its going to make?

What I want is for my seed job to first output what it's going to change 
and wait for user input, then if the user confirms make the changes


-- 
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/c24372bb-f210-4449-8993-691a9bb941dc%40googlegroups.com.


The Pipeline Maven Plugin is not replacing the config in global settings.xml from jenkins credentials

2019-09-27 Thread red 888
I also opened an SO post for this issue: 
https://stackoverflow.com/questions/58139761/pipeline-maven-plugin-not-replacing-servers-in-global-settings-xml-from-jenkin

I wonder if the plugin is broken or not working correctly for multibranch 
pipelines? I can create a maven config file and in the "Content" all the 
settings work, but configuring "Server Credentials" with a jenkins 
credential binding is not replacing the "" section- seems to just 
ignore it.

for now I have to hard code my "" secrets and all right 
in the content of the config file because the credentials arent working

-- 
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/f2a6c121-2913-412b-9f89-f1a00a8ea715%40googlegroups.com.


how do I modify one option in scm.getUserRemoteConfigs without having to manually set all the options?

2019-08-21 Thread red 888


in my jenkins pipeline i have this:


checkout([$class: 'GitSCM',
  branches: [[name: "${env.BRANCH_NAME}"]],
  doGenerateSubmoduleConfigurations: false,
  extensions: [
  [$class: 'SubmoduleOption',
   disableSubmodules: false,
   parentCredentials: true,
   recursiveSubmodules: true,
   reference: '',
   trackingSubmodules: true],
  [$class: 'CloneOption', timeout: config.timeout],
  [$class: 'CheckoutOption', timeout: config.timeout],
  [$class: 'GitLFSPull']
  ],
  submoduleCfg : [],
  userRemoteConfigs: [[
  //scm.userRemoteConfigs,
  refspec: '+refs/tags/*:refs/remotes/origin/tags/*'
  ]]
])


I just want to modify the refspec and use the rest of the defaults in 
scm.userRemoteConfigs. How can I do that without having to manually set all 
of them because Im no longer just passing in scm.userRemoteConfigs


Im trying to get jenkins to trigger a build when it sees a new tag (like it 
does with new branches) right now it indexes and gets the new tag but 
doesn't run a build

-- 
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/7e5c1679-a40c-4364-b149-282008953df5%40googlegroups.com.


Completely Host Jenkins build logs on external storage

2018-10-22 Thread red 888


Everything I see is for *backing up* build logs to S3 or other external 
storage locations.


Is there a plug-in for actually hosting build logs on those locations? 
meaning that's just where Jenkins writes to and looks for build logs?


I often replay jobs and like looking at the job history in the Jenkins UI. 
but I don't want to store all of these build logs on the file system. So 
I'm not talking about just backing up. I want the Jenkins UI to read from 
the external storage and be able to replay jobs.


Ideally i could have Jenkins read/write to S3 for build logs. I could also 
mount another voulme just for build logs and point jenkins to it for build 
logs location but prefer to use cloud storage.


This is for master and any slaves

-- 
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/255f9475-fbb1-4792-9b40-83c01c30c4d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I send a raw TCP request from jenkins pipeline?

2018-08-30 Thread red 888
There is the excellent "httpRequest" I can use in a pipeline build step.

But now I want to send a raw TCP request, I could not find a plugin for this. 
Is there a supported plugin feature for this? I want to avoid shelling out for 
this.

This is an example of the raw TCP request I am making:

echo 'abc123 blahblahblah' | nc public.endpoint.com 10514

I the endpoint supports tls so I'd like to use that for the connection too.

If there is no plugin is it possible to write a groovy class in "src" folder 
that uses the Java tcp client to esblish a tls connection and send messages?

-- 
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/5872cca7-0d9e-424c-8e2e-9604de7ef620%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I get the “parentNumber” in my jenkins pipeline?

2018-08-22 Thread red 888
Im not sure where that file is, but im more interested in _how_ they get 
that value. How can you get the build number of the job you rebuild from?

It looks like they're using the build cause to get that build number? Does 
the build cause have the build number of the "parent" job I run rebuild 
from?

-- 
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/12a98960-4cae-4fb0-8925-e71802285cdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I get the “parentNumber” in my jenkins pipeline?

2018-08-22 Thread red 888
Im not sure where that file is, but im more interested in _how_ they get 
that value. How can you get the build number of the job you rebuild from?

On Wednesday, August 22, 2018 at 8:50:18 PM UTC-4, Jan Monterrubio wrote:
>
> The variables come from: 
> https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-belowJenkinsSetEnvironmentVariables
>  
> , I believe what you have is BUILD_NUMBER.
>
> They're probably passed into the plugin.
>
> Would you be able to get the file located at BUILDINFO_PROPFILE? I found 
> this in the changelog:
>
> "Build-info exports an environment variable 'BUILDINFO_PROPFILE' with the 
> location of the generated build info properties file"
>
>    1. 
>
>
>
> On Wed, Aug 22, 2018 at 5:36 PM red 888  > wrote:
>
>> Using the artifactory plugin.
>>
>>
>> When I rebuild a jenkins job and deploy to jfrog, I see this in the build 
>> info json: 
>>
>> [image: enter image description here] 
>> <https://i.stack.imgur.com/7p6jy.png>
>>
>>
>> Super useful to me and I cant find how to get that in the jenkins 
>> pipeline anywhere- its the job from which it was rebuilt.
>>
>> So when I rebuild a job from an old build this value is the number of the 
>> build I rebuilt it from.
>>
>>
>> How do I get that in my pipeline? I look in the build info object but its 
>> not there:
>>
>> def artifactory = Artifactory.server 'myserver.jfrog.io'
>> def buildInfo = Artifactory.newBuildInfo()
>> echo buildInfo.dump()
>>
>>
>> How does the plugin even get this info? Its no where in the env vars I 
>> can find and I havent seen any examples of how to get it.
>>
>> -- 
>> 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/5ad01da6-f7fb-450b-bff9-8a831121e69c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/5ad01da6-f7fb-450b-bff9-8a831121e69c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/15f1b7e4-7a7e-43df-8b16-4c8ba740d221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I get the “parentNumber” in my jenkins pipeline?

2018-08-22 Thread red 888


Using the artifactory plugin.


When I rebuild a jenkins job and deploy to jfrog, I see this in the build 
info json: 

[image: enter image description here] 


Super useful to me and I cant find how to get that in the jenkins pipeline 
anywhere- its the job from which it was rebuilt.

So when I rebuild a job from an old build this value is the number of the 
build I rebuilt it from.


How do I get that in my pipeline? I look in the build info object but its 
not there:

def artifactory = Artifactory.server 'myserver.jfrog.io'
def buildInfo = Artifactory.newBuildInfo()
echo buildInfo.dump()


How does the plugin even get this info? Its no where in the env vars I can 
find and I havent seen any examples of how to get it.

-- 
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/5ad01da6-f7fb-450b-bff9-8a831121e69c%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-20 Thread red 888
Hello yes thats what im after (although your second example doesn't have 
any steps). Sorry didn't check this thread in a while. 

It would also be great if I could actually pass in args so it could be like 
commonPost{arg1 = 'blah', arg2 = 'balh'}




On Tuesday, August 7, 2018 at 8:10:56 AM UTC-4, Jan Monterrubio wrote:
>
> 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 
>>>&

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

2018-08-03 Thread red 888
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
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/aa1f5f13-a8c3-42b6-bccc-a35047f0c293%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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.


Re: GIT_SSH not working on one of my windows slaves

2018-05-14 Thread red 888
I already set trace and curl (for some reason setting the env on the node 
didnt work I had to actually set envs for the system on the box directly)

It doesnt give me much extra info though:

ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress 
g...@bitbucket.org:myproject/myrepo.git +refs/heads/*:refs/remotes/origin/*" 
returned status code 128:
stdout: 
stderr: 09:00:41.660477 git.c:344   trace: built-in: git fetch 
--tags --progress g...@bitbucket.org:myproject/myrepo.git 
'+refs/heads/*:refs/remotes/origin/*'
09:00:41.663480 run-command.c:640   trace: run_command: unset GIT_PREFIX
; 'C:\Jenkins\workspace\mybranchabc123@tmp\ssh2197923650539343925.bat' 
g...@bitbucket.org 'git-upload-pack '\''myproject/myrepo.git'\'''
mygitu...@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.


Please make sure you have the correct access rights
and the repository exists.

I could try "ssh -vvv" to get more output too (ssh isnt in the path of the 
working slave either).



On Monday, May 14, 2018 at 12:10:02 PM UTC-4, Mark Waite wrote:
>
> As far as I know, ssh will need to be in the PATH.
>
> On Mon, May 14, 2018 at 9:59 AM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> Thanks for all the help/suggestions! Will ssh need to be in the system 
>> path for GIT_SSH_COMMAND="ssh -vvv" to work? because ssh isnt in the path
>>
>>
>> On Friday, May 11, 2018 at 4:51:28 PM UTC-4, Mark Waite wrote:
>>>
>>> You may be able to use GIT_SSH_COMMAND="ssh -vvv" as a job parameter or 
>>> an agent environment variable.  Refer to 
>>> https://support.cloudbees.com/hc/en-us/articles/115000618372-How-to-trace-git-connections-
>>>  for 
>>> more information
>>>
>>> On Fri, May 11, 2018 at 1:20 PM red 888 <fakemai...@gmail.com> wrote:
>>>
>>>> How can I get jenkins to give me more verbose output than just "using 
>>>> GIT_SSH to set credential"
>>>>
>>>> I set GIT_CURL_VERBOSE=1 and GIT_TRACE=1 on the node but the output 
>>>> from jenkins doesnt change at all
>>>>
>>>> I'd like to know what its setting the environment var to and maybe get 
>>>> some trace level info too. Is there a git 
>>>>
>>>> On Thursday, May 10, 2018 at 3:27:12 PM UTC-4, Mark Waite wrote:
>>>>
>>>>> The name of the temporary directory used for the credentials is based 
>>>>> on either the workspace folder path (with @tmp appended) or the 
>>>>> environment 
>>>>> variables %TEMP% or %TMP%.  If none of those contain a space character, 
>>>>> then that is not the problem.
>>>>>
>>>>> The plugin usually wirtes a message when it detects a space character 
>>>>> in a temporary directory path.  Since you didn't report such a message, I 
>>>>> assume that is not the issue in this case.
>>>>>
>>>>> Mark Waite
>>>>>
>>>>> On Thu, May 10, 2018 at 12:38 PM red 888 <fakemai...@gmail.com> wrote:
>>>>>
>>>> also, if this is helpful this is the global git config on both slaves:
>>>>>>
>>>>>> PS C:\Users\Administrator> git config --list
>>>>>> core.symlinks=false
>>>>>> core.autocrlf=true
>>>>>> core.fscache=true
>>>>>> color.diff=auto
>>>>>> color.status=auto
>>>>>> color.branch=auto
>>>>>> color.interactive=true
>>>>>> help.format=html
>>>>>> rebase.autosquash=true
>>>>>> http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
>>>>>> http.sslbackend=openssl
>>>>>> diff.astextplain.textconv=astextplain
>>>>>> filter.lfs.clean=git-lfs clean -- %f
>>>>>> filter.lfs.smudge=git-lfs smudge -- %f
>>>>>> filter.lfs.process=git-lfs filter-process
>>>>>> filter.lfs.required=true
>>>>>>
>>>>>> On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>>>>>>
>>>>>>> Have you confirmed that the temporary directory on the failing 
>>>>>>> machine does not include any space characters in its path?  There is a 
>>>>>>> known problem on Windows that the credential passing technique required 
>>>>>>> by 
>>>>>>> command line git do

Re: GIT_SSH not working on one of my windows slaves

2018-05-14 Thread red 888
Thanks for all the help/suggestions! Will ssh need to be in the system path 
for GIT_SSH_COMMAND="ssh -vvv" to work? because ssh isnt in the path


On Friday, May 11, 2018 at 4:51:28 PM UTC-4, Mark Waite wrote:
>
> You may be able to use GIT_SSH_COMMAND="ssh -vvv" as a job parameter or an 
> agent environment variable.  Refer to 
> https://support.cloudbees.com/hc/en-us/articles/115000618372-How-to-trace-git-connections-
>  for 
> more information
>
> On Fri, May 11, 2018 at 1:20 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> How can I get jenkins to give me more verbose output than just "using 
>> GIT_SSH to set credential"
>>
>> I set GIT_CURL_VERBOSE=1 and GIT_TRACE=1 on the node but the output from 
>> jenkins doesnt change at all
>>
>> I'd like to know what its setting the environment var to and maybe get 
>> some trace level info too. Is there a git 
>>
>> On Thursday, May 10, 2018 at 3:27:12 PM UTC-4, Mark Waite wrote:
>>
>>> The name of the temporary directory used for the credentials is based on 
>>> either the workspace folder path (with @tmp appended) or the environment 
>>> variables %TEMP% or %TMP%.  If none of those contain a space character, 
>>> then that is not the problem.
>>>
>>> The plugin usually wirtes a message when it detects a space character in 
>>> a temporary directory path.  Since you didn't report such a message, I 
>>> assume that is not the issue in this case.
>>>
>>> Mark Waite
>>>
>>> On Thu, May 10, 2018 at 12:38 PM red 888 <fakemai...@gmail.com> wrote:
>>>
>> also, if this is helpful this is the global git config on both slaves:
>>>>
>>>> PS C:\Users\Administrator> git config --list
>>>> core.symlinks=false
>>>> core.autocrlf=true
>>>> core.fscache=true
>>>> color.diff=auto
>>>> color.status=auto
>>>> color.branch=auto
>>>> color.interactive=true
>>>> help.format=html
>>>> rebase.autosquash=true
>>>> http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
>>>> http.sslbackend=openssl
>>>> diff.astextplain.textconv=astextplain
>>>> filter.lfs.clean=git-lfs clean -- %f
>>>> filter.lfs.smudge=git-lfs smudge -- %f
>>>> filter.lfs.process=git-lfs filter-process
>>>> filter.lfs.required=true
>>>>
>>>> On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>>>>
>>>>> Have you confirmed that the temporary directory on the failing machine 
>>>>> does not include any space characters in its path?  There is a known 
>>>>> problem on Windows that the credential passing technique required by 
>>>>> command line git does not allow a space character in the temporary 
>>>>> directory path.
>>>>>
>>>>> I assume from the log that the workspace does not include a space 
>>>>> character in its path.  If it does, that could invoke the same problem 
>>>>> with 
>>>>> command line git authentication on Windows not really liking temporary 
>>>>> paths which contain a space character.
>>>>>
>>>>> Mark Waite 
>>>>>
>>>>> On Thu, May 10, 2018 at 12:17 PM red 888 <fakemai...@gmail.com> wrote:
>>>>>
>>>> I can confirm the git ssh key works and has always worked so the creds 
>>>>>> themselves should not be an issue.
>>>>>>
>>>>>> git clone fails on both slaves (when run interactively as a logged in 
>>>>>> user). The windows task that runs the jnlp executes as the SYSTEM 
>>>>>> account.
>>>>>>
>>>>>> I also made sure to do git config --system --unset credential.helper. 
>>>>>> Any local config that would break this?
>>>>>>
>>>>>> The git jenkins plugin should be totally handling all the git cred 
>>>>>> setup stuff, but maybe someone modified a local config on the broken 
>>>>>> slave? 
>>>>>> the git global config looks identical on both of them
>>>>>>
>>>>>>
>>>>>> On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>>>>>>
>>>>>>> It could be a "happy accident" that it is working on the first 
>>>>>>> agent.  
>>>&

Re: GIT_SSH not working on one of my windows slaves

2018-05-11 Thread red 888
How can I get jenkins to give me more verbose output than just "using 
GIT_SSH to set credential"

I set GIT_CURL_VERBOSE=1 and GIT_TRACE=1 on the node but the output from 
jenkins doesnt change at all

I'd like to know what its setting the environment var to and maybe get some 
trace level info too. Is there a git 

On Thursday, May 10, 2018 at 3:27:12 PM UTC-4, Mark Waite wrote:
>
> The name of the temporary directory used for the credentials is based on 
> either the workspace folder path (with @tmp appended) or the environment 
> variables %TEMP% or %TMP%.  If none of those contain a space character, 
> then that is not the problem.
>
> The plugin usually wirtes a message when it detects a space character in a 
> temporary directory path.  Since you didn't report such a message, I assume 
> that is not the issue in this case.
>
> Mark Waite
>
> On Thu, May 10, 2018 at 12:38 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> also, if this is helpful this is the global git config on both slaves:
>>
>> PS C:\Users\Administrator> git config --list
>> core.symlinks=false
>> core.autocrlf=true
>> core.fscache=true
>> color.diff=auto
>> color.status=auto
>> color.branch=auto
>> color.interactive=true
>> help.format=html
>> rebase.autosquash=true
>> http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
>> http.sslbackend=openssl
>> diff.astextplain.textconv=astextplain
>> filter.lfs.clean=git-lfs clean -- %f
>> filter.lfs.smudge=git-lfs smudge -- %f
>> filter.lfs.process=git-lfs filter-process
>> filter.lfs.required=true
>>
>> On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>>
>>> Have you confirmed that the temporary directory on the failing machine 
>>> does not include any space characters in its path?  There is a known 
>>> problem on Windows that the credential passing technique required by 
>>> command line git does not allow a space character in the temporary 
>>> directory path.
>>>
>>> I assume from the log that the workspace does not include a space 
>>> character in its path.  If it does, that could invoke the same problem with 
>>> command line git authentication on Windows not really liking temporary 
>>> paths which contain a space character.
>>>
>>> Mark Waite 
>>>
>>> On Thu, May 10, 2018 at 12:17 PM red 888 <fakemai...@gmail.com> wrote:
>>>
>> I can confirm the git ssh key works and has always worked so the creds 
>>>> themselves should not be an issue.
>>>>
>>>> git clone fails on both slaves (when run interactively as a logged in 
>>>> user). The windows task that runs the jnlp executes as the SYSTEM account.
>>>>
>>>> I also made sure to do git config --system --unset credential.helper. 
>>>> Any local config that would break this?
>>>>
>>>> The git jenkins plugin should be totally handling all the git cred 
>>>> setup stuff, but maybe someone modified a local config on the broken 
>>>> slave? 
>>>> the git global config looks identical on both of them
>>>>
>>>>
>>>> On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>>>>
>>>>> It could be a "happy accident" that it is working on the first agent.  
>>>>>
>>>>> When using a command prompt on the first agent, does `git clone` allow 
>>>>> you to clone without prompting for remote username or password?  
>>>>>
>>>>> When using a command prompt on the second agent, does it behave the 
>>>>> same as the first agent?
>>>>>
>>>>> The login context (~/.ssh/ directory contents, environment variables, 
>>>>> etc.) affect agents which use that login context.  If the agent is 
>>>>> already 
>>>>> configured to silently authenticate to bitbucket, then incorrect 
>>>>> credentials in the Jenkins environment are ignored and the repository is 
>>>>> still retrieved.
>>>>>
>>>>> Mark Waite
>>>>>
>>>>> On Thu, May 10, 2018 at 11:44 AM Slide <slide...@gmail.com> wrote:
>>>>>
>>>> Can you try dumping the environment variables on each node and see if 
>>>>>> there are any differences?
>>>>>>
>>>>>> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com> 
>>>>>> wrote:
>>>>&

Re: GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888
Jenkins says "using GIT_SSH to set credential" What is it actually 
putting in GIT_SSH?

On Thursday, May 10, 2018 at 2:38:14 PM UTC-4, red 888 wrote:
>
> also, if this is helpful this is the global git config on both slaves:
>
> PS C:\Users\Administrator> git config --list
> core.symlinks=false
> core.autocrlf=true
> core.fscache=true
> color.diff=auto
> color.status=auto
> color.branch=auto
> color.interactive=true
> help.format=html
> rebase.autosquash=true
> http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
> http.sslbackend=openssl
> diff.astextplain.textconv=astextplain
> filter.lfs.clean=git-lfs clean -- %f
> filter.lfs.smudge=git-lfs smudge -- %f
> filter.lfs.process=git-lfs filter-process
> filter.lfs.required=true
>
> On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>>
>> Have you confirmed that the temporary directory on the failing machine 
>> does not include any space characters in its path?  There is a known 
>> problem on Windows that the credential passing technique required by 
>> command line git does not allow a space character in the temporary 
>> directory path.
>>
>> I assume from the log that the workspace does not include a space 
>> character in its path.  If it does, that could invoke the same problem with 
>> command line git authentication on Windows not really liking temporary 
>> paths which contain a space character.
>>
>> Mark Waite 
>>
>> On Thu, May 10, 2018 at 12:17 PM red 888 <fakemai...@gmail.com> wrote:
>>
>>> I can confirm the git ssh key works and has always worked so the creds 
>>> themselves should not be an issue.
>>>
>>> git clone fails on both slaves (when run interactively as a logged in 
>>> user). The windows task that runs the jnlp executes as the SYSTEM account.
>>>
>>> I also made sure to do git config --system --unset credential.helper. 
>>> Any local config that would break this?
>>>
>>> The git jenkins plugin should be totally handling all the git cred setup 
>>> stuff, but maybe someone modified a local config on the broken slave? the 
>>> git global config looks identical on both of them
>>>
>>>
>>> On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>>>
>>>> It could be a "happy accident" that it is working on the first agent.  
>>>>
>>>> When using a command prompt on the first agent, does `git clone` allow 
>>>> you to clone without prompting for remote username or password?  
>>>>
>>>> When using a command prompt on the second agent, does it behave the 
>>>> same as the first agent?
>>>>
>>>> The login context (~/.ssh/ directory contents, environment variables, 
>>>> etc.) affect agents which use that login context.  If the agent is already 
>>>> configured to silently authenticate to bitbucket, then incorrect 
>>>> credentials in the Jenkins environment are ignored and the repository is 
>>>> still retrieved.
>>>>
>>>> Mark Waite
>>>>
>>>> On Thu, May 10, 2018 at 11:44 AM Slide <slide...@gmail.com> wrote:
>>>>
>>> Can you try dumping the environment variables on each node and see if 
>>>>> there are any differences?
>>>>>
>>>>> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com> wrote:
>>>>>
>>>> Super frustrating because this is working on one of my windows slaves, 
>>>>>> but not this one- and I cant find any config differences.
>>>>>>
>>>>>> On the working slave I see this:
>>>>>>
>>>>>>
>>>>>> [Pipeline] checkout
>>>>>> Cloning the remote Git repository
>>>>>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>>>>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>>>>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>>>>  > git --version # timeout=10
>>>>>> using GIT_SSH to set credentials mygitcreds
>>>>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>>>>> timeout=10
>>>>>>  > git config --add remote.orig

Re: GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888
also, if this is helpful this is the global git config on both slaves:

PS C:\Users\Administrator> git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true

On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>
> Have you confirmed that the temporary directory on the failing machine 
> does not include any space characters in its path?  There is a known 
> problem on Windows that the credential passing technique required by 
> command line git does not allow a space character in the temporary 
> directory path.
>
> I assume from the log that the workspace does not include a space 
> character in its path.  If it does, that could invoke the same problem with 
> command line git authentication on Windows not really liking temporary 
> paths which contain a space character.
>
> Mark Waite 
>
> On Thu, May 10, 2018 at 12:17 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> I can confirm the git ssh key works and has always worked so the creds 
>> themselves should not be an issue.
>>
>> git clone fails on both slaves (when run interactively as a logged in 
>> user). The windows task that runs the jnlp executes as the SYSTEM account.
>>
>> I also made sure to do git config --system --unset credential.helper. Any 
>> local config that would break this?
>>
>> The git jenkins plugin should be totally handling all the git cred setup 
>> stuff, but maybe someone modified a local config on the broken slave? the 
>> git global config looks identical on both of them
>>
>>
>> On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>>
>>> It could be a "happy accident" that it is working on the first agent.  
>>>
>>> When using a command prompt on the first agent, does `git clone` allow 
>>> you to clone without prompting for remote username or password?  
>>>
>>> When using a command prompt on the second agent, does it behave the same 
>>> as the first agent?
>>>
>>> The login context (~/.ssh/ directory contents, environment variables, 
>>> etc.) affect agents which use that login context.  If the agent is already 
>>> configured to silently authenticate to bitbucket, then incorrect 
>>> credentials in the Jenkins environment are ignored and the repository is 
>>> still retrieved.
>>>
>>> Mark Waite
>>>
>>> On Thu, May 10, 2018 at 11:44 AM Slide <slide...@gmail.com> wrote:
>>>
>> Can you try dumping the environment variables on each node and see if 
>>>> there are any differences?
>>>>
>>>> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com> wrote:
>>>>
>>> Super frustrating because this is working on one of my windows slaves, 
>>>>> but not this one- and I cant find any config differences.
>>>>>
>>>>> On the working slave I see this:
>>>>>
>>>>>
>>>>> [Pipeline] checkout
>>>>> Cloning the remote Git repository
>>>>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>>>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>>>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>>>  > git --version # timeout=10
>>>>> using GIT_SSH to set credentials mygitcreds
>>>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>>>> timeout=10
>>>>>  > git config --add remote.origin.fetch 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=10
>>>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>>>> timeout=10
>>>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>>> using GIT_SSH to set credentials mygitcreds
>>>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>>>  > git rev-parse "origin/test

Re: GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888
hmm what is the "temporary directory" in this context? The jenkins 
workspace is configured the same on both slaves (just a folder under c:) so 
no spaces there

Another thing i looked at was 
*c:\Windows\System32\config\systemprofile\.ssh\* and on both slaves that 
folder just has a know_hosts file and its contents is the same on both 
slaves too.

On Thursday, May 10, 2018 at 2:22:10 PM UTC-4, Mark Waite wrote:
>
> Have you confirmed that the temporary directory on the failing machine 
> does not include any space characters in its path?  There is a known 
> problem on Windows that the credential passing technique required by 
> command line git does not allow a space character in the temporary 
> directory path.
>
> I assume from the log that the workspace does not include a space 
> character in its path.  If it does, that could invoke the same problem with 
> command line git authentication on Windows not really liking temporary 
> paths which contain a space character.
>
> Mark Waite 
>
> On Thu, May 10, 2018 at 12:17 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> I can confirm the git ssh key works and has always worked so the creds 
>> themselves should not be an issue.
>>
>> git clone fails on both slaves (when run interactively as a logged in 
>> user). The windows task that runs the jnlp executes as the SYSTEM account.
>>
>> I also made sure to do git config --system --unset credential.helper. Any 
>> local config that would break this?
>>
>> The git jenkins plugin should be totally handling all the git cred setup 
>> stuff, but maybe someone modified a local config on the broken slave? the 
>> git global config looks identical on both of them
>>
>>
>> On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>>
>>> It could be a "happy accident" that it is working on the first agent.  
>>>
>>> When using a command prompt on the first agent, does `git clone` allow 
>>> you to clone without prompting for remote username or password?  
>>>
>>> When using a command prompt on the second agent, does it behave the same 
>>> as the first agent?
>>>
>>> The login context (~/.ssh/ directory contents, environment variables, 
>>> etc.) affect agents which use that login context.  If the agent is already 
>>> configured to silently authenticate to bitbucket, then incorrect 
>>> credentials in the Jenkins environment are ignored and the repository is 
>>> still retrieved.
>>>
>>> Mark Waite
>>>
>>> On Thu, May 10, 2018 at 11:44 AM Slide <slide...@gmail.com> wrote:
>>>
>> Can you try dumping the environment variables on each node and see if 
>>>> there are any differences?
>>>>
>>>> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com> wrote:
>>>>
>>> Super frustrating because this is working on one of my windows slaves, 
>>>>> but not this one- and I cant find any config differences.
>>>>>
>>>>> On the working slave I see this:
>>>>>
>>>>>
>>>>> [Pipeline] checkout
>>>>> Cloning the remote Git repository
>>>>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>>>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>>>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>>>  > git --version # timeout=10
>>>>> using GIT_SSH to set credentials mygitcreds
>>>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>>>> timeout=10
>>>>>  > git config --add remote.origin.fetch 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=10
>>>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>>>> timeout=10
>>>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>>> using GIT_SSH to set credentials mygitcreds
>>>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>>>  > git rev-parse "origin/test-slave^{commit}" # timeout=10
>>>>> Checking out Revision 30f11ef09ab13f73fb9a6b75983e1bf32437f51d 
>>>>> (origin/test-slave)
>>>>> Enabling Git LFS pull

Re: GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888
I can confirm the git ssh key works and has always worked so the creds 
themselves should not be an issue.

git clone fails on both slaves (when run interactively as a logged in 
user). The windows task that runs the jnlp executes as the SYSTEM account.

I also made sure to do git config --system --unset credential.helper. Any 
local config that would break this?

The git jenkins plugin should be totally handling all the git cred setup 
stuff, but maybe someone modified a local config on the broken slave? the 
git global config looks identical on both of them


On Thursday, May 10, 2018 at 1:58:55 PM UTC-4, Mark Waite wrote:
>
> It could be a "happy accident" that it is working on the first agent.  
>
> When using a command prompt on the first agent, does `git clone` allow you 
> to clone without prompting for remote username or password?  
>
> When using a command prompt on the second agent, does it behave the same 
> as the first agent?
>
> The login context (~/.ssh/ directory contents, environment variables, 
> etc.) affect agents which use that login context.  If the agent is already 
> configured to silently authenticate to bitbucket, then incorrect 
> credentials in the Jenkins environment are ignored and the repository is 
> still retrieved.
>
> Mark Waite
>
> On Thu, May 10, 2018 at 11:44 AM Slide <slide...@gmail.com > 
> wrote:
>
>> Can you try dumping the environment variables on each node and see if 
>> there are any differences?
>>
>> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com 
>> > wrote:
>>
>>> Super frustrating because this is working on one of my windows slaves, 
>>> but not this one- and I cant find any config differences.
>>>
>>> On the working slave I see this:
>>>
>>>
>>> [Pipeline] checkout
>>> Cloning the remote Git repository
>>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>  > git --version # timeout=10
>>> using GIT_SSH to set credentials mygitcreds
>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>> timeout=10
>>>  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
>>> # timeout=10
>>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>>> timeout=10
>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>> using GIT_SSH to set credentials mygitcreds
>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>>  > git rev-parse "origin/test-slave^{commit}" # timeout=10
>>> Checking out Revision 30f11ef09ab13f73fb9a6b75983e1bf32437f51d 
>>> (origin/test-slave)
>>> Enabling Git LFS pull
>>>  > git config core.sparsecheckout # timeout=10
>>>  > git checkout -f 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # timeout=45
>>>  > git config --get remote.origin.url # timeout=10
>>> using GIT_SSH to set credentials mygitcreds
>>>  > git lfs pull origin # timeout=45
>>> Commit message: "test slave"
>>>  > git rev-list --no-walk 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # 
>>> timeout=10
>>>
>>>
>>>
>>> But on the failing slave:
>>>
>>>
>>> [Pipeline] checkout
>>> Cloning the remote Git repository
>>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>>  > git --version # timeout=10
>>> using GIT_SSH to set credentials mygitcreds
>>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>> ERROR: Error cloning remote repo 'origin'
>>> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
>>> g...@bitbucket.org:myteam/myapp.git +refs/heads/*:refs/remotes/origin/*" 
>>> returned status code 128:
>>> stdout: 
>>> stderr: gituserfrom...@bitbucket.org : Permission denied 
>>> (publickey).
>>> fatal: Could not read from remote repository.
>>>
>>>
>>> Its the same pipeline job, same rep

Re: GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888
Dumped env vars on both nodes right before checkout, i dont see any real 
differences. Anything env vars specific to GIT_SSH? Also both slaves are 
running the same windows build too.


On Thursday, May 10, 2018 at 1:44:16 PM UTC-4, slide wrote:
>
> Can you try dumping the environment variables on each node and see if 
> there are any differences?
>
> On Thu, May 10, 2018 at 10:42 AM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> Super frustrating because this is working on one of my windows slaves, 
>> but not this one- and I cant find any config differences.
>>
>> On the working slave I see this:
>>
>>
>> [Pipeline] checkout
>> Cloning the remote Git repository
>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>  > git --version # timeout=10
>> using GIT_SSH to set credentials mygitcreds
>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>> timeout=10
>>  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
>> # timeout=10
>>  > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # 
>> timeout=10
>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>> using GIT_SSH to set credentials mygitcreds
>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>>  > git rev-parse "origin/test-slave^{commit}" # timeout=10
>> Checking out Revision 30f11ef09ab13f73fb9a6b75983e1bf32437f51d 
>> (origin/test-slave)
>> Enabling Git LFS pull
>>  > git config core.sparsecheckout # timeout=10
>>  > git checkout -f 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # timeout=45
>>  > git config --get remote.origin.url # timeout=10
>> using GIT_SSH to set credentials mygitcreds
>>  > git lfs pull origin # timeout=45
>> Commit message: "test slave"
>>  > git rev-list --no-walk 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # 
>> timeout=10
>>
>>
>>
>> But on the failing slave:
>>
>>
>> [Pipeline] checkout
>> Cloning the remote Git repository
>> Cloning repository g...@bitbucket.org:myteam/myapp.git
>>  > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
>> Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
>>  > git --version # timeout=10
>> using GIT_SSH to set credentials mygitcreds
>>  > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
>> +refs/heads/*:refs/remotes/origin/* # timeout=45
>> ERROR: Error cloning remote repo 'origin'
>> hudson.plugins.git.GitException: Command "git fetch --tags --progress 
>> g...@bitbucket.org:myteam/myapp.git +refs/heads/*:refs/remotes/origin/*" 
>> returned status code 128:
>> stdout: 
>> stderr: gituserfrom...@bitbucket.org : Permission denied 
>> (publickey).
>> fatal: Could not read from remote repository.
>>
>>
>> Its the same pipeline job, same repo, same creds, and the slave should be 
>> configured the same but when I change the agent to point to the other slave 
>> it cant clone.
>>
>>
>> On the working slave all i had to do was install git for windows (turn 
>> off windows cred store), install java, and then run the jnlp jar.
>>
>>
>> Tried to do the same thing on the non working slave so I dont know why 
>> that one could be failing.
>>
>> -- 
>> 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/3afe4362-20f7-40c9-91ac-ac6573d0bd16%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/3afe4362-20f7-40c9-91ac-ac6573d0bd16%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/4b508b44-b542-4249-8b52-443ad4bd258e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


GIT_SSH not working on one of my windows slaves

2018-05-10 Thread red 888


Super frustrating because this is working on one of my windows slaves, but 
not this one- and I cant find any config differences.

On the working slave I see this:


[Pipeline] checkout
Cloning the remote Git repository
Cloning repository g...@bitbucket.org:myteam/myapp.git
 > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
 > git --version # timeout=10
using GIT_SSH to set credentials mygitcreds
 > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
 > +refs/heads/*:refs/remotes/origin/* # timeout=45
 > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # 
 > timeout=10
 > git config remote.origin.url g...@bitbucket.org:myteam/myapp.git # timeout=10
Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
using GIT_SSH to set credentials mygitcreds
 > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
 > +refs/heads/*:refs/remotes/origin/* # timeout=45
 > git rev-parse "origin/test-slave^{commit}" # timeout=10
Checking out Revision 30f11ef09ab13f73fb9a6b75983e1bf32437f51d 
(origin/test-slave)
Enabling Git LFS pull
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # timeout=45
 > git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials mygitcreds
 > git lfs pull origin # timeout=45
Commit message: "test slave"
 > git rev-list --no-walk 30f11ef09ab13f73fb9a6b75983e1bf32437f51d # timeout=10



But on the failing slave:


[Pipeline] checkout
Cloning the remote Git repository
Cloning repository g...@bitbucket.org:myteam/myapp.git
 > git init C:\Jenkins\workspace\test-slave123456 # timeout=10
Fetching upstream changes from g...@bitbucket.org:myteam/myapp.git
 > git --version # timeout=10
using GIT_SSH to set credentials mygitcreds
 > git fetch --tags --progress g...@bitbucket.org:myteam/myapp.git 
 > +refs/heads/*:refs/remotes/origin/* # timeout=45
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress 
g...@bitbucket.org:myteam/myapp.git +refs/heads/*:refs/remotes/origin/*" 
returned status code 128:
stdout: 
stderr: gituserfromcredbind...@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.


Its the same pipeline job, same repo, same creds, and the slave should be 
configured the same but when I change the agent to point to the other slave 
it cant clone.


On the working slave all i had to do was install git for windows (turn off 
windows cred store), install java, and then run the jnlp jar.


Tried to do the same thing on the non working slave so I dont know why that 
one could be failing.

-- 
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/3afe4362-20f7-40c9-91ac-ac6573d0bd16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I npm install inside a container slave?

2018-04-19 Thread red 888
Trying to install an npm module:

stage('stage') {

agent {
docker {
image "library/node:alpine"
args "-u root"
}
}
steps{
sh 'npm install aws-sam-local -g'
sh 'sam --help'


I get a permissions error:

> + npm install aws-sam-local -g > aws-sam-local@0.2.11 postinstall 
> /usr/lib/node_modules/aws-sam-local
> > go-npm install 
> /usr/lib/node_modules/aws-sam-local/node_modules/mkdirp/index.js:90
> throw err0;
> ^ Error: EACCES: permission denied, mkdir 
> '/usr/lib/node_modules/aws-sam-local/bin'
> at Object.fs.mkdirSync (fs.js:885:18)
> at Function.sync 
> (/usr/lib/node_modules/aws-sam-local/node_modules/mkdirp/index.js:71:13)
> at Object.install 
> (/usr/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:161:12)
> at Object. 
> (/usr/lib/node_modules/aws-sam-local/node_modules/go-npm/bin/index.js:212:17)
> at Module._compile (module.js:635:30)
> at Object.Module._extensions..js (module.js:646:10)
> at Module.load (module.js:554:32)
> at tryModuleLoad (module.js:497:12)
> at Function.Module._load (module.js:489:3)
> at Function.Module.runMain (module.js:676:10)
> npm ERR! code ELIFECYCLE
> npm ERR! errno 1
> npm ERR! aws-sam-local@0.2.11 postinstall: `go-npm install`
> npm ERR! Exit status 1
> npm ERR! 
> npm ERR! Failed at the aws-sam-local@0.2.11 postinstall script.
> npm ERR! This is probably not a problem with npm. There is likely 
> additional logging output above.



How can I install a package "globally" in a container slave?

-- 
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/df8eb5b5-2726-429d-936e-ce8827329de0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can i do a reset with GitSCM?

2018-04-18 Thread red 888
hey thats cool. I'll have to test that, where is that in the docs? I 
couldn't find it anywhere maybe it was right under my nose.

On Tuesday, April 17, 2018 at 11:42:14 PM UTC-4, Mark Waite wrote:
>
> There is a strategy called "OURS" and a strategy called 
> "RECURSIVE_THEIRS".  Will either of those do what you want?
>
> Mark Waite
>
> On Tue, Apr 17, 2018 at 5:51 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> I want to merge a branch into the current one but reset the current 
>> branch to the one I'm merging in:
>>
>> checkout([$class: 'GitSCM',
>> branches: [[name: "${env.BRANCH_NAME}"]],
>> doGenerateSubmoduleConfigurations: false,
>> extensions: [
>> [$class: 'PreBuildMerge',
>> options: [
>> fastForwardMode: 'NO_FF',
>> mergeRemote: 'origin',
>> mergeStrategy: 'MergeCommand.Strategy',
>> mergeTarget: 'otherbranch']
>>  ],
>> ]
>> ])
>>
>> Is there an "except their changes" feature here? Actually I think I want 
>> a full reset because I want origin here to be identical to otherbranch
>>
>> -- 
>> 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/dfdb1112-fbdb-4929-87d7-0aebf3e4c553%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/dfdb1112-fbdb-4929-87d7-0aebf3e4c553%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/9d9dbb71-cc47-45ef-a40d-e6b8c4da8b94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can i do a reset with GitSCM?

2018-04-17 Thread red 888
I want to merge a branch into the current one but reset the current branch 
to the one I'm merging in:

checkout([$class: 'GitSCM',
branches: [[name: "${env.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'PreBuildMerge',
options: [
fastForwardMode: 'NO_FF',
mergeRemote: 'origin',
mergeStrategy: 'MergeCommand.Strategy',
mergeTarget: 'otherbranch']
 ],
]
])

Is there an "except their changes" feature here? Actually I think I want a 
full reset because I want origin here to be identical to otherbranch

-- 
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/dfdb1112-fbdb-4929-87d7-0aebf3e4c553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how can I pop an input box for a specific choice?

2018-04-17 Thread red 888


In jenkins I'd like to do this:


parameters {
choice(
name: 'blah',
choices: 'one\ntwo\ncustom',
description: 'if you choose custom enter a custom number'
)
}


So they have three options on the drop down, but it would be nice if when 
they select the "custom" choice jenkins pops an input box to type in raw 
user input.


Is this possible? I don't want to use user input during the pipeline run 
because that means they need to choose custom then wait for jenkins to get 
to the stage where it asks them for input.

-- 
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/8af8daee-3580-4e4f-a6be-2aa6632b1c71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Web Start is working but jenkins says “Ping response time is too long or timed out”

2018-03-29 Thread red 888


I can successfully start the connection from the slave with this command:

java -jar agent.jar -jnlpUrl 
https://myserver:/computer/myslave/slave-agent.jnlp -secret sdfsdfsdf 
-workDir "c:\jenkins"

It start, it runs, it logs 0 errors, I do netstat on the master and see the 
connection is established.

But it says its offline with the error "Ping response time is too long or 
timed out"

The error itself is troubling because the whole point of web start is so 
the master doesn't need direct access to the slave. Is it actually trying 
to icmp to the slave?

The slave can only access the master over port .

-- 
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/57a3cd15-01a6-4126-af76-dcbad253a89a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Certificate problems when trying to deploy jenkins slave on Windows machine

2018-03-28 Thread red 888
I also have this 
issue. 
https://stackoverflow.com/questions/49544663/jenkins-windows-slave-thinks-my-cert-is-invalid

On Friday, February 9, 2018 at 4:25:42 PM UTC-5, Mark Shapiro wrote:
>
> Were you able to find a resolution for this?  I just started having this 
> problem recently.
>
> On Thursday, November 17, 2016 at 3:51:18 AM UTC-5, buddy123 wrote:
>>
>> Hi everyone,
>> Im trying to add a Windows slave for to Jenkins
>> I created a new Java webstart node, copied the command to my WIndows and 
>> executed it
>> I get errors that are related to certificates:
>>
>>> Exception in thread "main" java.io.IOException: Failed to validate a 
>>> server certificate. If you are using a self-signed certificate, you can use 
>>> the -noCertificateCheck option to bypass this check.
>>> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:327)
>>> at hudson.remoting.Launcher.run(Launcher.java:219)
>>> at hudson.remoting.Launcher.main(Launcher.java:192)
>>> Caused by: javax.net.ssl.SSLHandshakeException: 
>>> sun.security.validator.ValidatorException: PKIX path building failed: 
>>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
>>> valid certification path to requested target
>>> at sun.security.ssl.Alerts.getSSLException(Unknown Source)
>>> at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
>>> at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
>>> at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
>>> at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown 
>>> Source)
>>> at sun.security.ssl.ClientHandshaker.processMessage(Unknown 
>>> Source)
>>> at sun.security.ssl.Handshaker.processLoop(Unknown Source)
>>> at sun.security.ssl.Handshaker.process_record(Unknown Source)
>>> at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
>>> at 
>>> sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
>>> at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
>>> at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
>>> at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown 
>>> Source)
>>> at 
>>> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown
>>>  
>>> Source)
>>> at 
>>> sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
>>> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:269)
>>> ... 2 more
>>> Caused by: sun.security.validator.ValidatorException: PKIX path building 
>>> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable 
>>> to find valid certification path to requested target
>>> at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>>> at sun.security.validator.PKIXValidator.engineValidate(Unknown 
>>> Source)
>>> at sun.security.validator.Validator.validate(Unknown Source)
>>> at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
>>> at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown 
>>> Source)
>>> at 
>>> sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
>>> ... 14 more
>>> Caused by: sun.security.provider.certpath.SunCertPathBuilderException: 
>>> unable to find valid certification path to requested target
>>> at 
>>> sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
>>> at 
>>> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown 
>>> Source)
>>> at java.security.cert.CertPathBuilder.build(Unknown Source)
>>> ... 20 more
>>
>>
>> Is it using other, internal self-signed certificates than the one 
>> configured on my Jenkins machine? 
>> Because my Jenkins master is using a proper signed certificate that is 
>> recognized as valid in my browser.
>> The only way to get pass this is to specify the -noCertificateCheck flag, 
>> but I want to have a secured connection between my nodes.
>> Why isnt the java application checking for certificates to see its valid?
>>
>>

-- 
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/29c05f18-5b6a-4e25-990b-fc074e6f43fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do jenkins plugins expose users/groups to the matrix authorization plugin?

2018-02-28 Thread red 888
I think its safe to say the Google Login plugin is 
dead: https://github.com/jenkinsci/google-login-plugin

Hasn't been updated in like a year and there are a bunch of old open pull 
requests.

Id like to modify it for myself to be able to use groups in addition to 
just users under "Project-based Matrix Authorization Strategy"

How does a plugin expose groups to jenkins?

I have used the Active Directory plugin before with the matrix security and 
I can just add an AD group and use that for authorization.

How does one present users and groups to the Matrix-based Security plugin? 
I want to see if I can modify the Google plugin to query a users google 
groups when they login- i just don't know how i connect this to matrix auth.

-- 
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/c8180504-17f7-427b-a8d0-b94e30b446a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I use groups with the google login plugin?

2018-02-27 Thread red 888
I installed and setup the google login 
plugin: https://wiki.jenkins.io/display/JENKINS/Google+Login+Plugin

This works and I can restrict access by domain.

But this still isn't usable for me until I can restrict access by group. 
How can I accomplish this?  Can I use "Project-based Matrix Authorization 
Strategy" with google groups?

-- 
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/f750edf9-c2c5-4d14-b95c-8c6e1e90ad74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new File is adding C: to the path of a linux container

2018-02-15 Thread red 888
This makes sense to me now. I'm trying to execute groovy code inside the 
slave (duh that obviously won't work). The groovy runtime is one the master 
so thats why its giving me back windows file paths- right?



On Thursday, February 15, 2018 at 12:33:23 PM UTC-5, ok999 wrote:
>
> Files generated by jenkins during a build is created in the master. You 
> have to use the "readFile" to use it in the compute environment of the 
> slaves/agents
>
> On Thu, Feb 15, 2018 at 10:57 AM, red 888 <fakemai...@gmail.com 
> > wrote:
>
>> I have a windows master that executes a stage in a container on a linux 
>> slave.
>>
>>
>> Groovy is appending a "C:" to the path inside the linux container- 
>> totally breaking it:
>>
>> stage('sdlfkjsldkf') {
>> agent {
>> docker {
>> image "library/alpine"
>> }
>> }
>>
>> steps {
>> script {
>> new File("${workspace}/blah")
>> .traverse(type: FileType.DIRECTORIES, nameFilter: 
>> 'subfolder') {
>> echo "${it.path}"
>> }
>> }
>>
>> The error I get:
>>
>> java.io.FileNotFoundException: 
>> C:\home\jenkins\workspace\myworkspace\blah\subfolder
>>
>> if I echo ${workspace} it correctly starts at /home, but it looks like new 
>> file want to add "C:" to the beginning of it
>>
>> -- 
>> 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/2ee3d6c3-95b9-4f45-acf9-704228b0717b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/2ee3d6c3-95b9-4f45-acf9-704228b0717b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Regards
> nirish okram
>

-- 
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/55e1d6b2-db9a-4d82-95c1-d8131fc3391f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I unstash and clobber or only copy if changed?

2018-02-15 Thread red 888
Im running into a java.nio.file.AccessDeniedException error when trying to 
unstash to a folder with the same files/folders.

Ideally I'd like unstash to overwrite files only if changed, but if unstash 
would just clobber every file/folder conflict that works too.

I'd be nice to avoid rm * -rf here

-- 
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/be5fe336-c023-4cb1-8877-de00b26cba9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


new File is adding C: to the path of a linux container

2018-02-15 Thread red 888


I have a windows master that executes a stage in a container on a linux 
slave.


Groovy is appending a "C:" to the path inside the linux container- totally 
breaking it:

stage('sdlfkjsldkf') {
agent {
docker {
image "library/alpine"
}
}

steps {
script {
new File("${workspace}/blah")
.traverse(type: FileType.DIRECTORIES, nameFilter: 'subfolder') {
echo "${it.path}"
}
}

The error I get:

java.io.FileNotFoundException: 
C:\home\jenkins\workspace\myworkspace\blah\subfolder

if I echo ${workspace} it correctly starts at /home, but it looks like new 
file want to add "C:" to the beginning of it

-- 
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/2ee3d6c3-95b9-4f45-acf9-704228b0717b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fix gdsl intellij warnings

2018-02-14 Thread red 888
I have my pipeline code in a shared repo and it looks like this:

def call(body) {

def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()

pipeline {
agent any
options {...


Intellij complains 


How do i fix this without suppressing ALL warnings?

-- 
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/ed9e235e-46a1-435d-afa1-e77051adf824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dollar sign in credentials broken for declarative pipelines

2018-02-14 Thread red 888
You are 100% correct, i was confused about what was actually happening here 
( so may layers of parsing!).

So thanks to this SO answer 
<https://stackoverflow.com/questions/48778678/in-credentials-binding-sh-escaping-madness-for-declarative-pipelines>
 
I can see there are two ways to handle this:
environment{
CRED = credentials('mycreds')
}
steps {
sh "some command blahb blah blah" +
//This works, because i guess bash is smart enough to escape $ in 
environment variables?
'--username ${CRED_USR} --password  ${CRED_PSW}' 

// == OR ==

sh "some command blahb blah blah" +
//Passing in the var directly, like you said, requires I tell bash 
this is a literal string
"--username '${CRED_USR}' --password  '${CRED_PSW}'" 

Also, just an aside, I saw nowhere in the docs that usernamePassword 
binding was supported in environment{} or how it worked. That should be in 
the docs somewhere if it isn't.


On Tuesday, February 13, 2018 at 11:50:53 PM UTC-5, Mark Waite wrote:
>
> Are you sure that's really a bug?
>
> If the value of mypass is 'ASD123$567' and that is passed as an 
> environment variable to the shell, won't the shell see the '$567' and 
> attempt to expand an environment variable named '567'?  The expansion of 
> $567 is probably the empty string.
>
> If '$' and other special characters are embedded in the password, aren't 
> surrounding quotes needed around the expanded result to assure it is not 
> interpreted by the shell?
>
> Mark Waite
>
>
>
> On Tue, Feb 13, 2018 at 7:36 PM Slide <slide...@gmail.com > 
> wrote:
>
>> Can you file an issue in JIRA?
>>
>> On Tue, Feb 13, 2018 at 7:10 PM red 888 <fakemai...@gmail.com 
>> > wrote:
>>
>>> This is my password: "ASD123$567"
>>>
>>> This doesn't work
>>>
>>> withCredentials([usernamePassword(credentialsId: 'creds',
>>> usernameVariable: 'myuser', passwordVariable: 'mypass')]) {
>>> sh "some command --username ${svnuser} --password ${mypass}"
>>> }
>>>
>>>
>>> What i see in the output is mypass is not obfuscated and most 
>>> importantly it looks like its getting cut off after the "$" so its only 
>>> showing ASD123
>>>
>>> -- 
>>> 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/16bfd2b1-ad71-4326-ac3c-7693b9c71331%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/16bfd2b1-ad71-4326-ac3c-7693b9c71331%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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/CAPiUgVf9g8GN2BPSGdt9jSR1t%2Bj7%2BzoC%2B711cPQzOO1duu6WYQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVf9g8GN2BPSGdt9jSR1t%2Bj7%2BzoC%2B711cPQzOO1duu6WYQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> 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/e6bf4041-65d5-4e22-94c5-b24494a6e93a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dollar sign in credentials broken for declarative pipelines

2018-02-13 Thread red 888
This is my password: "ASD123$567"

This doesn't work

withCredentials([usernamePassword(credentialsId: 'creds',
usernameVariable: 'myuser', passwordVariable: 'mypass')]) {
sh "some command --username ${svnuser} --password ${mypass}"
}


What i see in the output is mypass is not obfuscated and most importantly 
it looks like its getting cut off after the "$" so its only showing ASD123

-- 
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/16bfd2b1-ad71-4326-ac3c-7693b9c71331%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: gcloud ssh pass key file as an environment var?

2018-02-02 Thread red 888
Sorry meant to ask on GCE forum, deleting this post

-- 
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/aead3520-f358-4c20-8526-caabb3a969a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


gcloud ssh pass key file as an environment var?

2018-02-01 Thread red 888
I tried setting GOOGLE_APPLICATION_CREDENTIALS to the path of my json key 
but it doesn't work:

+ gcloud auth activate-service-account
ERROR: (gcloud.auth.activate-service-account) argument --key-file: Must 
be specified.


Many other commands support this env. Is there an env that gcloud auth 
supports? Or do I have to pass it in manually

-- 
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/8c81fdb9-9521-45c3-ae30-08b51ba36ee6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


sshagent still broken in containers

2018-01-29 Thread red 888
I know this used to be a bug but im running an updated version (1.15)

sshagent (credentials: ['mykey']) {
sh 'ssh-add -l'
sh 'git clone g...@bitbucket.org:my/repo.git'
}


I even run ssh-add -l and can see its grabbing that key (already confirmed 
this key works outside of container)

[Pipeline] sshagent
[ssh-agent] Using credentials mykey (mykey)
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
$ docker exec 
b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env ssh-
agent
SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9
SSH_AGENT_PID=13
$ docker exec 
b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env 
SSH_AGENT_PID=13 SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9 ssh-add /home/
jenkins/workspace/z@2@tmp/private_key_321144192289582899.key
Identity added: /home/jenkins/workspace/z@2@tmp/
private_key_321144192289582899.key (/home/jenkins/workspace/z@2@tmp/
private_key_321144192289582899.key)
[ssh-agent] Started.
[Pipeline] {
[z@2] Running shell script
[Pipeline] sh
+ ssh-add -l
2047 SHA256:ZIkgMtEj9KtL4adcmxwsyiJBi3P+B0vSew+ufhUVOc0 /home/jenkins/
workspace/z@2@tmp/private_key_321144192289582899.key (RSA)
[Pipeline] sh
$ docker exec 
b9d2dbce9f672020317d915b42f8056bec1f3578e2e3875684bd860421d60283 env 
SSH_AGENT_PID=13 SSH_AUTH_SOCK=/tmp/ssh-fA1POfBXVEy5/agent.9 ssh-agent -k
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 13 killed;
[ssh-agent] Stopped.
[z@2] Running shell script
+ git clone g...@bitbucket.org:my/repo.git
Cloning into 'repo'...
Host key verification failed.
fatal: Could not read from remote repository.


Please make sure you have the correct access rights
and the repository exists.
[Pipeline] }
[Pipeline] // sshagent
[Pipeline] }

What more do I have to do!

-- 
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/26f17129-632e-4a84-b05e-7db8e9cd5af8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I get access to environment variables in my post block?

2018-01-23 Thread red 888


At the top of my pipeline (not inside a specific stage) I define an env:

environment {
MYVA = 'sdkfjlsjflsjflsd'}


Now I want to use it in a function call in my post block. I had to do this 
to get it to work:

post {
success {
script {
def MYVA = MYVA
myFunction {
someParam = "This is my var: ${MYVA}
}
...

This works fine, but is there a more elegant shorthand for this? Maybe an 
annotation that will grab the var from the calling parent or something? Why 
do I have to redefine the variable?


-- 
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/48b013e7-597a-4bd9-a005-f92d5d858b89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Get what stage of a pipeline failed in post actions

2018-01-17 Thread red 888
In my pipeline's post{falure{}} block I want to report at which stage the 
pipeline failed. Is there an env or something that tracks this?

-- 
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/cd7a8ec2-df26-4dfb-a60d-6017b158b45e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I purge/clobber stashed files?

2017-12-28 Thread red 888
The problem was I wasn't cleaning up the workspaces of the streams. I 
thought their workspaces were destroyed automatically but they persist.

On Wednesday, December 27, 2017 at 1:04:30 PM UTC-5, Mark Waite wrote:
>
> That seems like a bug to me if I've understood your phrasing correctly.
>
> I don't expect the stash from one build (for example, build number 14) to 
> be included in later builds (for example, build number 15).
>
> Within a single build (for example, build number 14), I would initially 
> assume (until proven otherwise) that multiple references to write to a 
> stash of the same name would append to a single stash.
>
> Mark Waite
>
> On Wed, Dec 27, 2017 at 10:44 AM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> Jenkins docs 
>> <https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-stash-code-stash-some-files-to-be-used-later-in-the-build>
>>  seem 
>> ambiguous about this:
>>
>> Stashed files are not otherwise available and are generally discarded at 
>> the end of the build.
>>
>> S "generally" means what? They *should* get discarded by default? Do 
>> I need to do something to have them discarded?
>>
>>
>> Because my stashed files aren't getting discarded. I run this in my job:
>>
>> stash name: "myZip", includes: "${differentEveryTime}.zip"
>>
>>
>> And every time the job runs it keeps adding the new zip file to the 
>> "myZip" stash.
>>
>> I couldn't find anything in the docs about how to control this. I want 
>> myZip to clobber everything previously or start empty each job run.
>>
>> -- 
>> 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/b879399c-2179-485c-bfdc-793769b70227%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/b879399c-2179-485c-bfdc-793769b70227%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/e2ad559b-9718-4ae4-955c-47256873f9c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I purge/clobber stashed files?

2017-12-27 Thread red 888


Jenkins docs 

 seem 
ambiguous about this:

Stashed files are not otherwise available and are generally discarded at 
the end of the build.

S "generally" means what? They *should* get discarded by default? Do I 
need to do something to have them discarded?


Because my stashed files aren't getting discarded. I run this in my job:

stash name: "myZip", includes: "${differentEveryTime}.zip"


And every time the job runs it keeps adding the new zip file to the "myZip" 
stash.

I couldn't find anything in the docs about how to control this. I want 
myZip to clobber everything previously or start empty each job run.

-- 
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/b879399c-2179-485c-bfdc-793769b70227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins parallel streams with local files?

2017-12-27 Thread red 888
Thanks! That was just what I needed, but now I have a question about how to 
clear out the stash for each run. Just made a new post for this question.

On Friday, December 22, 2017 at 7:18:47 PM UTC-5, Mark Waite wrote:
>
> The "stash" step stores files from a workspace.  The "unstash" step 
> retrieves previously stored stashes.
>
> Mark Waite
>
> On Fri, Dec 22, 2017 at 5:16 PM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> My parallel steps need access to a local file in the workspace of the 
>> job. But it seems they can access it?
>>
>> I tried listing the workspace in each stream:
>>
>>
>> powershell "ls ${workspace}"
>>
>>
>> they are all empty! Each stream has its own workspace and the output of 
>> each stream ls C:\workspace\branch_name@<stream#> shows no files.
>>
>> How they get access to the main workspace? they're pretty much useless to 
>> me if they can't even access local files.
>>
>>
>> I understand this could create a race condition, is there at least a 
>> feature to copy files from the main workspace to the stream workspaces?
>>
>> -- 
>> 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/6ecc868e-4493-4056-9938-152b45b79f8d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/6ecc868e-4493-4056-9938-152b45b79f8d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/dff0f128-856f-4421-afbb-0e1573ada850%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jenkins parallel streams with local files?

2017-12-22 Thread red 888


My parallel steps need access to a local file in the workspace of the job. 
But it seems they can access it?

I tried listing the workspace in each stream:


powershell "ls ${workspace}"


they are all empty! Each stream has its own workspace and the output of 
each stream ls C:\workspace\branch_name@ shows no files.

How they get access to the main workspace? they're pretty much useless to 
me if they can't even access local files.


I understand this could create a race condition, is there at least a 
feature to copy files from the main workspace to the stream workspaces?

-- 
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/6ecc868e-4493-4056-9938-152b45b79f8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


subfolders under vars for shared repo- or however this is support to be organized?

2017-12-07 Thread red 888
Im using the src folder and writing groovy classes. These are wrappers 
around java api. Its nice because I can use package name-spacing, but whats 
not nice is in order to use them in a declarative pipeline I have to do 
this in my steps:

script { mySexyAssClass.aMethod('sdsdfsdf','sdfsdfds') }

I want to use these like pipeline steps. Now I _can_ do that with global 
functions I put in vars, but unlike src I don't think vars can have 
subfolders so that folder done get real sloppy. Is there a way to have 
subfolders under vars?

I was thinking about having a separate shared repo just for reusable custom 
"steps". It would have classes in src _and_ corresponding functions in vars 
that use the classes. I my pipelines I could call the vars like a regular 
steps. Is this a common way of organizing this?

-- 
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/d6f6532a-c379-4de6-9cd1-0cd6da0b75bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-12-04 Thread red 888
I guess it took longer than it should have to realize I was barking up the 
wrong tree, but let me explain why I wanted this.

I'm using the AWS java sdk. The AWS sdk looks for these env vars and pulls 
them in for creds automatically if they are set in the current session. Of 
course you can pass them in manually, but this feature is quite convenient! 
I'm calling the AWS SDK from a groovy class like this because its super 
portable and behaves almost like a lightweight jenkins plugin- I really 
like the idea of writing reusable api wrappers in groovy classes for the 
pipeline like this.

The GCP SDK has similar features where it looks for env vars for config.

It just would be nice to be able to define this once in the environment{} 
directive before calling these api wrapper classes.


On Sunday, December 3, 2017 at 3:47:19 PM UTC-5, Daniel Butler wrote:
>
> If you’re dealing with a stubborn library that’s forcing you to use 
> environment variables to pass in parameters you’re in for more pain than 
> it’s worth trying to run it within the pipeline script environment.
>
>  
>
> Use it by running a groovy script externally, e.g.
>
>  
>
> sh “groovy MyScript.groovy”
>
>  
>
> and then you’ve got all the environment variables setup and you’re in a 
> standard groovy environment without the pipeline restrictions and 
> idiosyncrasies.
>
>  
>
>  
>
>  
>
> *From: *red 888 
> *Sent: *03 December 2017 00:28
> *To: *Jenkins Users 
> *Subject: *Re: How can I inject environment variables into my groovy 
> class?
>
>  
>
> "In the pipeline there’s the global variable `env` which is a map of all 
> the currently declared environment variables (JOB_NAME etc) you could pass 
> into your class."
>
>  
>
> Is there a way to do that so all those envs are imported and accessible in 
> the class like they are system variables? For example if I do a printenv 
> from the pipeline "MyVar" shows up like its a system variable, I want it to 
> show up like that from in my class too. Is there an elegant way of 
> importing all the vars in "env" into my class and making them access like 
> shell variables?
>
>
>
> On Friday, December 1, 2017 at 9:08:12 AM UTC-5, Daniel Butler wrote:
>
> If you’re writing a groovy class that’s run from a library in the pipeline 
> script then you’re not going to be able to use System.getEnv().
>
>  
>
> There’s a few approaches you can take that do work:
>
>- You can pass in the values you need as parameters to the 
>methods/constructors you’re using.
>- In the pipeline there’s the global variable `env` which is a map of 
>all the currently declared environment variables (JOB_NAME etc) you could 
>pass into your class.
>- Pass in `this` from the pipeline script. You can then use this 
>object to access anything in pipeline, (Let’s assume you called the 
>field/parameter ctx) i.e. ctx.env.JOB_NAME or ctx.powershell(“write-host 
>‘spooky’”)
>
>  
>
> I noticed also you’ve got a direct execution of a process commented out, 
> don’t do that either. The same way System.getEnv() doesn’t work, doing that 
> will not behave as expected either (Assuming the sandbox will let you)
>
>  
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *red 888
> *Sent: *29 November 2017 20:28
> *To: *Jenkins Users
> *Subject: *Re: How can I inject environment variables into my groovy 
> class?
>
>  
>
> 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 <fakemai...@gmail.com>:
>
> 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*()
>
>  

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

2017-12-02 Thread red 888
"In the pipeline there’s the global variable `env` which is a map of all 
the currently declared environment variables (JOB_NAME etc) you could pass 
into your class."

Is there a way to do that so all those envs are imported and accessible in 
the class like they are system variables? For example if I do a printenv 
from the pipeline "MyVar" shows up like its a system variable, I want it to 
show up like that from in my class too. Is there an elegant way of 
importing all the vars in "env" into my class and making them access like 
shell variables?


On Friday, December 1, 2017 at 9:08:12 AM UTC-5, Daniel Butler wrote:
>
> If you’re writing a groovy class that’s run from a library in the pipeline 
> script then you’re not going to be able to use System.getEnv().
>
>  
>
> There’s a few approaches you can take that do work:
>
>- You can pass in the values you need as parameters to the 
>methods/constructors you’re using.
>- In the pipeline there’s the global variable `env` which is a map of 
>all the currently declared environment variables (JOB_NAME etc) you could 
>pass into your class.
>- Pass in `this` from the pipeline script. You can then use this 
>object to access anything in pipeline, (Let’s assume you called the 
>field/parameter ctx) i.e. ctx.env.JOB_NAME or ctx.powershell(“write-host 
>‘spooky’”)
>
>  
>
> I noticed also you’ve got a direct execution of a process commented out, 
> don’t do that either. The same way System.getEnv() doesn’t work, doing that 
> will not behave as expected either (Assuming the sandbox will let you)
>
>  
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *red 888 
> *Sent: *29 November 2017 20:28
> *To: *Jenkins Users 
> *Subject: *Re: How can I inject environment variables into my groovy 
> class?
>
>  
>
> 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 <fakemai...@gmail.com>:
>
> 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
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/87b6e2b0-ed9a-4ede-b22c-3b06761345e1%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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 

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 <fakemai...@gmail.com >:
>
>> 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
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/87b6e2b0-ed9a-4ede-b22c-3b06761345e1%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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.


How can I inject environment variables into my groovy class?

2017-11-28 Thread 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-users+unsubscr...@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.


Re: Why aren't these injected variables making it to my groovy class?

2017-11-21 Thread red 888
It is external in the sense that its a self contained groovy script/class 
that jenkins executes.

So how can I have withCredentials inject these vars into the environment of 
the main process?

On Tuesday, November 21, 2017 at 5:33:36 AM UTC-5, Daniel Butler wrote:
>
> As I’d said the System.getEnv() call returns the environment the Jenkins 
> process is currently running in. 
>
>  
>
> When Jenkins runs an external process (ie sh) it adds the values in the 
> env map to the environment of the external process. The environment of the 
> Jenkins process is left untouched.
>
> Thus “sh ‘printenv’” shows the vars (It’s an external process)
>
> System.getEnv()  does not as you’re just getting the Jenkins process 
> environment.
>
>  
>
> If you’re connecting up to Dynamo you’d generally don’t want to do that 
> from within pipeline script; Things are a lot more robust if you do those 
> sorts of things from an external script. 
>
>  
>
> The recommendation is to use pipeline script to orchestrate the job but 
> leave the actual heavy lifting to external processes and plugins.
>
>  
>
>  
>
> *From: *red 888 
> *Sent: *20 November 2017 18:36
> *To: *Jenkins Users 
> *Subject: *Re: Why aren't these injected variables making it to my groovy 
> class?
>
>  
>
> Can you explain this i don't understand.
>
>  
>
> sh 'printenv' returns my injected variables. System.getenv() inside my 
> function does not. Even if I shell out from the groovy function and run 
> printenv I still don't see the variables. Why aren't they there in the 
> context of my function?
>
>  
>
> The amazon api looks for these variables so when I run this in my function 
> its looking for those two environment vars that should be injected but are 
> not:
>
> def ebClient = new AmazonDynamoDBClientBuilder()
>
> .withCredentials(new EnvironmentVariableCredentialsProvider())
>
> .build()
>
>  
>
>
> On Monday, November 20, 2017 at 6:57:07 AM UTC-5, Daniel Butler wrote:
>
> By doing System.getenv() you're getting the environment of the Jenkins 
> master process.
>
>  
>
> The environment that will be used by any process run in the pipeline is 
> available through the built-in variable env. 
>
>  
>
> Regards, 
>
> Daniel 
>
>  
>
> On 20 Nov 2017 2:14 am, "red 888" <fakemai...@gmail.com> wrote:
>
> In my pipeline I'm injecting aws credentials:
>
>  
>
> withCredentials([[$class: 'AmazonWebServicesCredentialsBinding',
>
> credentialsId: '89h9sfh8shf98shf98he9f8sf',
>
> accessKeyVariable: 'AWS_ACCESS_KEY_ID',
>
> secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
>
>  
>
> sh 'printenv'
>
>  
>
> echo myFunc.myMeth('blah','sdjlfkdf')
>
>  
>
> }
>
>  
>
> myFunc looks like this:
>
>  
>
> class myFunc {
>
> static Object myMeth (String param1, String param2){
>
>  
>
>  
>
> def env = System.getenv()
>
> //Print all the environment variables.
>
> env.each{
>
> println it
>
> }
>
> }
>
> }
>
>  
>
> Looking at the output of sh 'printenv' I see AWS_ACCESS_KEY_ID and 
> AWS_SECRET_ACCESS_KEY are injected. But when I try to echo back what envs 
> myFunc has access to I don't see those variables. Is this by design? Is 
> myFunc isolated and I need change its scope or something?
>
> -- 
> 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/6dfaad11-29f5-4287-a0a0-a16a2373ecd4%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/6dfaad11-29f5-4287-a0a0-a16a2373ecd4%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/89ce7f8b-99ae-4e47-abbb-a57e0f306fcc%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/89ce7f8b-99ae-4e47-abbb-a57e0f306fcc%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/11993c26-a1e9-4442-8dcf-6e5b4d385ff8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why aren't these injected variables making it to my groovy class?

2017-11-20 Thread red 888
Can you explain this i don't understand.

sh 'printenv' returns my injected variables. System.getenv() inside my 
function does not. Even if I shell out from the groovy function and run 
printenv I still don't see the variables. Why aren't they there in the 
context of my function?

The amazon api looks for these variables so when I run this in my function 
its looking for those two environment vars that should be injected but are 
not:

def ebClient = new AmazonDynamoDBClientBuilder()
.withCredentials(new EnvironmentVariableCredentialsProvider())
.build()



On Monday, November 20, 2017 at 6:57:07 AM UTC-5, Daniel Butler wrote:
>
> By doing System.getenv() you're getting the environment of the Jenkins 
> master process.
>
> The environment that will be used by any process run in the pipeline is 
> available through the built-in variable env. 
>
> Regards, 
> Daniel 
>
> On 20 Nov 2017 2:14 am, "red 888" <fakemai...@gmail.com > 
> wrote:
>
> In my pipeline I'm injecting aws credentials:
>
>
> withCredentials([[$class: 'AmazonWebServicesCredentialsBinding',
> credentialsId: '89h9sfh8shf98shf98he9f8sf',
> accessKeyVariable: 'AWS_ACCESS_KEY_ID',
> secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
>
> sh 'printenv'
>
> echo myFunc.myMeth('blah','sdjlfkdf')
> }
>
>
> myFunc looks like this:
>
>
> class myFunc {
> static Object myMeth (String param1, String param2){
>
>
> def env = System.getenv()
> //Print all the environment variables.
> env.each{
> println it
> }
> }}
>
>
> Looking at the output of sh 'printenv' I see AWS_ACCESS_KEY_ID and 
> AWS_SECRET_ACCESS_KEY are injected. But when I try to echo back what envs 
> myFunc has access to I don't see those variables. Is this by design? Is 
> myFunc isolated and I need change its scope or something?
>
> -- 
> 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/6dfaad11-29f5-4287-a0a0-a16a2373ecd4%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/6dfaad11-29f5-4287-a0a0-a16a2373ecd4%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/89ce7f8b-99ae-4e47-abbb-a57e0f306fcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why aren't these injected variables making it to my groovy class?

2017-11-19 Thread red 888


In my pipeline I'm injecting aws credentials:


withCredentials([[$class: 'AmazonWebServicesCredentialsBinding',
credentialsId: '89h9sfh8shf98shf98he9f8sf',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {

sh 'printenv'

echo myFunc.myMeth('blah','sdjlfkdf')
}


myFunc looks like this:


class myFunc {
static Object myMeth (String param1, String param2){


def env = System.getenv()
//Print all the environment variables.
env.each{
println it
}
}}


Looking at the output of sh 'printenv' I see AWS_ACCESS_KEY_ID and 
AWS_SECRET_ACCESS_KEY are injected. But when I try to echo back what envs 
myFunc has access to I don't see those variables. Is this by design? Is 
myFunc isolated and I need change its scope or something?

-- 
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/6dfaad11-29f5-4287-a0a0-a16a2373ecd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to detect a merge and perform a cleanup action with multibranch pipelines

2017-10-19 Thread red 888


This is what I have now:

1. Create a feature branch with jenkinsfile in it
2. Commit to your new feature branch and the pipeline kicks off
3. The pipeline deploys the app to a new VM/environment/container/whatever
4. The environment/VM persists after the deploy so you can touch/test it 
physically

Now what I want to happen is when the branch is merged and deleted jenkins 
cleans up and deletes the VM it created for that branch.

Are there triggers for merge/deletion of a 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/443b874e-8c4f-4a46-8cad-961b6f7b6904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why does the jenkinsfile use a closure in this way?

2017-10-04 Thread red 888


Its a command pattern to write jenkins pipeline code like this:

def call(body) {

def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()

Im not sure how to word this simply, but this closure get implicitly 
imported and can be called by the file name of the .groovy file it lives in.

I call it like: MyClosher{myarg ='sdfsdf}

I not entirely sure what this is doing. Its doing call(body) and then 
assigning body as the delegate. so that means the closure i pass it is the 
delegate, but isn't that just the owner? wah me confused.

-- 
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/82e5ff55-0ea9-4ca5-88d4-9b9fe7201ee5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: In a shared library, what is the "vars/foo.txt" file USED for?

2017-10-04 Thread red 888
Interesting I check there and didn't see them. Does this mean my txt files 
aren't formatted correctly? I just put a sentence in one to test.

On Monday, October 2, 2017 at 11:25:43 PM UTC-4, Robert Hales wrote:
>
> The .txt file shows up on the PipelineSyntax/Global Variables Reference 
> page. 
>
> On Sunday, February 5, 2017 at 6:33:03 PM UTC-7, David Karr wrote:
>>
>> So I now have a handful of pipeline scripts all reusing some global 
>> methods, all of which I pasted into each script, so I've started to set up 
>> a shared library to avoid duplication.
>>
>> I'm using https://jenkins.io/doc/book/pipeline/shared-libraries/ as my 
>> implementation guide.
>>
>> My questions have to do with the following block:
>>
>> The vars directory hosts scripts that define global variables accessible 
>>> from Pipeline. The basename of each *.groovy file should be a Groovy (~ 
>>> Java) identifier, conventionally camelCased. The matching *.txt, if 
>>> present, can contain documentation, processed through the system’s 
>>> configured markup formatter (so may really be HTML, Markdown, etc., though 
>>> the txt extension is required).
>>
>>
>> The first thing I need to define isn't what you might call a "global 
>> variable", but a method.  I know they are the same thing, but I think this 
>> could be clearer to people who are perhaps less than experts if this 
>> described "global variables or methods".  I'll submit that suggestion in a 
>> PR, but that's not quite what I'm asking about here.
>>
>> I'm wondering about this "matching *.txt" file.  It says it "can contain 
>> documentation, ...".  The problem is, this page says nothing about how that 
>> documentation is used or presented. How is this file actually used?
>>
>>

-- 
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/cba485b6-1c2d-4758-9346-b3a8581f2d76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: In a shared library, what is the "vars/foo.txt" file USED for?

2017-10-02 Thread red 888
Any word on this? I'm assuming no one is actually using this feature and 
its going to be deprecated because there is like zero documentation about 
where this is actually supposed to show up in jenkins. Is it under "Global 
Variables Reference" or "Step Reference"? I see my txt info no where and i 
don't even know where i am supposed to be looking for it.

On Sunday, February 5, 2017 at 8:33:03 PM UTC-5, David Karr wrote:
>
> So I now have a handful of pipeline scripts all reusing some global 
> methods, all of which I pasted into each script, so I've started to set up 
> a shared library to avoid duplication.
>
> I'm using https://jenkins.io/doc/book/pipeline/shared-libraries/ as my 
> implementation guide.
>
> My questions have to do with the following block:
>
> The vars directory hosts scripts that define global variables accessible 
>> from Pipeline. The basename of each *.groovy file should be a Groovy (~ 
>> Java) identifier, conventionally camelCased. The matching *.txt, if 
>> present, can contain documentation, processed through the system’s 
>> configured markup formatter (so may really be HTML, Markdown, etc., though 
>> the txt extension is required).
>
>
> The first thing I need to define isn't what you might call a "global 
> variable", but a method.  I know they are the same thing, but I think this 
> could be clearer to people who are perhaps less than experts if this 
> described "global variables or methods".  I'll submit that suggestion in a 
> PR, but that's not quite what I'm asking about here.
>
> I'm wondering about this "matching *.txt" file.  It says it "can contain 
> documentation, ...".  The problem is, this page says nothing about how that 
> documentation is used or presented. How is this file actually used?
>
>

-- 
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/68410006-ce15-4ba3-9e64-c694d5ab6c8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I configure "Scan Multibranch Pipeline Triggers" in my jenkinsfile?

2017-09-19 Thread red 888
Right now I manually configure my multibranch pipeline jobs and set "Scan 
Multibranch Pipeline Triggers" to 3 minutes.

How do I put this in my jenkinsfile? I can't find examples of this. Is Scan 
Multibranch Pipeline Triggers available in the "triggers{}" block?

-- 
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/83e480d4-d8d8-4e1c-b004-fdbe4aec5bb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


build job "wait" not available for pipeline jobs

2017-09-18 Thread red 888
I'm calling a pipeline from another pipeline like this:

steps {
 build job:
 '/mypipelines/mypipeline01/master',
 parameters: [string(name: 'passMeIn', value: "sdfsfsd")],
 wait: false
}

I have to do "wait: false" because otherwise I can't an error saying this is 
not supported. Is there a work around for this? Ideally I'd like this pipeline 
to wait till the another pipeline it triggers to finish.

-- 
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/c9eedd9c-b9b4-4c74-9a4d-be3a8cf75811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


upstream() method pointing to all branches of a job

2017-09-16 Thread red 888
I've seen a few examples of ways to trigger a pipeline when an upstream job 
is updated:

triggers {
  upstream(upstreamProjects: "/myjob/mybranch", threshold: hudson.model.
Result.SUCCESS)
}


properties([
pipelineTriggers([
upstream(
upstreamProjects: '/myjob/mybranch',
threshold: hudson.model.Result.SUCCESS,
),
]),
])


But, is there a way trigger on all of an upstream job's branches? Like it 
just looks at the whole job instead of just one branch, and then triggers 
if any of its branches are updated. Also, for this to be useful to me, if 
its even possible, I would also need a way of getting the name of each 
branch that triggered the downstream job.

-- 
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/bd271f63-f549-4f65-aa22-bb0718a87bd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: All jobs run when shared library is updated

2017-09-16 Thread red 888
Yes I agree that ideally the jenkinsfile code would be delivered in tandem 
with the actually applications code- sadly that is not often the case if 
ever.
But, I guess i stupidly misunderstood what "*Ignore on push notifications*" 
actually was. I thought it only ignored push notifications, and assumed 
because Im polling that was not relevant? I guess that means it won't push 
out the deploy if the SCM (polling or pushed to) notices there is a change? 

On Friday, September 15, 2017 at 5:52:12 PM UTC-4, red 888 wrote:
>
> I have my whole pipeline block of code defined in a shared library and my 
> jenkinsfiles for my apps just call this shared library.
>
> I noticed though that when I modify the shared library and push to the git 
> repo ALL the jenkins jobs that depend on this library re-run.
>
> How can I prevent this from happening? I dont want all the jobs that 
> depend on this shared library to re-run whenever there is a change made to 
> it. I know this could technically be a good thing, but for now I want to 
> disable this.
>

-- 
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/1f34da62-1124-41ad-9220-443f2286c93f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Have a job run for each branch of a shared library repo

2017-09-16 Thread red 888
Need to have a good dev workflow for developing share libraries my jobs depend 
on.

Right now when a shared Lib is edited all jobs depending on it automatically 
run. I want to control and test this code somewhat like I do with regular apps 
with Jenkins.

I don't want to have to manually point my jobs to specific versions (branches) 
of my shared Lib repo to test it and them have to point them back. 

I have an idea but not sure it is supported or too nutty.

Can I have jobs automatically scan and execute once for each branch of each 
shared Lib repo? Just Like multibranch pipelines but the branches they track 
are from the shared libraries they import? Because this is my plan:

* Create a test job for each language/platform I currently deploy with Jenkins. 
These jobs are designed expressly to mirror my real apps and do test runs of my 
shared libs for all my platforms without impacting my prod apps/jobs
* These test jobs don't point to specific shared library branches (versions) 
but track ALL of there shared lib branches
* when we branch one of the shared lib repos and commit our changes to our 
individual test/feature/hotfix branches all the test jobs execute for each of 
our branches.
* We don't step on each other and can work in parallel because each branch gets 
its own test runs
* the prod jobs just point to master so they are not impacted and deploying to 
all the jobs is as easy as merging to 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/9b98e145-5a9f-4b88-ab37-f91077fa2217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: All jobs run when shared library is updated

2017-09-16 Thread red 888
I suppose I want to have my cake and eat it too

Just to be clear, I have my pipeline block,settings,options,stages,etc
centralized in a shared Library and all my apps' jenkinsfiles just make a
parameterized method call to it. This is awesome but now i need to figure
out a development workflow for it that is also awesome.

I'm polling, not push notifications. Is there a way to have the Jenkins
server pull the repo,  keep the shared Lib up-to-date but not trigger all
of the Jenkins jobs that rely on it immediately- does the load implicitly
feature impact this?


On Sep 15, 2017 8:34 PM, "Mark Waite" <mark.earl.wa...@gmail.com> wrote:

> One way to disable it is to redefine your library references so that each
> Jenkinsfile refers to a specific version in the pipeline shared library.
> That has the additional benefit that it makes explicit what you have
> decided implicitly, that you want to ignore changes in the pipeline shared
> library.
>
> When you're ready to allow branches to see a change in the pipeline shared
> library (because it might risk breaking those branches, etc.), you update
> the Jenkinsfile to use the newest version of the pipeline shared library.
>
> There are also settings which should allow the pipeline shared library to
> ignore push notifications, but it seems cleaner and clearer to state in
> your Jenkinsfile (or in the folder) the specific version of the pipeline
> shared library that you want to use.
>
> Mark Waite
>
> On Fri, Sep 15, 2017 at 3:52 PM red 888 <fakemailred...@gmail.com> wrote:
>
>> I have my whole pipeline block of code defined in a shared library and my
>> jenkinsfiles for my apps just call this shared library.
>>
>> I noticed though that when I modify the shared library and push to the
>> git repo ALL the jenkins jobs that depend on this library re-run.
>>
>> How can I prevent this from happening? I dont want all the jobs that
>> depend on this shared library to re-run whenever there is a change made to
>> it. I know this could technically be a good thing, but for now I want to
>> disable this.
>>
>> --
>> 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/ms
>> gid/jenkinsci-users/5f3d6c01-b693-4c5e-b441-9f1688a05b2a%40g
>> ooglegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/5f3d6c01-b693-4c5e-b441-9f1688a05b2a%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/to
> pic/jenkinsci-users/mkjelSUQCoU/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/ms
> gid/jenkinsci-users/CAO49JtGdDW7SA0CqYg5s%3DMJH8Y8psOZUj%3DA
> Lh3nKG7PkKy36qA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGdDW7SA0CqYg5s%3DMJH8Y8psOZUj%3DALh3nKG7PkKy36qA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> 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/CANLFi7ppK-dFgK9vMrZjNcFis38NqLmpHnpw_bb4OzaF1%3DaFPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


All jobs run when shared library is updated

2017-09-15 Thread red 888
I have my whole pipeline block of code defined in a shared library and my 
jenkinsfiles for my apps just call this shared library.

I noticed though that when I modify the shared library and push to the git 
repo ALL the jenkins jobs that depend on this library re-run.

How can I prevent this from happening? I dont want all the jobs that depend 
on this shared library to re-run whenever there is a change made to it. I 
know this could technically be a good thing, but for now I want to disable 
this.

-- 
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/5f3d6c01-b693-4c5e-b441-9f1688a05b2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Beanstalk deployment plugin for multi-region app? (AWSEB Deployment Plugin)

2017-09-14 Thread red 888
Looking at this plugin: 
https://wiki.jenkins.io/display/JENKINS/AWSEB+Deployment+Plugin

How do I use this to deploy to multiple regions? I have a single EB app 
across several regions (I gave it the same env and application name in 
every region).

Maybe I can call this as a step programatically in jenkinsfile 
multiple times for each region of my app?

-- 
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/5f87d687-eea4-4a2b-bcd4-cec367aa47a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkinsfile gdsl for intellij not working

2017-09-12 Thread red 888
OK so I created a brand new groovy project and added my files to it and now 
it seems be resolving jenkinsfile stuff, BUT it still doesn't like 
"pipeline" and is still saying it "cannot be applied to 
'(groovy.lang.Closure)'

On Tuesday, September 12, 2017 at 8:51:33 PM UTC-4, red 888 wrote:
>
> followed the instructions and this article:
> https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij
>
> But the dsl is not working. Made sure it was in src which I marked as a 
> source root. I got the message to Activate Back in Intellij and clicked it 
> but even after doing that for jenkinsfile-isms like "echo" or "powershell" 
> it says "cannot resolve symbol"
>
> Also more alarming I see this for my pipeline block I have in one of my 
> shared libraries:
>
> <https://lh3.googleusercontent.com/-U3hLGfsp1VQ/WbiAlGnTnFI/AGA/tpRSE-d4zFkfc7VFxIgkch0DEOx-XjBuQCLcBGAs/s1600/Capture.PNG>
>
> My JAVA_HOME is set correctly, I'm not sure where else to look. I'm not 
> even sure what this error means
>
>

-- 
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/453de103-0e7a-41ba-9b01-74eea7ea9edd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jenkinsfile gdsl for intellij not working

2017-09-12 Thread red 888
followed the instructions and this article:
https://st-g.de/2016/08/jenkins-pipeline-autocompletion-in-intellij

But the dsl is not working. Made sure it was in src which I marked as a 
source root. I got the message to Activate Back in Intellij and clicked it 
but even after doing that for jenkinsfile-isms like "echo" or "powershell" 
it says "cannot resolve symbol"

Also more alarming I see this for my pipeline block I have in one of my 
shared libraries:


My JAVA_HOME is set correctly, I'm not sure where else to look. I'm not 
even sure what this error means

-- 
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/6f5284d2-d260-41ce-a010-3ef4f5d4b48e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


XUnitPublisher display ALL tests including passed tests

2017-09-05 Thread red 888
This is how I'm using this plugin in my jenkinsfile to read MSTest trx 
files:
 

> step([$class: 'WsCleanup'])


step([$class : 'XUnitPublisher',
> testTimeMargin: '3000',
> thresholdMode: 1,
> thresholds: [
> [$class: 'FailedThreshold', failureNewThreshold: '', 
> failureThreshold:'2', unstableNewThreshold: '', unstableThreshold: '']
> ],
> tools : [[$class: 'MSTestJunitHudsonTestType',
> deleteOutputFiles: true,
> failIfNotNew: false,
> pattern: "\\TestResults\\*.trx",
> skipNoTestFiles: false,
> stopProcessingIfError: true
> ]]
> ])


This seems to generate a junitResult.xml that only includes failed tests 
and fixed test (tests that previously failed) and new tests. Generally this 
is great and should be what you want to see, but I also want to see ALL 
tests includes ones that passed. Is there a settings for this?

-- 
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/78c1aca8-e100-487f-9b56-fa98f79d8b17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Best way to get named parameter in a shared library function

2017-08-25 Thread red 888
I have this in my shared library in /vars/myLib.groovy: 

def call(Map args) {

one = args.one
two = args.two
three = args.three

somePlugin(
someParam: one,
otherParam: two, 
anotherParam: three
)

}

Then in my jenkinsfile I call it like this:
myLib(
one: 'sdfsdf',
two: 'ldskfjsdjf',
three: 'snfeknfsi'
)

This works great, but I was wondering if there is a better way to get named 
parameters or maybe there is a feature of the DSL I could leverage for 
something like this?

-- 
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/3292a5e4-6ac9-4876-8da1-3dbd963bb9a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Method names for getters/setters in pipeline shared libraries

2017-08-25 Thread red 888
Yup "myFunc.myDerp" works! So is this a groovy thing or is this part of the 
jenkins DSL? I tried googling, but not sure what this language feature is 
called.

On Friday, August 25, 2017 at 1:54:38 PM UTC-4, David Karr wrote:
>
> You likely need to reference "myFunc.myDerp" instead. 
>
> On Fri, Aug 25, 2017 at 10:33 AM, red 888 <fakemai...@gmail.com 
> > wrote: 
> > Im not sure if this is a groovy thing or a jenkins shared library DSL 
> thing 
> > but I don't understand how this automatic getter setter stuff works. 
> > 
> > I have this shared lib: 
> > /vars/myFunc.groovy 
> > 
> > I have this in it: 
> > def getDerp() { return something } 
> > def getHerp() { return something } 
> > 
> > Now in my jenkinsfile I can reference it like this: 
> > echo myFunc.derp 
> > echo myFunc.herp 
> > 
> > But I tried naming my methods like this: 
> > def getMyDerp() { return something } 
> > def getMyHerp() { return something } 
> > 
> > Now in my jenkinsfile I tried to do this: 
> > echo myFunc.myderp 
> > echo myFunc.myherp 
> > 
> > But that didn't work. 
> > 
> > I'm just curious how this works and if its possible to do method names 
> like 
> > getExtraHumps. 
> > 
> > 
> > -- 
> > 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/96c6a471-a94c-4fc8-b3a8-d9ea95f26be4%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/6a901e11-309c-4cba-b3a9-1f3ef274280f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Method names for getters/setters in pipeline shared libraries

2017-08-25 Thread red 888
Im not sure if this is a groovy thing or a jenkins shared library DSL thing 
but I don't understand how this automatic getter setter stuff works.

I have this shared lib:
/vars/myFunc.groovy

I have this in it:
def getDerp() { return something }
def getHerp() { return something }

Now in my jenkinsfile I can reference it like this:
echo myFunc.derp
echo myFunc.herp

But I tried naming my methods like this:
def getMyDerp() { return something }
def getMyHerp() { return something }

Now in my jenkinsfile I tried to do this:
echo myFunc.myderp
echo myFunc.myherp

But that didn't work.

I'm just curious how this works and if its possible to do method names like 
getExtraHumps.


-- 
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/96c6a471-a94c-4fc8-b3a8-d9ea95f26be4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to safe guard against broken jenkinsfiles causing pipelines to run indefinitely?

2017-08-25 Thread red 888
I have my repo getting polled every 5 mins.

But I found that if the jenkinsfile is totally broken the pipeline will 
fail with "This stage has no steps".

Then every 5 mins it will retry it and keep failing.

How do I safe guard against this? Can I set a threshold somewhere so if 
this happens it doesn't churn forever?

-- 
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/3d788f3a-2764-4756-9b66-e22c600e2029%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins shared library for pipelines “No such property”

2017-08-25 Thread red 888
This is working for me now, I think the issue was that my groovy file under 
/var/ was not camel case so it wasn't finding it (locally it was camel case 
but my source control didn't pick up the rename because it used to be name 
MyTest.groovy).

On Friday, August 25, 2017 at 11:14:30 AM UTC-4, Mark Waite wrote:
>
> Maybe you need a "return this" at the end of the groovy file (as in 
> https://github.com/docker/jenkins-pipeline-scripts/blob/master/src/com/docker/utilities/AWSSync.groovy
> )?
>
> On Fri, Aug 25, 2017 at 9:08 AM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> Im trying to wrap my head around shared libraries (with descriptive not 
>> scripted pipelines) and I'm not sure how I should be doing this.
>>
>> Right now I have this in my jenkinsfile:
>>
>> def Storeinvar = powershell (
>> script: '$PSVersionTable.PSVersion.major',
>> returnStdout: true)
>>
>> So I'm shelling out, running some command, and storing the result of that 
>> command in a var.
>>
>> I want to put that in a shared library and call it anywhere in my 
>> jenkinsfile.
>>
>> I created a file in my library: /var/myTest.groovy I put this in it to 
>> test:
>>
>> def methA(body) {
>>  return 'FROM LIBRARY'}def methB(body) {
>>  return 'FROM LIBRARY'}
>>
>> In my jenkinsfile i call them like this:
>>
>> echo gitInfo.methA()
>> echo gitInfo.methB()
>>
>> But i get this error:
>>
>> groovy.lang.MissingPropertyException: No such property: myTest for class: 
>> groovy.lang.Binding
>>
>>
>> -- 
>> 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/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/9c8f9665-b751-4e03-a47b-d84007126d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins shared library for pipelines “No such property”

2017-08-25 Thread red 888


Im trying to wrap my head around shared libraries (with descriptive not 
scripted pipelines) and I'm not sure how I should be doing this.

Right now I have this in my jenkinsfile:

def Storeinvar = powershell (
script: '$PSVersionTable.PSVersion.major',
returnStdout: true)

So I'm shelling out, running some command, and storing the result of that 
command in a var.

I want to put that in a shared library and call it anywhere in my 
jenkinsfile.

I created a file in my library: /var/myTest.groovy I put this in it to test:

def methA(body) {
 return 'FROM LIBRARY'}def methB(body) {
 return 'FROM LIBRARY'}

In my jenkinsfile i call them like this:

echo gitInfo.methA()
echo gitInfo.methB()

But i get this error:

groovy.lang.MissingPropertyException: No such property: myTest for class: 
groovy.lang.Binding


-- 
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/cbd9d243-ee34-4cd4-89b8-8def41fdfa77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why do some plugins/classes not show up in the Pipeline Syntax snippet generator?

2017-08-20 Thread red 888
So I'm dumb I can see the xunit plugin under the "step: General Build 
Step". Still confused why some plugins use this and some don't. For 
example cleanWs doesn't use step but wsCleanup does and they seem to do the 
exact same thing?

On Sunday, August 20, 2017 at 1:00:00 PM UTC-4, red 888 wrote:
>
> I noticed the xunit plugin and wscleanup don't appear in the Sample Step 
> drop down of the snippet generator.
>
> This is how I use them in my jenkinsfile:
>
> step([$class: 'WsCleanup'])
>
>
> step([$class : 'XUnitPublisher',
>> testTimeMargin: '3000',
>> thresholdMode: 1,
>> thresholds: [
>> [$class: 'FailedThreshold', failureNewThreshold: '', 
>> failureThreshold:'2', unstableNewThreshold: '', unstableThreshold: '']
>> ],
>> tools : [[$class: 'MSTestJunitHudsonTestType',
>> deleteOutputFiles: true,
>> failIfNotNew: false,
>> pattern: "\\TestResults\\*.trx",
>> skipNoTestFiles: false,
>> stopProcessingIfError: true
>> ]]
>> ])
>
>
> Does this have something to do with the fact that they are called with 
> step()? Im not really even sure what step() is or why its necessary for 
> them to work. Is this because they don't actually have 100% declarative 
> pipeline support yet?
>
>

-- 
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/18d4bdf9-fee3-47c9-b2de-b765d05e1213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Why do some plugins/classes not show up in the Pipeline Syntax snippet generator?

2017-08-20 Thread red 888
I noticed the xunit plugin and wscleanup don't appear in the Sample Step 
drop down of the snippet generator.

This is how I use them in my jenkinsfile:

step([$class: 'WsCleanup'])


step([$class : 'XUnitPublisher',
> testTimeMargin: '3000',
> thresholdMode: 1,
> thresholds: [
> [$class: 'FailedThreshold', failureNewThreshold: '', 
> failureThreshold:'2', unstableNewThreshold: '', unstableThreshold: '']
> ],
> tools : [[$class: 'MSTestJunitHudsonTestType',
> deleteOutputFiles: true,
> failIfNotNew: false,
> pattern: "\\TestResults\\*.trx",
> skipNoTestFiles: false,
> stopProcessingIfError: true
> ]]
> ])


Does this have something to do with the fact that they are called with 
step()? Im not really even sure what step() is or why its necessary for 
them to work. Is this because they don't actually have 100% declarative 
pipeline support yet?

-- 
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/7f807d23-7867-488d-bfc6-a709515dc276%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I organize stuff in blueocean- views? folders?

2017-08-18 Thread red 888
Right now my blueocean is just a big list of ALL my projects on the same 
page, how do I organize them? I'd like to have different tabs or something 
to break them up by team at least.

I haven't seen any examples of how to do this. In old jenkins there are 
folders and views for this.

-- 
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/6d288191-4d69-42ec-bb95-7c3867b01782%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins pipeline post actions not working

2017-08-17 Thread red 888
Actually I think understand this design decision now. its kind of useful to 
have a "hidden" step that cleans up or does other stuff you don't want 
users to see. As log as its output is visible in the old view I think thats 
enough for me.

On Thursday, August 17, 2017 at 9:28:47 AM UTC-4, Baptiste Mathus wrote:
>
> Blue Ocean will show/organize things per stage. And post-actions don't 
> generate automatically a bullet/stage, hence is not shown. But I agree it 
> probably should. You should file an issue for it, I think the team can 
> consider this improvement, if not already possibly filed/planned.
>  
> Le 16 août 2017 19:54, "red 888" <fakemai...@gmail.com > a 
> écrit :
>
>> I setup a post action like in the examples:
>>
>>
>> pipeline {
>> agent any
>> stages {
>> stage('Example1') {
>> steps {
>> bat 'return 1'
>> }
>> stage('Example2') {
>> steps {
>> echo 'Wont see this'
>> }
>> }
>> }
>> post { 
>> always { 
>> echo 'I will always say Hello'
>> }
>> }
>> }
>>
>>
>> So I do something in the first stage to make it fail. And I have a post 
>> action that always runs, but what happens when I run my pipeline in 
>> blueocean is it fails at the first stage and then just stops. Where do I 
>> see the post action that is always supposed to run??
>>
>> -- 
>> 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/588af3d5-1d9b-4bde-a8fe-e922f944%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/588af3d5-1d9b-4bde-a8fe-e922f944%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/c8de0b57-f509-40f1-a600-63bd0bd41108%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone know if the MSTest plugin supports pipelines and howto use it in a pipeline (jenkinsfile)?

2017-08-17 Thread red 888
Yes the xunit plugin is great! thats what I'm using now. As you say I still 
use an MS test runner exe which generates a trx and then point the xunit 
plugin to that report and it does everything else.

On Wednesday, August 16, 2017 at 8:31:39 AM UTC-4, Daniel Butler wrote:
>
> The XUnit plugin has support for MSTest output and is pipeline compatible.
>
> You’d still need to run MSTest from a bat/powershell command but the Xunit 
> plugin will publish the test output.
>
>  
>
>  
>
> *From: *jer...@bodycad.com 
> *Sent: *16 August 2017 13:24
> *To: *Jenkins Users 
> *Subject: *Re: Does anyone know if the MSTest plugin supports pipelines 
> and howto use it in a pipeline (jenkinsfile)?
>
>  
>
> Sadly no, many puglin are still incompatible, you can see the 
> compatibility list here: 
>
> https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md
>
>  
>
> Since the .trx is just an xml file, you could try to do an .xslt file that 
> do the convertion to junit .xml. Maybe someone already did it somewhere, 
> worth googling, I known some people have done .trx to .html graph (which 
> you could use and publish the html results too).
>
> -- 
> 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/75edf196-1d55-4bca-b0df-e0025e837f28%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/d8cdb00e-53e2-4efa-b4d1-dab9a680aa9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I get the name of the pipeline from inside the jenkinsfile

2017-08-17 Thread red 888


*env.JOB_NAME* Is the pipeline name suffixed with the branch name.


So *env.JOB_NAME* will be _


How can I just get the pipeline name and store it in a var in the 
environment{} block at the top of my jenkinsfile to use through the file?

I don't want to resort to scripted pipeline just the declarative.

-- 
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/238f1f2e-7ea5-42ab-b907-81cd7c0ca876%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins pipeline post actions not working

2017-08-16 Thread red 888
So if I look at it from old jenkins view I can actually see it under the 
"Stage View" as "Declarative: Post Actions". But how do I view the 
Declarative: Post Actions in Blue Ocean?

On Wednesday, August 16, 2017 at 1:54:27 PM UTC-4, red 888 wrote:
>
> I setup a post action like in the examples:
>
>
> pipeline {
> agent any
> stages {
> stage('Example1') {
> steps {
> bat 'return 1'
> }
> stage('Example2') {
> steps {
> echo 'Wont see this'
> }
> }
> }
> post { 
> always { 
> echo 'I will always say Hello'
> }
> }
> }
>
>
> So I do something in the first stage to make it fail. And I have a post 
> action that always runs, but what happens when I run my pipeline in 
> blueocean is it fails at the first stage and then just stops. Where do I 
> see the post action that is always supposed to run??
>

-- 
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/0d9c5d75-cfd2-4173-93f9-e15ba5463e75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jenkins pipeline post actions not working

2017-08-16 Thread red 888


I setup a post action like in the examples:


pipeline {
agent any
stages {
stage('Example1') {
steps {
bat 'return 1'
}
stage('Example2') {
steps {
echo 'Wont see this'
}
}
}
post { 
always { 
echo 'I will always say Hello'
}
}
}


So I do something in the first stage to make it fail. And I have a post 
action that always runs, but what happens when I run my pipeline in 
blueocean is it fails at the first stage and then just stops. Where do I 
see the post action that is always supposed to run??

-- 
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/588af3d5-1d9b-4bde-a8fe-e922f944%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


What is the difference between step vs steps in jenkinsfile?

2017-08-16 Thread red 888


I'm trying to run xunit and I keep seeing examples with only "step" like 
this:


step([$class : 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1,
thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: 
'', unstableNewThreshold: '', unstableThreshold: '0'],
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: 
'', unstableNewThreshold: '', unstableThreshold: '']
 ],
tools : [[$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, 
failIfNotNew: false, pattern: "TestResults\\*.trx", skipNoTestFiles: false, 
stopProcessingIfError: true]]])


But I want to run multiple "steps" inside a stage. I don't understand step 
vs steps.


For example this isn't working:

stage('Test') {
steps {
bat "\"${tool 'VSTestRunner'}\" 
%WORKSPACE%\\MyApp\\bin\\Debug\\MyAppTest.dll /logger:trx",
step([$class : 'XUnitPublisher',
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', 
failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'],
[$class: 'SkippedThreshold', failureNewThreshold: '', 
failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
],
tools : [[$class: 'MSTestJunitHudsonTestType',
deleteOutputFiles: true,
failIfNotNew: false,
pattern: "TestResults\\*.trx",
skipNoTestFiles: false,
stopProcessingIfError: true
]]
])
}}

-- 
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/816d8b86-f2f2-470b-b95f-eb2c807d6d1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does anyone know if the MSTest plugin supports pipelines and how to use it in a pipeline (jenkinsfile)?

2017-08-15 Thread red 888
Is there a way I could refer to the plugin directly via a bat command? Is 
there any way to call it directly even if it doesn't implement the pipeline 
methods? aren't plugin just groovy scripts?

On Tuesday, August 15, 2017 at 11:24:18 AM UTC-4, slide wrote:
>
> From looking at the source, it doesn't look like you can use mstest in 
> pipeline right now. It doesn't implement SimpleBuildStep, so it relies on 
> AbstractBuild, which is not what pipeline jobs use as a base class for a 
> build. 
>
> On Tue, Aug 15, 2017 at 8:12 AM red 888 <fakemai...@gmail.com 
> > wrote:
>
>> I have my test runner configured and its generating a trx file, now I 
>> want to use the MSTest plugin to read it: 
>> https://wiki.jenkins.io/display/JENKINS/MSTest+Plugin
>>
>> But I don't know how to refer to it in a pipeline (Jenkinsfile). Does 
>> this plugin support jenkinsfile? Is there a way to use plugins in a 
>> jenkinsfile even if they don't support it explicitly?
>>
>> -- 
>> 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/beb7b643-6da5-4e72-9771-da860fbb8f34%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/beb7b643-6da5-4e72-9771-da860fbb8f34%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/0e360ad0-9334-4cb6-a317-672103b5cc69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does anyone know if the MSTest plugin supports pipelines and how to use it in a pipeline (jenkinsfile)?

2017-08-15 Thread red 888
I have my test runner configured and its generating a trx file, now I want 
to use the MSTest plugin to read 
it: https://wiki.jenkins.io/display/JENKINS/MSTest+Plugin

But I don't know how to refer to it in a pipeline (Jenkinsfile). Does this 
plugin support jenkinsfile? Is there a way to use plugins in a jenkinsfile 
even if they don't support it explicitly?

-- 
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/beb7b643-6da5-4e72-9771-da860fbb8f34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't install Jenkins plugins with the cli

2016-10-30 Thread red 888
Hmm how could make this change non-interactively? Via the command line or 
through editing a config file?

On Sunday, October 30, 2016 at 3:55:57 AM UTC-4, Daniel Beck wrote:
>
> Enable the JNLP port in Manage Jenkins » Configure Global Security, or 
> wait for 2.19.2 (which should be released any day now). 
>
> > On 30.10.2016, at 03:48, red 888 <fakemai...@gmail.com > 
> wrote: 
> > 
> > Running Server 2012 R2, Jenkins ver. 2.19.1 
> > 
> > 
> > 
> > Installed Jenkins via the Windows MSI 
> > 
> > 
> > 
> > I can't seem to install plugins with the cli: 
> > 
> > & 'C:\Program Files (x86)\Jenkins\jre\bin\java.exe' -jar 'C:\Program 
> Files (x86)\Jenkins\war\WEB-INF\jenkins-cli.jar' -s '
> http://localhost:8080/' install-plugin '
> http://updates.jenkins-ci.org/download/plugins/aws-la 
> > mbda/0.5.5/aws-lambda.hpi' 
> > 
> > java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, 
> Server, X-Content-Type-Options, X-You-Are-In-Group, X-Hudson, Date, 
> X-Jenkins-Session, X-You-Are-Authenticated-As, X-Required-Permission, 
> Set-Cookie, Expires, Content-Length, Content 
> > -Type] 
> > at hudson.cli.CLI.getCliTcpPort(CLI.java:284) 
> > at hudson.cli.CLI.(CLI.java:128) 
> > at 
> hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72) 
> > at hudson.cli.CLI._main(CLI.java:473) 
> > at hudson.cli.CLI.main(CLI.java:384) 
> > Suppressed: java.io.IOException: Server returned HTTP response 
> code: 403 for URL: http://localhost:8080/cli 
> > at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) 
> > at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 
> > at 
> hudson.cli.FullDuplexHttpStream.(FullDuplexHttpStream.java:78) 
> > at hudson.cli.CLI.connectViaHttp(CLI.java:152) 
> > at hudson.cli.CLI.(CLI.java:132) 
> > ... 3 more 
> > 
> > 
> > 
> > I also tried it with -name aws-lambda and just aws-lambda at the end, 
> but did not work 
> > 
> > 
> > -- 
> > 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/02580ca6-829d-473b-908d-0827c1f71bdc%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/d6dd730d-d557-4c9f-96c7-3025a839e0d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can't install Jenkins plugins with the cli

2016-10-29 Thread red 888


Running Server 2012 R2, Jenkins ver. 2.19.1


Installed Jenkins via the Windows MSI


I can't seem to install plugins with the cli:

& 'C:\Program Files (x86)\Jenkins\jre\bin\java.exe' -jar 'C:\Program Files 
(x86)\Jenkins\war\WEB-INF\jenkins-cli.jar' -s 'http://localhost:8080/' 
install-plugin 'http://updates.jenkins-ci.org/download/plugins/aws-la
mbda/0.5.5/aws-lambda.hpi'

java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, Server, 
X-Content-Type-Options, X-You-Are-In-Group, X-Hudson, Date, X-Jenkins-Session, 
X-You-Are-Authenticated-As, X-Required-Permission, Set-Cookie, Expires, 
Content-Length, Content
-Type]
at hudson.cli.CLI.getCliTcpPort(CLI.java:284)
at hudson.cli.CLI.(CLI.java:128)
at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
at hudson.cli.CLI._main(CLI.java:473)
at hudson.cli.CLI.main(CLI.java:384)
Suppressed: java.io.IOException: Server returned HTTP response code: 
403 for URL: http://localhost:8080/cli
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at 
hudson.cli.FullDuplexHttpStream.(FullDuplexHttpStream.java:78)
at hudson.cli.CLI.connectViaHttp(CLI.java:152)
at hudson.cli.CLI.(CLI.java:132)
... 3 more


I also tried it with -name aws-lambda and just aws-lambda at the end, but 
did not work

-- 
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/02580ca6-829d-473b-908d-0827c1f71bdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins won't run Start-Job with Credential parameter

2016-09-11 Thread red 888


I pass in credentials to the script via the env injector (note this works 
for me with invoke-command) and try to run start-job but jenkins doesn't 
like it:

$user = $ENV:user
$pass = $ENV:pass

write-output (cat env:username)
write-output (cat env:user)
write-output (cat env:pass)

$pass  = $pass | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential `
  -ArgumentList ($user), $pass

Start-Job -Credential $cred -ScriptBlock {'test'}

write-output (get-job | Receive-Job)
get-job | remove-job

This is the error I get (confirmed username and password are correct, when 
I run this script from the console with the same creds it works)

Started by user ME

[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\jobs\myjob\workspace
[workspace] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 
'C:\Windows\TEMP\hudson1723222179976241861.ps1'"
MYJENKINSSRV$
correctdomain\correctuser
correctPassword

Id NamePSJobTypeName   State HasMoreData Location  
-- -   - ---   
1  Job1BackgroundJob   FailedFalse   localhost 
[localhost] An error occurred while starting the background process. Error 
reported: Access is denied.
+ CategoryInfo  : OpenError: (localhost:String) [], PSRemotingTran 
   sportException
+ FullyQualifiedErrorId : -2147467259,PSSessionStateBroken


Finished: SUCCESS

-- 
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/d663fe7f-2f4f-4637-98a5-54faf41aac77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.