Re: SSHing to linux server from Jenkins windows and execute a command

2018-02-13 Thread groupfiles14
Any one here knows how to proceed with this?

On Tuesday, February 13, 2018 at 5:45:07 PM UTC+5:30, groupf...@gmail.com 
wrote:
>
> Hello,
> i am new to jenkins and i would like to SSH to linux server from 
> Jenkins hosted on windows and execute a command over in linux machine, i 
> tried installing publish over ssh plugin and tested the connection and it 
> works fine, i dont know how to proceed next in pipeline. Any help would be 
> appreciated
>

-- 
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/40e17363-f93a-4f94-8826-81fc78b1869d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dollar sign in credentials broken for declarative pipelines

2018-02-13 Thread niristotle okram
I just had this a couple of days back in a shell script. I had to place the
password string (which have the $) within a quote.

But can we put the quotes in the password field of the jenkins credentials
page, wont it not treat the quote as a part of the password string? I
haven’t tested it though.



On Tue, Feb 13, 2018 at 10:50 PM 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  wrote:
>
>> Can you file an issue in JIRA?
>>
>> On Tue, Feb 13, 2018 at 7:10 PM red 888  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-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.
>>>
>> --
>> 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/CAPiUgVf9g8GN2BPSGdt9jSR1t%2Bj7%2BzoC%2B711cPQzOO1duu6WYQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGpVxCy1LzOh2KATKNktvnWCYUDEzRnXeQyjN3VAW0iDA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from mobile device, excuse typos if any.

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


Re: Dollar sign in credentials broken for declarative pipelines

2018-02-13 Thread Mark Waite
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  wrote:

> Can you file an issue in JIRA?
>
> On Tue, Feb 13, 2018 at 7:10 PM red 888  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-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.
>>
> --
> 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/CAPiUgVf9g8GN2BPSGdt9jSR1t%2Bj7%2BzoC%2B711cPQzOO1duu6WYQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGpVxCy1LzOh2KATKNktvnWCYUDEzRnXeQyjN3VAW0iDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dollar sign in credentials broken for declarative pipelines

2018-02-13 Thread Slide
Can you file an issue in JIRA?

On Tue, Feb 13, 2018 at 7:10 PM red 888  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-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.
>

-- 
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/CAPiUgVf9g8GN2BPSGdt9jSR1t%2Bj7%2BzoC%2B711cPQzOO1duu6WYQ%40mail.gmail.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.


Too many jobs running on GitHub push with master/slaves setup

2018-02-13 Thread Guillaume Smet
Hi,

First, let me give some context:
- We use Jenkins for the CI of the Hibernate projects.
- We have a master/slaves setup on AWS with slaves being terminated when 
they don't have anything to do so slaves come and go and we can't count on 
them.
- It's a rather new setup as we used a couple of persistent slaves before.

Lately, we have seen that when we push something to a given GitHub branch, 
all the jobs targeting this repository are launched even if they target a 
completely different branch and there are no changes at all in this branch. 
This results in a lot of useless jobs running.

>From https://issues.jenkins-ci.org/browse/JENKINS-42161 and 
https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java#L79
 
, we concluded that polling is run for all the jobs targeting a given 
repository URL so polling would be run for all branches and the jobs are 
created only if the polling returns that there are some changes.

Based on this, we think that in our setup, polling probably doesn't work as 
expected but we don't really know how it works in a master/slaves setup.

We have a couple of questions:
- does the master use the workspace dirs of the slaves for polling?
- is the polling run on the slaves instead of the master (i.e. do we need 
to start a slave to run the polling and if so how does it choose the right 
one)?
- is there a way we could get our setup working? Maybe by copying the 
workspace dirs to the master and have the polling run on these copied 
directories?

I suspect we are not alone with this kind of setup so any idea/workaround 
welcome!

Thanks!

-- 
Guillaume


-- 
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/9d7e13ef-d267-4d34-8006-dad599d37027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline: no branch checkout

2018-02-13 Thread Sverre Moe
Branch RELEASE1 is built on SLES 11.3 which has installed git-1.7.12.4
Branch RELEASE2 is built on SLES 12.1 which has installed git-2.12.3

If I build branch RELEASE1 on the build slave for SLES 12.1 then checkout 
works as expected.
Seems git version 1.7 has either a limitation or bug.

tirsdag 13. februar 2018 13.56.23 UTC+1 skrev Sverre Moe følgende:
>
> Multibranch Pipeline
>
> Branch:RELEASE2
> [Pipeline] checkout
> Cloning the remote Git repository
> Cloning with configured refspecs honoured and without tags
> Cloning repository ssh://g...@git.company.com/domain/projectA.git
>  > git init 
> /home/build/jenkins/workspace/projectA_RELEASE2-UTQNYKNJI6D4OV7ZUB2JGUXFXF4YDXHJX4HEHXPHDDEIT5DI5S3Q
>  
> # timeout=10
> Fetching upstream changes from ssh://
> g...@git.company.com/domain/projectA.git
>  > git --version # timeout=10
>  > git fetch --no-tags --progress ssh://
> g...@git.company.com/domain/projectA.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://
> g...@git.company.com/domain/projectA.git # timeout=10
>  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
> # timeout=10
>  > git config remote.origin.url ssh://
> g...@git.company.com/domain/projectA.git # timeout=10
> Fetching without tags
> Fetching upstream changes from ssh://
> g...@git.company.com/domain/projectA.git
>  > git fetch --no-tags --progress ssh://
> g...@git.company.com/domain/projectA.git 
> +refs/heads/*:refs/remotes/origin/*
> Checking out Revision a375d22458d6954e7b0e8a8a13dc34b15e413e08 (RELEASE2)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f a375d22458d6954e7b0e8a8a13dc34b15e413e08
> Commit message: "Release 2.0"
>  > git rev-list --no-walk a375d22458d6954e7b0e8a8a13dc34b15e413e08 # 
> timeout=10
>
> sh "git branch"
> Running shell script
> + git branch
> * (HEAD detached at a375d22)
>
>
> Branch: RELEASE1
> [Pipeline] checkout
> Cloning the remote Git repository
> Cloning with configured refspecs honoured and without tags
> Cloning repository ssh://g...@git.company.com/domain/projectA.git
>  > git init 
> /home/build/jenkins/workspace/projectA_RELEASE1-TE6AQRXIYTI74ERU56FAPKVNLHJ7LUP2YSP5CVHF3FVS2BJV5JUQ
>  
> # timeout=10
> Fetching upstream changes from ssh://
> g...@git.company.com/domain/projectA.git
>  > git --version # timeout=10
>  > git fetch --no-tags --progress ssh://
> g...@git.company.com/domain/projectA.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://
> g...@git.company.com/domain/projectA.git # timeout=10
>  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
> # timeout=10
>  > git config remote.origin.url ssh://
> g...@git.company.com/domain/projectA.git # timeout=10
> Fetching without tags
> Fetching upstream changes from ssh://
> g...@git.company.com/domain/projectA.git
>  > git fetch --no-tags --progress ssh://
> g...@git.company.com/domain/projectA.git 
> +refs/heads/*:refs/remotes/origin/*
> Checking out Revision 285c4f454b202d7b1859b1054e691c56487a7b98 
> (user/RELEASE1)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f 285c4f454b202d7b1859b1054e691c56487a7b98
> Commit message: "Add 'Jenkinsfile' for build automation"
>  > git rev-list --no-walk 285c4f454b202d7b1859b1054e691c56487a7b98 # 
> timeout=10
>
> sh "git branch"
> Running shell script
> + git branch
> * (no branch)
>
>
> Running git branch should not output (no branch) on RELEASE1, but instead 
> (HEAD detached at 285c4f4).
>
> It is the same pipeline build script and Jenkinsfile for both branches. 
> Anyone know what the problem here is?
>
> The branch RELEASE1 was created from a git tag RELEASE1_BP.
> To check I created a new branch from a RELEASE2 tag and that builds fine 
> on Jenkins. So not sure whats wrong with the RELEASE1 branch.
>
> This really has me quite perplexed.
>

-- 
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/f7d14c61-cdeb-4e43-a3c5-b56d00313434%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to keep a running docker container after a build fails?

2018-02-13 Thread pisymbol .
On Tue, Feb 13, 2018 at 7:56 AM, Reinhold Füreder 
wrote:

> Hi aps,
>
>
>
> Just in case the problem is still there and to avoid a misunderstanding:
>
>
>
> Based on (a) Victor’s hint “tr[y] with the docker.inside syntax […] It
> might give you the chance to debug it somehow.” and (b) your own comment
> “I'm really surprised you can't pause the build”:
>
>
>
> docker.image(…).inside(…) {
>
>   sh ‘’
>
>
>
>   // And now “workaround” to pause the build to allow connecting to the
> still running Docker container:
>
>   input(message: "Continue?")
>
> }
>
>
>
> Due to the “input” step the pipeline is then pausing and allows you to
> e.g.:
>
>
>
> ...@jenkins:...$ docker ps -a
>
> CONTAINER IDIMAGE   COMMAND
> CREATED STATUS  PORTS   NAMES
>
> 51c00502c727acme/...:5"cat"   20 seconds ago
> Up 20 seconds   zealous_thompson
>
> ...@jenkins:...$ docker exec -it 51c00502c727 /bin/bash
>
> jenkins@51c00502c727:$ # Now you are in the running
> Docker container…
>
>
>
> HTH Reinhold
>
>
>

Thanks! That is a neat idea. A bit of a hack, but definitely does the
trick. I actually wound up exec'ing into the container as the pipeline was
running.

-aps

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


Multibranch Pipeline: no branch checkout

2018-02-13 Thread Sverre Moe
Multibranch Pipeline

Branch:RELEASE2
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository ssh://g...@git.company.com/domain/projectA.git
 > git init 
 > /home/build/jenkins/workspace/projectA_RELEASE2-UTQNYKNJI6D4OV7ZUB2JGUXFXF4YDXHJX4HEHXPHDDEIT5DI5S3Q
 >  
# timeout=10
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git --version # timeout=10
 > git fetch --no-tags --progress 
 > ssh://g...@git.company.com/domain/projectA.git 
+refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git 
# timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
# timeout=10
 > git config remote.origin.url 
ssh://g...@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git fetch --no-tags --progress 
ssh://g...@git.company.com/domain/projectA.git 
+refs/heads/*:refs/remotes/origin/*
Checking out Revision a375d22458d6954e7b0e8a8a13dc34b15e413e08 (RELEASE2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f a375d22458d6954e7b0e8a8a13dc34b15e413e08
Commit message: "Release 2.0"
 > git rev-list --no-walk a375d22458d6954e7b0e8a8a13dc34b15e413e08 # 
timeout=10

sh "git branch"
Running shell script
+ git branch
* (HEAD detached at a375d22)


Branch: RELEASE1
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository ssh://g...@git.company.com/domain/projectA.git
 > git init 
 > /home/build/jenkins/workspace/projectA_RELEASE1-TE6AQRXIYTI74ERU56FAPKVNLHJ7LUP2YSP5CVHF3FVS2BJV5JUQ
 >  
# timeout=10
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git --version # timeout=10
 > git fetch --no-tags --progress 
 > ssh://g...@git.company.com/domain/projectA.git 
+refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git 
# timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* 
# timeout=10
 > git config remote.origin.url 
ssh://g...@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git fetch --no-tags --progress 
ssh://g...@git.company.com/domain/projectA.git 
+refs/heads/*:refs/remotes/origin/*
Checking out Revision 285c4f454b202d7b1859b1054e691c56487a7b98 
(user/RELEASE1)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 285c4f454b202d7b1859b1054e691c56487a7b98
Commit message: "Add 'Jenkinsfile' for build automation"
 > git rev-list --no-walk 285c4f454b202d7b1859b1054e691c56487a7b98 # 
timeout=10

sh "git branch"
Running shell script
+ git branch
* (no branch)


Running git branch should not output (no branch) on RELEASE1, but instead 
(HEAD detached at 285c4f4).

It is the same pipeline build script and Jenkinsfile for both branches. 
Anyone know what the problem here is?

The branch RELEASE1 was created from a git tag RELEASE1_BP.
To check I created a new branch from a RELEASE2 tag and that builds fine on 
Jenkins. So not sure whats wrong with the RELEASE1 branch.

This really has me quite perplexed.

-- 
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/43215476-f923-4cf2-b754-44c743ab3371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: How to keep a running docker container after a build fails?

2018-02-13 Thread Reinhold Füreder
Hi aps,

Just in case the problem is still there and to avoid a misunderstanding:

Based on (a) Victor’s hint “tr[y] with the docker.inside syntax […] It might 
give you the chance to debug it somehow.” and (b) your own comment “I'm really 
surprised you can't pause the build”:

docker.image(…).inside(…) {
  sh ‘’

  // And now “workaround” to pause the build to allow connecting to the still 
running Docker container:
  input(message: "Continue?")
}

Due to the “input” step the pipeline is then pausing and allows you to e.g.:

...@jenkins:...$ docker ps -a
CONTAINER IDIMAGE   COMMAND CREATED 
STATUS  PORTS   NAMES
51c00502c727acme/...:5"cat"   20 seconds ago  Up 20 
seconds   zealous_thompson
...@jenkins:...$ docker exec -it 51c00502c727 /bin/bash
jenkins@51c00502c727:$ # Now you are in the running Docker 
container…

HTH Reinhold

-- 
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/VI1P190MB0255001969FC97F8F4285795F7F60%40VI1P190MB0255.EURP190.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Connection EC2 instances from Jenkins

2018-02-13 Thread fvelascojgc
Hi,

I have some problems with Jenkins configuration.

I connect via SSH with Jenkins instance, and configure aws connection using 
command "aws configure". If I run the SSH command to stop a certain 
instance and it works perfectly.

I tried to do the same using jenkins dashboard, I have downloaded EC2 
plugin for Jenkins and configured with the same access and secret key used 
before, and even the private key (checked with "Test connection" as 
successful). Then I create a new task to execute the command that worked 
before and I get the error:

Unable to locate credentials. You can configure credentials by running "aws 
configure".


Does anyone have any idea?


Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d734c5f6-47f0-4ddc-835e-81a9e341bf7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SSHing to linux server from Jenkins windows and execute a command

2018-02-13 Thread groupfiles14
Hello,
i am new to jenkins and i would like to SSH to linux server from 
Jenkins hosted on windows and execute a command over in linux machine, i 
tried installing publish over ssh plugin and tested the connection and it 
works fine, i dont know how to proceed next in pipeline. Any help would be 
appreciated

-- 
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/7efb9760-b852-49cf-82fc-6a1853203175%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins slave offline

2018-02-13 Thread Nick Li
Could you share some notes about "configure Java in the jnlp agent docker"?
Not sure how to do this. Thanks a lot


On Tuesday, February 13, 2018 at 5:34:43 PM UTC+8, Carlos Sanchez wrote:
>
> > Caused by: javax.net.ssl.SSLHandshakeException: 
> java.security.cert.CertificateException: No subject alternative names 
> matching IP address MY_JENKINS_IP found
>
> If you don't use valid ssl certificates in the jenkins master you'll need 
> to configure Java in the jnlp agent docker, it has nothing to do with 
> kubernetes.
>
>
> https://stackoverflow.com/questions/8443081/how-are-ssl-certificate-server-names-resolved-can-i-add-alternative-names-using?lq=1
>
> unless you are hitting https://issues.jenkins-ci.org/browse/JENKINS-43527
>
>
>
> On Tue, Feb 13, 2018 at 8:33 AM, Nick Li  > wrote:
>
>> jenkins master is running outside of k8s cluster,
>> from the log, looks like slave created in k8s cluster can't connect to 
>> jenkins master.
>>
>> What do I need to do?
>>
>>
>> On Tuesday, February 13, 2018 at 3:08:46 PM UTC+8, Nick Li wrote:
>>>
>>> I running jenkins master outside or k8s cluster,
>>> After running the job, I can the pod is created and running, then turned 
>>> into terminated very soon,
>>> Looks ing slave created in k8s cluster can't connect to jenkins master.
>>>
>>> from JNLP container log I can see
>>>
>>> Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to 
>>> alter the behavior
>>> Warning: SECRET is defined twice in command-line arguments and the 
>>> environment variable
>>> Warning: AGENT_NAME is defined twice in command-line arguments and the 
>>> environment variable
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main createEngine
>>> INFO: Setting up agent: jenkins-slave-n58w4-bdvl7
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener 
>>> init
>>> INFO: Jenkins agent is running in headless mode.
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.Engine startEngine
>>> WARNING: No Working Directory. Using the legacy JAR Cache location: 
>>> /home/jenkins/.jenkins/cache/jars
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener status
>>> INFO: Locating server among [https://MY_JENKINS_IP/]
>>> Feb 13, 2018 7:02:04 AM hudson.remoting.jnlp.Main$CuiListener error
>>> SEVERE: Failed to connect to https://MY_JENKINS_IP/tcpSlaveAgentListener/: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> java.io.IOException: Failed to connect to 
>>> https://MY_JENKINS_IP/tcpSlaveAgentListener/: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> at 
>>> org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:199)
>>> at hudson.remoting.Engine.innerRun(Engine.java:518)
>>> at hudson.remoting.Engine.run(Engine.java:469)
>>> Caused by: javax.net.ssl.SSLHandshakeException: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
>>> at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
>>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
>>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
>>> at 
>>> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514)
>>> at 
>>> sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
>>> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
>>>
>>> On Friday, February 9, 2018 at 4:23:48 PM UTC+8, Nick Li wrote:

 jenkins-slave is offline (suspend) from jenkins webpage.

 My environment:
 I have jenkins running on a debian server, created a k8s cluster in 
 gcp. installed kubernetes-plugin, configed k8s in jenkins cloud 
 section,(using admin/k8s password.),

 Then created a test pipeline job using the following script
 ```
 podTemplate(label: 'pod-golang', 
 containers: [
 containerTemplate(
 name: 'golang',
 image: 'golang',
 ttyEnabled: true,
 command: 'cat'
 )
 ]
 ) {
 node ('pod-golang') {

 stage 'Switch to Utility Container'
 container('golang') {

   sh ("go version")

 }
 }
 }
 ```
 from `kubectl get pods` I can see the pod is created, but on jenkins 
 webpage, jenkins-slave is alwasy showing offline
 Any ideas

 Thanks

 -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> 

Re: jenkins slave offline

2018-02-13 Thread Nick Li
Thanks Carlos, I will check

On Tuesday, February 13, 2018 at 5:34:43 PM UTC+8, Carlos Sanchez wrote:
>
> > Caused by: javax.net.ssl.SSLHandshakeException: 
> java.security.cert.CertificateException: No subject alternative names 
> matching IP address MY_JENKINS_IP found
>
> If you don't use valid ssl certificates in the jenkins master you'll need 
> to configure Java in the jnlp agent docker, it has nothing to do with 
> kubernetes.
>
>
> https://stackoverflow.com/questions/8443081/how-are-ssl-certificate-server-names-resolved-can-i-add-alternative-names-using?lq=1
>
> unless you are hitting https://issues.jenkins-ci.org/browse/JENKINS-43527
>
>
>
> On Tue, Feb 13, 2018 at 8:33 AM, Nick Li  > wrote:
>
>> jenkins master is running outside of k8s cluster,
>> from the log, looks like slave created in k8s cluster can't connect to 
>> jenkins master.
>>
>> What do I need to do?
>>
>>
>> On Tuesday, February 13, 2018 at 3:08:46 PM UTC+8, Nick Li wrote:
>>>
>>> I running jenkins master outside or k8s cluster,
>>> After running the job, I can the pod is created and running, then turned 
>>> into terminated very soon,
>>> Looks ing slave created in k8s cluster can't connect to jenkins master.
>>>
>>> from JNLP container log I can see
>>>
>>> Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to 
>>> alter the behavior
>>> Warning: SECRET is defined twice in command-line arguments and the 
>>> environment variable
>>> Warning: AGENT_NAME is defined twice in command-line arguments and the 
>>> environment variable
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main createEngine
>>> INFO: Setting up agent: jenkins-slave-n58w4-bdvl7
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener 
>>> init
>>> INFO: Jenkins agent is running in headless mode.
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.Engine startEngine
>>> WARNING: No Working Directory. Using the legacy JAR Cache location: 
>>> /home/jenkins/.jenkins/cache/jars
>>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener status
>>> INFO: Locating server among [https://MY_JENKINS_IP/]
>>> Feb 13, 2018 7:02:04 AM hudson.remoting.jnlp.Main$CuiListener error
>>> SEVERE: Failed to connect to https://MY_JENKINS_IP/tcpSlaveAgentListener/: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> java.io.IOException: Failed to connect to 
>>> https://MY_JENKINS_IP/tcpSlaveAgentListener/: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> at 
>>> org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:199)
>>> at hudson.remoting.Engine.innerRun(Engine.java:518)
>>> at hudson.remoting.Engine.run(Engine.java:469)
>>> Caused by: javax.net.ssl.SSLHandshakeException: 
>>> java.security.cert.CertificateException: No subject alternative names 
>>> matching IP address MY_JENKINS_IP found
>>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
>>> at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
>>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
>>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
>>> at 
>>> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514)
>>> at 
>>> sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
>>> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
>>>
>>> On Friday, February 9, 2018 at 4:23:48 PM UTC+8, Nick Li wrote:

 jenkins-slave is offline (suspend) from jenkins webpage.

 My environment:
 I have jenkins running on a debian server, created a k8s cluster in 
 gcp. installed kubernetes-plugin, configed k8s in jenkins cloud 
 section,(using admin/k8s password.),

 Then created a test pipeline job using the following script
 ```
 podTemplate(label: 'pod-golang', 
 containers: [
 containerTemplate(
 name: 'golang',
 image: 'golang',
 ttyEnabled: true,
 command: 'cat'
 )
 ]
 ) {
 node ('pod-golang') {

 stage 'Switch to Utility Container'
 container('golang') {

   sh ("go version")

 }
 }
 }
 ```
 from `kubectl get pods` I can see the pod is created, but on jenkins 
 webpage, jenkins-slave is alwasy showing offline
 Any ideas

 Thanks

 -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/e58f2594-cec3-46df-9d51-f96c04493d0b%40googlegroups.com
>>  
>> 

Re: jenkins slave offline

2018-02-13 Thread Carlos Sanchez
> Caused by: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative names
matching IP address MY_JENKINS_IP found

If you don't use valid ssl certificates in the jenkins master you'll need
to configure Java in the jnlp agent docker, it has nothing to do with
kubernetes.

https://stackoverflow.com/questions/8443081/how-are-ssl-certificate-server-names-resolved-can-i-add-alternative-names-using?lq=1

unless you are hitting https://issues.jenkins-ci.org/browse/JENKINS-43527



On Tue, Feb 13, 2018 at 8:33 AM, Nick Li  wrote:

> jenkins master is running outside of k8s cluster,
> from the log, looks like slave created in k8s cluster can't connect to
> jenkins master.
>
> What do I need to do?
>
>
> On Tuesday, February 13, 2018 at 3:08:46 PM UTC+8, Nick Li wrote:
>>
>> I running jenkins master outside or k8s cluster,
>> After running the job, I can the pod is created and running, then turned
>> into terminated very soon,
>> Looks ing slave created in k8s cluster can't connect to jenkins master.
>>
>> from JNLP container log I can see
>>
>> Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to
>> alter the behavior
>> Warning: SECRET is defined twice in command-line arguments and the
>> environment variable
>> Warning: AGENT_NAME is defined twice in command-line arguments and the
>> environment variable
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main createEngine
>> INFO: Setting up agent: jenkins-slave-n58w4-bdvl7
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener
>> init
>> INFO: Jenkins agent is running in headless mode.
>> Feb 13, 2018 7:02:03 AM hudson.remoting.Engine startEngine
>> WARNING: No Working Directory. Using the legacy JAR Cache location:
>> /home/jenkins/.jenkins/cache/jars
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener status
>> INFO: Locating server among [https://MY_JENKINS_IP/]
>> Feb 13, 2018 7:02:04 AM hudson.remoting.jnlp.Main$CuiListener error
>> SEVERE: Failed to connect to https://MY_JENKINS_IP/tcpSlaveAgentListener/:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> java.io.IOException: Failed to connect to 
>> https://MY_JENKINS_IP/tcpSlaveAgentListener/:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.reso
>> lve(JnlpAgentEndpointResolver.java:199)
>> at hudson.remoting.Engine.innerRun(Engine.java:518)
>> at hudson.remoting.Engine.run(Engine.java:469)
>> Caused by: javax.net.ssl.SSLHandshakeException:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
>> at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
>> at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHa
>> ndshaker.java:1514)
>> at sun.security.ssl.ClientHandshaker.processMessage(ClientHands
>> haker.java:216)
>> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
>>
>> On Friday, February 9, 2018 at 4:23:48 PM UTC+8, Nick Li wrote:
>>>
>>> jenkins-slave is offline (suspend) from jenkins webpage.
>>>
>>> My environment:
>>> I have jenkins running on a debian server, created a k8s cluster in gcp.
>>> installed kubernetes-plugin, configed k8s in jenkins cloud section,(using
>>> admin/k8s password.),
>>>
>>> Then created a test pipeline job using the following script
>>> ```
>>> podTemplate(label: 'pod-golang',
>>> containers: [
>>> containerTemplate(
>>> name: 'golang',
>>> image: 'golang',
>>> ttyEnabled: true,
>>> command: 'cat'
>>> )
>>> ]
>>> ) {
>>> node ('pod-golang') {
>>>
>>> stage 'Switch to Utility Container'
>>> container('golang') {
>>>
>>>   sh ("go version")
>>>
>>> }
>>> }
>>> }
>>> ```
>>> from `kubectl get pods` I can see the pod is created, but on jenkins
>>> webpage, jenkins-slave is alwasy showing offline
>>> Any ideas
>>>
>>> Thanks
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/e58f2594-cec3-46df-9d51-f96c04493d0b%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to