Re: Jenkins - Mutlibranch pipeline

2022-04-15 Thread Jeremy Mordkoff
If you use the GUI, the scan interval for new branches is under Scan 
Multibranch Pipeline Triggers and the orphan item setting is right after it.

On Thursday, April 14, 2022 at 5:02:50 PM UTC-4 nhoj.p...@gmail.com wrote:

> So I've changed mine to 7 days, which I've done using the groovy script 
> that created/configures the pipeline.
> e.g.
> multibranchPipelineJob(...) {
>   ..
>   orphanedItemStrategy {
> discardOldItems {
>   daysToKeep(7) // how long before dead branch build is deleted
> }
>   }
>   ..
> }
>
> I think the default is 30 days.
>
> Hope that helps.
> John
>
>
> On Thu, 14 Apr 2022 at 21:46, Madhu Muchukota  wrote:
>
>> Hi Team - We are using a Multibranch pipeline with GIT branch source. 
>> When ever we delete a branch in the Project repository, we see that this 
>> branch is being showed as strike-through. How long it will be shown as 
>> strike-through and when it will get deleted completely from Jenkins UI?
>>
>> Also when ever we create a new branch in Project repository, we see that 
>> in Jenkins. What is notifying Jenkins about this new branch ? If it is any 
>> poller/scanner, how frequently it looks for these updates/creates
>>
>> 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/3422692a-49de-4c9b-80bf-9ab05b4ebe2en%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/da9563fa-546e-4af3-ab60-7b0fc4802907n%40googlegroups.com.


nested each

2022-02-04 Thread Jeremy Mordkoff
what's wrong with this code? The output from it was


[Pipeline] 
echo<http://jenkins2.eng.riftio.com/view/My%20Builds/job/platform_build/job/master/55/console#>
[modules/core/rwvx, modules/automation/core, modules/tools/scripts, 
modules/toolchain, modules/tools/CI, modules/core/util, modules/im/platform]
[Pipeline] 
echo<http://jenkins2.eng.riftio.com/view/My%20Builds/job/platform_build/job/master/55/console#>
(modules/core/rwvx|modules/automation/core|modules/tools/scripts|modules/toolchain|modules/tools/CI|modules/core/util|modules/im/platform).*
[Pipeline] 
echo<http://jenkins2.eng.riftio.com/view/My%20Builds/job/platform_build/job/master/55/console#>
file: "modules/im/platform"
[Pipeline] 
echo<http://jenkins2.eng.riftio.com/view/My%20Builds/job/platform_build/job/master/55/console#>
interesting submodule change: modules/im/platform
[Pipeline] 
echo<http://jenkins2.eng.riftio.com/view/My%20Builds/job/platform_build/job/master/55/console#>
no interesting commits found.


which implies that the "return true" was ignored



def interesting_commit_check(topmodule) {
// returns true if any interesting commits are found
modules=get_dependency_list(topmodule)
modules_re = "(" + modules.join('|') + ").*"
println("${modules_re}")
currentBuild.changeSets.each {
it.items.each {
it.affectedFiles.each {
pth = it.getPath()
println("file: \"${pth}\"")
if (it.getPath().matches('^modules.*')) {
// in a submodule ... is it an important one?
if (pth.matches(modules_re)) {
print("interesting submodule change: ${pth}")
return true
} else {
print("ignoring submodule change in ${pth}")
}
} else {
if ( pth == "RELEASE" ) {
println("ignoring release change")
} else {
print("ignoring supermod change: ${pth}")
}
}
}
}
}
print("no interesting commits found.")
return false
}

Jeremy Mordkoff
Director, Engineering Services
[cid:51242143-30d0-4a25-baf0-3f43dda0987e]<https://dzsi.com>
Headquarters: 5700 Tennyson Parkway, Plano, Texas, USA
Mobile: +1 978.257.2183
Email: jeremy.mordk...@dzsi.com

[cid:336fa83f-8e36-4eb8-ab7e-4ec2f11819bb]<https://dzsi.com>

[cid:e312d5dc-1a1a-4fff-b59e-2f943738876a]<https://www.linkedin.com/company/dzsi/>[cid:b3e6cf9e-3009-4ee6-8bc8-6a809306021f]<https://twitter.com/dzs_innovation>[cid:19080cb4-197b-432a-97f6-35ab31f475de]<https://www.youtube.com/channel/UCgr0fSzluyi0QYaoDgHhkBg>

Disclaimer

The information contained in this communication from the sender is 
confidential. It is intended solely for use by the recipient and others 
authorized to receive it. If you are not the recipient, you are hereby notified 
that any disclosure, copying, distribution or taking action in relation of the 
contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been 
automatically archived by Mimecast, a leader in email security and cyber 
resilience. Mimecast integrates email defenses with brand protection, security 
awareness training, web security, compliance and other essential capabilities. 
Mimecast helps protect large and small organizations from malicious activity, 
human error and technology failure; and to lead the movement toward building a 
more resilient world. To find out more, visit our website.

-- 
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/DM6PR12MB268230EA2370655932B7CD3783299%40DM6PR12MB2682.namprd12.prod.outlook.com.


customizing poll SCM

2022-01-08 Thread Jeremy Mordkoff
We use git and submodules. I only want certain builds to kick off if there 
are commits in certain submodules. I have this as part of the pipeline now, 
but this means my build history is filling up with jobs that did nothing 
except figure out that they didn't need to run and that's pushing  the logs 
from the builds I do care about off the bottom (I don't keep all logs). 

Is there way to customize the poll scm function per pipeline? 

Or maybe is there a way for a job to delete itself from the history? 

I suppose I could write a job that did nothing but survey jenkins itself 
and delete any jobs with a certain build description. 

Or maybe add a step to my pipeline when I decide I don't need to run to see 
if the previous build also exited without running and delete the previous 
job so that there were never more than 1 most recent job that self-aborted. 

Just looking for ideas/options. 

Thanks gang .

-- 
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/6e67b374-9ba1-4795-83de-163720bc361cn%40googlegroups.com.


Re: java.io.IOException: Could not copy remoting.jar into ‘/export/build’ on agent

2021-12-23 Thread Jeremy Mordkoff
what are the perms on /export/build and /export/build/remoting.jar? One of 
them is not writable by user jenkins 


On Thursday, December 23, 2021 at 3:28:15 AM UTC-5 Harri wrote:

> Hi folks,
>
> using Jenkins 2.326 (the Debian package) the agent cannot be redeployed. It
> fails with
>
> [12/13/21 17:53:49] [SSH] Checking java version of 
> /usr/lib/jvm/java-openjdk/bin/java
> [12/13/21 17:53:49] [SSH] /usr/lib/jvm/java-openjdk/bin/java -version 
> returned 1.8.0_302.
> [12/13/21 17:53:49] [SSH] Starting sftp client.
> [12/13/21 17:53:49] [SSH] Copying latest remoting.jar...
> java.io.IOException: Could not copy remoting.jar into '/export/build' on 
> agent
> at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:739)
> at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:112)
> at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)
> at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalArgumentException: invalid len argument
> at com.trilead.ssh2.SFTPv3Client.read(SFTPv3Client.java:1232)
> at 
> com.trilead.ssh2.jenkins.SFTPClient$SFTPInputStream.read(SFTPClient.java:172)
> at 
> com.google.common.io.ByteStreams.toByteArrayInternal(ByteStreams.java:184)
> at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:224)
> at 
> hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(SSHLauncher.java:797)
> at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:708)
> ... 7 more
> [12/13/21 17:53:49] Launch failed - cleaning up connection
> [12/13/21 17:53:49] [SSH] Connection closed.
>
> If I remove the remoting.jar manually on the node it works for a short 
> time,
> but then the error comes back. Java on the node is openjdk 8u302 (CentOS) 
> or
> AdoptOpenJDK 8u292 (Debian).
>
> Seems to be related to JENKINS-67258 (currently unassigned).
>
> Every helpful comment is highly appreciated.
>
>
> Regards
> Harri
>

-- 
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/677dc1bc-f90a-41bd-b425-74de20e3a24dn%40googlegroups.com.


Re: Jenkins jobs not completing

2021-12-22 Thread Jeremy Mordkoff
I'm assuming then that there's no network activity at the end of the 30 minute 
window. What is the master doing? Perhaps cleaning up old builds? How many do 
you keep? FYI...I normally keep about 100 per pipeline & branch.

Jeremy Mordkoff
Director, Engineering Services
[cid:d4bea858-87ac-488e-8153-7355689370c1]<https://dzsi.com>
Headquarters: 5700 Tennyson Parkway, Plano, Texas, USA
Mobile: +1 978.257.2183
Email: jeremy.mordk...@dzsi.com

[cid:bbb0ed23-5a42-4404-aa60-52d5ceab42c4]<https://dzsi.com>

[cid:72ec9354-4241-4492-92dd-eb329950aabe]<https://www.linkedin.com/company/dzsi/>[cid:23de3289-25c5-485c-a4ba-627848162597]<https://twitter.com/dzs_innovation>[cid:99ecbcfa-4523-4d4c-b0af-c151665d5bb4]<https://www.youtube.com/channel/UCgr0fSzluyi0QYaoDgHhkBg>

From: jenkinsci-users@googlegroups.com  on 
behalf of rssouthw 
Sent: Wednesday, December 22, 2021 1:29 PM
To: Jenkins Users 
Subject: Re: Jenkins jobs not completing

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Nothing like a TCP timeout I think.   I forgot to include that during my manual 
check, I do the same exact ssh /path command,  running as the same user as our 
Jenkins process, from the same host that we have Jenkins running on.   It 
always completes very quickly.

lf you click down into the console log of the job itself, you can see it 
completes (several of our scripts say "done" or "exiting" at the end).
At the project page level shows it's complete, but the very top page shows 
Jenkins still thinking it's running.   The job can't be cancelled with the "X".

But yes, it has something to do with the job being on the other end of an ssh 
but it's not clear what.  If the check is on the same host, Jenkins works 
great.  Again, we've been using this methodology for years, and it's worked 
great.   It's only been since, oh, 2-3 months the issue has shown up.

On Tuesday, December 21, 2021 at 7:56:12 AM UTC-8 jeremy@dzsi.com wrote:
30 minutes sounds like a TCP timeout. Are there any firewalls or NAT devices in 
the path? Sometimes they close the connection when the first FIN is sent but 
before the last FIN-ACK and that can cause SSH to hang up.

A second possibility is asymetric routes where the replies come in on a 
different interface then the outgoing packets.

In either case, tcpdump can pinpoint the issue.



On Monday, December 20, 2021 at 4:27:50 PM UTC-5 rogersout...@gmail.com wrote:

We use Jenkins to check that various things are running on our infrastructure 
hosts.
This is typically done with something like:

 ssh hostname /the/script/to/check

If the check exits with a zero status, Jenkins goes on to mark the build as 
good.

Sometime in the last couple months, the script and the ssh exits with a zero 
status
but Jenkins hangs on and does not mark the job as complete for a long time, 
like close to 30 minutes.

If we invoke these manually, there is no issue.   The check runs very quickly 
(under a couple seconds).

We've updated Jenkins several times (now on 2.325) in an attempt to fix the 
issue.

Any ideas where to look?

Thanks in advance.



--
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/01yoX_YnaGk/unsubscribe<https://groups.google.com/d/topic/jenkinsci-users/01yoX_YnaGk/unsubscribe>.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ffe78b3b-fb83-4fb6-9108-ff825b10abb5n%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/ffe78b3b-fb83-4fb6-9108-ff825b10abb5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Disclaimer

The information contained in this communication from the sender is 
confidential. It is intended solely for use by the recipient and others 
authorized to receive it. If you are not the recipient, you are hereby notified 
that any disclosure, copying, distribution or taking action in relation of the 
contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been 
automatically archived by Mimecast, a leader in email security and cyber 
resilience. Mimecast integrates email defenses with brand protection, security 
awareness training, web security, compliance and other essential capabilities. 
Mimecast helps protect large and small organizations from malicious activity, 
human error and technology failure; and to lead the movement toward bui

Re: Jenkins jobs not completing

2021-12-21 Thread Jeremy Mordkoff
30 minutes sounds like a TCP timeout. Are there any firewalls or NAT 
devices in the path? Sometimes they close the connection when the first FIN 
is sent but before the last FIN-ACK and that can cause SSH to hang up. 

A second possibility is asymetric routes where the replies come in on a 
different interface then the outgoing packets.

In either case, tcpdump can pinpoint the issue. 



On Monday, December 20, 2021 at 4:27:50 PM UTC-5 rogersout...@gmail.com 
wrote:

>
> We use Jenkins to check that various things are running on our 
> infrastructure hosts.
> This is typically done with something like:
>
>  ssh hostname /the/script/to/check
>
> If the check exits with a zero status, Jenkins goes on to mark the build 
> as good.
>
> Sometime in the last couple months, the script and the ssh exits with a 
> zero status
> but Jenkins hangs on and does not mark the job as complete for a long 
> time, like close to 30 minutes.
>
> If we invoke these manually, there is no issue.   The check runs very 
> quickly (under a couple seconds).
>
> We've updated Jenkins several times (now on 2.325) in an attempt to fix 
> the issue.
>
> Any ideas where to look?
>
> Thanks in advance.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d6b13386-9a91-4b4c-9764-ddea9323048dn%40googlegroups.com.


Layered builds

2021-12-17 Thread Jeremy Mordkoff
We are migrating from a single build pipeline to a pair of pipelines. The 
first will build our "platform" and then the second will build the 
application. This is because we will soon have multiple applications using 
the same platform. 

The applications should build if the platform changes OR if the application 
code changes. 

The application builds can be triggered by the usual source tree scanning 
logic in jenkins. But what is the best way to make sure that the 
application jobs all run wen the platform changes? Should I add a job build 
commands to the end of the platform pipeline to trigger all of the 
application builds? If I do this, is there a way to determine in the 
application builds that they were triggered by the platform 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/b1c6fa2c-2f28-462a-a7b5-f546eb116a5bn%40googlegroups.com.


Re: Exclude Paths from Triggering Builds

2021-02-12 Thread Jeremy Mordkoff
Also interested in the answer. 

At the moment we scan the change log from the scm object and abort the 
pipeline (cleanly) if there is nothing of interest to that pipeline to 
build. I do not like this solution for multiple reasons. 

Our plan is to split our code into 3 repos .. one for each app and one for 
the product, with each of the app builds triggering a product build. The 
product build is really fast since all it does is update the tags in a helm 
chart to reference the latest builds. 

FYI...we use git submodules, which is why the scm object is not a good 
solution for us as it only has a list of changes made in the super-module. 

On Friday, February 12, 2021 at 7:08:58 AM UTC-5 venh...@gmail.com wrote:

> I have a repository in GitHub. This repository has a Jenkinsfile at the 
> root which is the app project. There are 2 more folders / directories, one 
> for Config project and one for Database project. Each has a jenkins file 
> inside it. 
>
> We have 3 Multibranch Jenkins Pipelines, since there are 3 
> different modules / projects. But all of them belong to the same GitHub 
> repository. The challenge is that, if the DB developer modifies any file 
> inside the DB directory, other jobs are also triggered (App and Config). If 
> a file is changed in the Config directory, it triggers App and DB jobs, 
> probably because all are inside the same repository.
>
> Is there a way to ensure that any change in DB directory will only trigger 
> the DB Multibranch job and not the App and Config and vice versa? 
> Basically, I am looking for an option to exclude DB and Config directory 
> from triggering App Build and so on. Please help.
>
> Regards,
> Venkatesh
>

-- 
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/6ab91fd5-886e-4b7b-acd1-045c52088fbdn%40googlegroups.com.


Permissions to see pipeline syntax

2021-02-09 Thread Jeremy Mordkoff
What permission(s) do I need to grant to a new user in order for them to 
see the pipeline syntax option? 

I am a full admin and I see it. 

They are authenticated but they only have rights to start and stop jobs 
right now. I created a job for them that invokes a JenkinsFile and they are 
busy writing the script. But at the moment they are flying blind since they 
cannot see the pipeline syntax page and the snippet generator. 

Perhaps there is a standalone instance of this function somewhere? 

-- 
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/df291aff-7fc6-483e-8158-481168b12a35n%40googlegroups.com.


Re: Issue with master-agent communication over ssh

2020-12-10 Thread Jeremy Mordkoff
This has been discussed before. Did you search this group's archives? You 
might be better off re-starting a conversation in one of those threads. 

My own experience is that I too saw this issue for many months. It cleared 
up on its own. In that interim I did upgrade jenkins more than once and I 
did switch from dualstack ipv4/ipv6 to ipv4 only for all jenkins work as I 
was getting errors deploying containers when ipv6 was enabled. I have no 
idea if either of these actually mattered, and I'm sure other things 
changed that I am assuming are completely unrelated but may not be. 


On Wednesday, December 9, 2020 at 11:53:19 AM UTC-5 jiga...@gmail.com wrote:

> Hello Jenkins community, 
>
> I have setup Jenkins agents over SSH and this agent frequently goes 
> offline with Resource temporarily unavailable error. I had to configure my 
> Jenkins agents to communicate over JNLP. Any advise on how to fix this 
> issue?
>
> Jenkins v2.249.1
>
> [12/04/20 15:23:00] [SSH] Checking java version of java
> [12/04/20 15:23:01] [SSH] java -version returned 1.8.0_202.
> [12/04/20 15:23:01] [SSH] Starting sftp client.
> [12/04/20 15:23:03] [SSH] Remote file system root $JENKINS_SSH_DATA does 
> not exist. Will try to create it...
> [12/04/20 15:23:03] [SSH] Copying latest remoting.jar...
> [12/04/20 15:23:03] [SSH] Copied 1,521,553 bytes.
> Expanded the channel window size to 4MB
> [12/04/20 15:23:03] [SSH] Starting agent process: cd "$JENKINS_SSH_DATA" 
> && java  -jar remoting.jar -workDir $JENKINS_SSH_DATA -jar-cache 
> $JENKINS_SSH_DATA/remoting/jarCache
> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir
> INFO: Using $JENKINS_SSH_DATA/remoting as a remoting work directory
> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
> INFO: Both error and output logs will be printed to 
> $JENKINS_SSH_DATA/remoting
> <===[JENKINS REMOTING CAPACITY]===>channel started
> Remoting version: 4.5
> This is a Unix agent
> Evacuated stdout
> Agent successfully connected and online
> The Agent is connected, disconnect it before to try to connect it again.
> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS discoverGitSystemConfig
> WARNING: Exception caught during execution of command '[git, config, 
> --system, --edit]' in '$GIT_PATH/bin', return code '128', error message 
> 'fatal: Invalid path '$GIT_PATH/etc': No such file or directory
> '
> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS$FileStoreAttributes 
> saveToConfig
> WARNING: locking FileBasedConfig[$JENKINS_PATH/.config/jgit/config] failed 
> after 5 retries
> Dec 04, 2020 3:33:59 PM org.jenkinsci.remoting.util.AnonymousClassWarnings 
> warn
> WARNING: Attempt to (de-)serialize anonymous class 
> com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser$1;
>  
> see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
> Dec 04, 2020 3:34:24 PM hudson.remoting.Request$2 run
> WARNING: Failed to send back a reply to the request 
> hudson.remoting.Request$2@493c5a4e
> java.io.IOException: Resource temporarily unavailable
> at java.io.FileOutputStream.writeBytes(Native Method)
> at java.io.FileOutputStream.write(FileOutputStream.java:313)
> at 
> hudson.remoting.StandardOutputStream.write(StandardOutputStream.java:83)
> at 
> hudson.remoting.ChunkedOutputStream.sendFrame(ChunkedOutputStream.java:89)
> at 
> hudson.remoting.ChunkedOutputStream.sendBreak(ChunkedOutputStream.java:62)
> at 
> hudson.remoting.ChunkedCommandTransport.writeBlock(ChunkedCommandTransport.java:46)
> at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.write(AbstractSynchronousByteArrayCommandTransport.java:46)
> at hudson.remoting.Channel.send(Channel.java:766)
> at hudson.remoting.Request$2.run(Request.java:388)
> at 
> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
>  
> Dec 04, 2020 5:25:30 PM hudson.remoting.Request$2 run
> WARNING: Failed to send back a reply to the request 
> hudson.remoting.Request$2@2511e2d4
> java.io.IOException: Resource temporarily unavailable
> at java.io.FileOutputStream.writeBytes(Native Method)
> at java.io.FileOutputStream.write(FileOutputStream.java:326)
> at 
> hudson.remoting.StandardOutputStream.write(StandardOutputStream.java:88)
> at 
> hudson.remoting.ChunkedOutputStream.sendFrame(ChunkedOutputStream.java:90)
> at 
> hudson.remoting.ChunkedOutputStream.drain(ChunkedOutputStream.java:85)
> at 
> hudson.remoting.ChunkedOutputStream.write(ChunkedOutputStream.java:54)
> at java.io.OutputStream.write(OutputStream.java:75)
> at 
> huds

Re: loop over branches

2020-12-05 Thread Jeremy Mordkoff
I get that that is a better way of limiting the number of instances than 
using executor counts. Thanks for that. 

I still don't see a good way to schedule the jobs. Set a cron entry in the 
job so they all get scheduled once a day and then let all but one sit idle 
waiting on the resource lock? 



On Friday, December 4, 2020 at 2:27:55 PM UTC-5 Arnaud wrote:

> Hello,
>
> I've setup something similar.
> We have one test platform and like you want to run tests on per branch.
> I use lock resource plugin to run tests in exclusive stage.
>
> Regards.
>
> Arnaud 
>
> Le mar. 1 déc. 2020 à 22:11, jeremy mordkoff  a 
> écrit :
>
>> We have too many tests, so we have broken them up into three groups. One 
>> group that runs after each checkin and one group that runs once a day on 
>> any branch with changes and one group that I would like to limit to one 
>> instance at a time but still test any active branch. 
>>
>> What is the best way to structure such a job? I am thinking a daemon type 
>> job that just iterates over branches and kicks off the real test job and 
>> then waited. The daemon would be sitting idle for almost 6 hours and then 
>> busy for 10 seconds, and then idle again, which seems slightly wasteful but 
>> at least this way jenkins would be self managing and I could tweak the 
>> daemon side to have priorities if I wanted, e.g. if master had changes and 
>> hadn't run in 36 hours, run it next, then go back to rotating fairly across 
>> the branches with changes. 
>>
>> I can't have just one long running job that does it all because then my 
>> test results would get mixed together (I think) and I would not have 
>> red/yellow/blue for each branch. 
>>
>> Any other ideas? 
>>
>> -- 
>> 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/bcf0f35d-ed37-4ef6-8445-e628373c7817n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/bcf0f35d-ed37-4ef6-8445-e628373c7817n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/5adbc5e6-8a03-4d9b-b347-5582252c2641n%40googlegroups.com.


loop over branches

2020-12-01 Thread jeremy mordkoff
We have too many tests, so we have broken them up into three groups. One 
group that runs after each checkin and one group that runs once a day on 
any branch with changes and one group that I would like to limit to one 
instance at a time but still test any active branch. 

What is the best way to structure such a job? I am thinking a daemon type 
job that just iterates over branches and kicks off the real test job and 
then waited. The daemon would be sitting idle for almost 6 hours and then 
busy for 10 seconds, and then idle again, which seems slightly wasteful but 
at least this way jenkins would be self managing and I could tweak the 
daemon side to have priorities if I wanted, e.g. if master had changes and 
hadn't run in 36 hours, run it next, then go back to rotating fairly across 
the branches with changes. 

I can't have just one long running job that does it all because then my 
test results would get mixed together (I think) and I would not have 
red/yellow/blue for each branch. 

Any other ideas? 

-- 
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/bcf0f35d-ed37-4ef6-8445-e628373c7817n%40googlegroups.com.


Re: Can HTML submit button trigger a Jenkins job ?

2020-11-02 Thread jeremy mordkoff
simple answer is no. an href cannot include a headers directive or anything 
else)

It can be done using ajax 
-- 
https://stackoverflow.com/questions/374885/can-i-change-the-headers-of-the-http-request-sent-by-the-browser
 

or you could build a proxy that did nothing but add that header. But if you 
do that, you might as well allow anonymous users to start jobs and then the 
header becomes superfluous (I think). 

On Sunday, November 1, 2020 at 1:49:16 PM UTC-5 shif...@gmail.com wrote:

> My HTML code is like below where i pass the crumb and try to trigger a 
> Jenkins DSL job along with passing parameters:
>
>  action='https://localhost:8080/job/myjob1/buildWithParameters?paramone=myhost1-stop-myfolder
>  -H Jenkins-Crumb:d863847724897hghjtg37684yh4j3y9847dsfhkuhd' 
> method=POST> value='START'/>
>
> On the browser i see the URL as:
>
> https://localhost:8080/job/myjob1/buildWithParameters?paramone=myhost1-stop-myfolder%20-H%20Jenkins-Crumb:d863847724897hghjtg37684yh4j3y9847dsfhkuhdI
>
> I frankly have no idea how can I pass the crumb using HTML submit button.
>
>
> I had obtained my crumb from https://localhost:8080/crumbIssuer/api/xml
>
>
> When i click on START button i get 
>
>
> HTTP ERROR 403 No valid crumb was included in the request
>
>
> My Jenkins has SAML based SSO for login and I would like the user 
> triggering the START button to login with his credentials hence, I do not 
> pass the credentials in the URL.
>
>
> The job myjob1 is configured to be triggered remotely.
>
>
> Also, I'm able to trigger the job using curl utility but not sure how-to 
> using HTML button.
>
>
> Can you please suggest how to get this to 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/e2cc978b-5c82-441e-abd6-ff489b557bban%40googlegroups.com.


Re: Jenkins UI labels survey

2020-10-29 Thread jeremy mordkoff
Hi Joe, 

Missing an option...I use the UI a lot but not exclusively. 

On Thursday, October 29, 2020 at 10:11:55 AM UTC-4 Joseph Brueggen wrote:

> Hello everyone,
>
> My name is Joe—I'm a designer at CloudBees. I'm gathering some feedback 
> about the Jenkins user interface.
>
> This new survey is about Jenkins UI nomenclature. It takes only 5 minutes 
> to complete, and your feedback would be greatly appreciated!
>
> Here's the survey: https://holisticux.typeform.com/to/nMttDAgi
>
> Thank you!
>

-- 
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/50b1e2e4-6054-4936-81fe-98e5467c63ebn%40googlegroups.com.


Re: variable within a variable

2020-10-26 Thread jeremy mordkoff
okay, take this with a grain of salt because this is purely a guess

The ssh call is trying to serialize all of the local variables, but it 
can't serialize the simpleTemplate. So move all the code that touches 
simpletemplate into a function that's wrapped with the @NONCPS decorator. 

something like  this (I am writing this off the top of my head ... no 
verification)

@NONCPS
def make_path(MAL) { 

def pathname = "/srv/\${host}/foo/bar"
def templateMessage = new 
SimpleTemplateEngine().createTemplate(pathname)
def template = { host -> templateMessage.make(host: host)}
def result = template(MAL)
   return result
}

   


On Monday, October 26, 2020 at 2:41:09 PM UTC-4 cw wrote:

> I wondered about that also, but I commented it out and still got the 
> error.  Then I moved the defs outside the withCredentials block and now I 
> get a similar but different error.  It appears to be erroring at the 
> withCredentials line.  I haven't even tried calling these defs yet but am 
> getting the error when going into withCredentials:
>
> *14:34:20* in field com.cloudbees.groovy.cps.impl.BlockScopeEnv.locals 
> *14:34:20* in object com.cloudbees.groovy.cps.impl.BlockScopeEnv@307ca576 
> *14:34:20* in field com.cloudbees.groovy.cps.impl.CpsClosureDef.capture 
> *14:34:20* in object com.cloudbees.groovy.cps.impl.CpsClosureDef@1b7eff10 
> *14:34:20* in field com.cloudbees.groovy.cps.impl.CpsClosure.def 
> *14:34:20* in object 
> org.jenkinsci.plugins.workflow.cps.CpsClosure2@2932682d 
> *14:34:20* in field 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.closures 
> *14:34:20* in object 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@43cd433c 
> *14:34:20* in object 
> org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@43cd433c 
> *14:34:20* Caused: java.io.NotSerializableException: 
> groovy.text.SimpleTemplateEngine$SimpleTemplate  
>
> On Monday, October 26, 2020 at 1:51:28 PM UTC-4 jeremy@riftio.com 
> wrote:
>
>> I think it is failing on this line: 
>> echo("MAL is ${MAL}")
>>
>>
>>
>> On Monday, October 26, 2020 at 11:51:19 AM UTC-4 cw wrote:
>>
>>> Also I'm confused why I'm getting a  NotSerializableException related to 
>>> SimpleTemplateEngine$SimpleTemplate when I'm in a try/except block which is 
>>> running an sshCommand which is not trying to call the SimpleTemplateEngine.
>>>
>>> On Monday, October 26, 2020 at 10:04:59 AM UTC-4 cw wrote:
>>>
 The code block I pasted is exactly the pipeline steps I am running so I 
 don't think I'm running it in a function?  

 On Monday, October 26, 2020 at 9:41:08 AM UTC-4 jeremy@riftio.com 
 wrote:

> Are you running this in the main thread of the enkinsFile itself or in 
> a function? I suspect that you are in a function and you may need to use 
> the @NONCPS decorator 
>
> On Friday, October 23, 2020 at 4:31:55 PM UTC-4 cw wrote:
>
>> That's great, thank you very much.  I was able to take your code, 
>> substitute MAL for HOST, for instance, and test it in a groovy web 
>> console, 
>> and it returned the correct value and interpolated the variable even 
>> though 
>> the variable wasn't defined until after the pathname was defined with 
>> the 
>> variable in it.  Exactly what I was looking for.  However...
>>
>> I took the same code and pasted it into my test jenkins pipeline and 
>> now I'm getting an error on a subsequent command which I looked up, but 
>> I 
>> think it may be over my head...  Note that I'm getting the correct 
>> result 
>> with my substituted variable, but I'm just printing to the console and 
>> I'm 
>> not using it yet in the sshcommand, and yet sshcommand appears to be 
>> failing where before it wasn't.
>>
>> *6:24:05* Executing command on care SOC[xx.xx.xx.xx]: ls -ltr 
>> /srv/jboss/server/ sudo: false 
>> *16:24:05* [Pipeline] echo 
>> 
>>  
>> *16:24:05* something failed 
>> *16:24:05* [Pipeline] echo 
>> 
>>  
>> *16:24:05* java.io.NotSerializableException: 
>> groovy.text.SimpleTemplateEngine$SimpleTemplate  
>>
>> code block:
>>
>> import java.text.SimpleDateFormat
>> import groovy.text.SimpleTemplateEngine
>>
>> node {
>> def dateFormat = new SimpleDateFormat("MMddHHmm")
>>
>> MALarray = params.multi.split(',')
>>
>> MALarray.each { MAL ->
>>
>>  
>> if (MAL in ['care', 'conn'] )  {
>> echo 'care or conn'
>> servers = ['xx.xx.xx.xx']
>> }
>> def soc_remote = [:]
>> soc_remote.name = "${MAL} SOC"
>> soc_remote.allowAnyHosts = true
>>
>> withCredentials([usernamePassword(credentialsI

Re: variable within a variable

2020-10-26 Thread jeremy mordkoff
I think it is failing on this line: 
echo("MAL is ${MAL}")



On Monday, October 26, 2020 at 11:51:19 AM UTC-4 cw wrote:

> Also I'm confused why I'm getting a  NotSerializableException related to 
> SimpleTemplateEngine$SimpleTemplate when I'm in a try/except block which is 
> running an sshCommand which is not trying to call the SimpleTemplateEngine.
>
> On Monday, October 26, 2020 at 10:04:59 AM UTC-4 cw wrote:
>
>> The code block I pasted is exactly the pipeline steps I am running so I 
>> don't think I'm running it in a function?  
>>
>> On Monday, October 26, 2020 at 9:41:08 AM UTC-4 jeremy@riftio.com 
>> wrote:
>>
>>> Are you running this in the main thread of the enkinsFile itself or in a 
>>> function? I suspect that you are in a function and you may need to use the 
>>> @NONCPS decorator 
>>>
>>> On Friday, October 23, 2020 at 4:31:55 PM UTC-4 cw wrote:
>>>
 That's great, thank you very much.  I was able to take your code, 
 substitute MAL for HOST, for instance, and test it in a groovy web 
 console, 
 and it returned the correct value and interpolated the variable even 
 though 
 the variable wasn't defined until after the pathname was defined with the 
 variable in it.  Exactly what I was looking for.  However...

 I took the same code and pasted it into my test jenkins pipeline and 
 now I'm getting an error on a subsequent command which I looked up, but I 
 think it may be over my head...  Note that I'm getting the correct result 
 with my substituted variable, but I'm just printing to the console and I'm 
 not using it yet in the sshcommand, and yet sshcommand appears to be 
 failing where before it wasn't.

 *6:24:05* Executing command on care SOC[xx.xx.xx.xx]: ls -ltr 
 /srv/jboss/server/ sudo: false 
 *16:24:05* [Pipeline] echo 
 
  
 *16:24:05* something failed 
 *16:24:05* [Pipeline] echo 
 
  
 *16:24:05* java.io.NotSerializableException: 
 groovy.text.SimpleTemplateEngine$SimpleTemplate  

 code block:

 import java.text.SimpleDateFormat
 import groovy.text.SimpleTemplateEngine

 node {
 def dateFormat = new SimpleDateFormat("MMddHHmm")

 MALarray = params.multi.split(',')

 MALarray.each { MAL ->

  
 if (MAL in ['care', 'conn'] )  {
 echo 'care or conn'
 servers = ['xx.xx.xx.xx']
 }
 def soc_remote = [:]
 soc_remote.name = "${MAL} SOC"
 soc_remote.allowAnyHosts = true

 withCredentials([usernamePassword(credentialsId: 'Credentials', 
 usernameVariable: 'USER_ID', passwordVariable: 'USER_PASSWORD')]) {
 soc_remote.user = USER_ID
 soc_remote.password = USER_PASSWORD
 def templateMessage = new 
 SimpleTemplateEngine().createTemplate(filepath)
 def result = { mal -> templateMessage.make(mal: mal)}

 println(result(MAL))// this is working correctly

 servers.each { server ->
 soc_remote.host = server
 try {
 echo("MAL is ${MAL}")
 sshCommand remote: soc_remote, command: "ls -ltr /srv/jboss/server/"
 } catch (err) {
   echo "something failed"
   echo "${err}"// this is where I'm getting 
 the error on the sshcommand
   } 
 }
 }
 }
 } 

 On Friday, October 23, 2020 at 3:14:08 PM UTC-4 jeremy@riftio.com 
 wrote:

> I stumbled on 
> https://stackoverflow.com/questions/55423036/groovy-string-interpolation-when-string-is-defined-before-the-interpolated-varia
>
> and I found this snippet worked just fine after I approved the 
> signature in jenkins 
>
> import groovy.text.SimpleTemplateEngine
>
> node("docker") {
> stage("eval") {
> def pathname = "/srv/\${host}/foo/bar"
>
> def templateMessage = new 
> SimpleTemplateEngine().createTemplate(pathname)
>
> def result = { host -> templateMessage.make(host: host)}
> def HOST = "myhost"
>
> println(result(HOST))
> }
> }
>
>
>
>
> On Friday, October 23, 2020 at 2:28:57 PM UTC-4 cw wrote:
>
>> Thank you, it seems that you're right, it's not completing the 
>> expansion, but in the research I did, I wasn't able to make anything 
>> else 
>> work (one suggestion had to do with double quotes instead of single 
>> quotes, 
>> but wasn't able to get that to work either).  I don't know if it's 
>> related 
>> to it being a parameter that was specified at build this is not allowing 
>> it 
>> to expa

Re: variable within a variable

2020-10-26 Thread jeremy mordkoff
Are you running this in the main thread of the enkinsFile itself or in a 
function? I suspect that you are in a function and you may need to use the 
@NONCPS decorator 

On Friday, October 23, 2020 at 4:31:55 PM UTC-4 cw wrote:

> That's great, thank you very much.  I was able to take your code, 
> substitute MAL for HOST, for instance, and test it in a groovy web console, 
> and it returned the correct value and interpolated the variable even though 
> the variable wasn't defined until after the pathname was defined with the 
> variable in it.  Exactly what I was looking for.  However...
>
> I took the same code and pasted it into my test jenkins pipeline and now 
> I'm getting an error on a subsequent command which I looked up, but I think 
> it may be over my head...  Note that I'm getting the correct result with my 
> substituted variable, but I'm just printing to the console and I'm not 
> using it yet in the sshcommand, and yet sshcommand appears to be failing 
> where before it wasn't.
>
> *6:24:05* Executing command on care SOC[xx.xx.xx.xx]: ls -ltr 
> /srv/jboss/server/ sudo: false 
> *16:24:05* [Pipeline] echo 
> 
>  
> *16:24:05* something failed 
> *16:24:05* [Pipeline] echo 
> 
>  
> *16:24:05* java.io.NotSerializableException: 
> groovy.text.SimpleTemplateEngine$SimpleTemplate  
>
> code block:
>
> import java.text.SimpleDateFormat
> import groovy.text.SimpleTemplateEngine
>
> node {
> def dateFormat = new SimpleDateFormat("MMddHHmm")
>
> MALarray = params.multi.split(',')
>
> MALarray.each { MAL ->
>
>  
> if (MAL in ['care', 'conn'] )  {
> echo 'care or conn'
> servers = ['xx.xx.xx.xx']
> }
> def soc_remote = [:]
> soc_remote.name = "${MAL} SOC"
> soc_remote.allowAnyHosts = true
>
> withCredentials([usernamePassword(credentialsId: 'Credentials', 
> usernameVariable: 'USER_ID', passwordVariable: 'USER_PASSWORD')]) {
> soc_remote.user = USER_ID
> soc_remote.password = USER_PASSWORD
> def templateMessage = new SimpleTemplateEngine().createTemplate(filepath)
> def result = { mal -> templateMessage.make(mal: mal)}
>
> println(result(MAL))// this is working correctly
>
> servers.each { server ->
> soc_remote.host = server
> try {
> echo("MAL is ${MAL}")
> sshCommand remote: soc_remote, command: "ls -ltr /srv/jboss/server/"
> } catch (err) {
>   echo "something failed"
>   echo "${err}"// this is where I'm getting 
> the error on the sshcommand
>   } 
> }
> }
> }
> } 
>
> On Friday, October 23, 2020 at 3:14:08 PM UTC-4 jeremy@riftio.com 
> wrote:
>
>> I stumbled on 
>> https://stackoverflow.com/questions/55423036/groovy-string-interpolation-when-string-is-defined-before-the-interpolated-varia
>>
>> and I found this snippet worked just fine after I approved the signature 
>> in jenkins 
>>
>> import groovy.text.SimpleTemplateEngine
>>
>> node("docker") {
>> stage("eval") {
>> def pathname = "/srv/\${host}/foo/bar"
>>
>> def templateMessage = new 
>> SimpleTemplateEngine().createTemplate(pathname)
>>
>> def result = { host -> templateMessage.make(host: host)}
>> def HOST = "myhost"
>>
>> println(result(HOST))
>> }
>> }
>>
>>
>>
>>
>> On Friday, October 23, 2020 at 2:28:57 PM UTC-4 cw wrote:
>>
>>> Thank you, it seems that you're right, it's not completing the 
>>> expansion, but in the research I did, I wasn't able to make anything else 
>>> work (one suggestion had to do with double quotes instead of single quotes, 
>>> but wasn't able to get that to work either).  I don't know if it's related 
>>> to it being a parameter that was specified at build this is not allowing it 
>>> to expand?
>>>
>>> I looked at the link you sent but didn't really understand "using a 
>>> closure" as the answer states.  I tried to imitate it using this code below 
>>> but it still didn't expand:
>>>
>>> def fp = { filepath -> "${filepath}" }
>>> println fp(filepath)
>>>
>>> On Friday, October 23, 2020 at 12:13:07 PM UTC-4 jeremy@riftio.com 
>>> wrote:
>>>
 I think you need to do an "eval" or the equivalent to filepath in order 
 to expand the inner variable. I believe the ssh command is executing "ls 
 /srv/jboss/server/${MAL}/log/" but MAL on the far end is empty. So you 
 need 
 to complete the expansion before calling ssh. 

 This might get you on the right track -- 
 https://stackoverflow.com/questions/28997518/groovy-string-interpolation-with-value-only-known-at-runtime

 On Thursday, October 22, 2020 at 12:14:06 PM UTC-4 cw wrote:

> I'm trying to set up a string parameter which will reference a 
> variable which will be created within the pipeline.  F

Re: variable within a variable

2020-10-23 Thread jeremy mordkoff
I stumbled 
on 
https://stackoverflow.com/questions/55423036/groovy-string-interpolation-when-string-is-defined-before-the-interpolated-varia

and I found this snippet worked just fine after I approved the signature in 
jenkins 

import groovy.text.SimpleTemplateEngine

node("docker") {
stage("eval") {
def pathname = "/srv/\${host}/foo/bar"

def templateMessage = new 
SimpleTemplateEngine().createTemplate(pathname)

def result = { host -> templateMessage.make(host: host)}
def HOST = "myhost"

println(result(HOST))
}
}




On Friday, October 23, 2020 at 2:28:57 PM UTC-4 cw wrote:

> Thank you, it seems that you're right, it's not completing the expansion, 
> but in the research I did, I wasn't able to make anything else work (one 
> suggestion had to do with double quotes instead of single quotes, but 
> wasn't able to get that to work either).  I don't know if it's related to 
> it being a parameter that was specified at build this is not allowing it to 
> expand?
>
> I looked at the link you sent but didn't really understand "using a 
> closure" as the answer states.  I tried to imitate it using this code below 
> but it still didn't expand:
>
> def fp = { filepath -> "${filepath}" }
> println fp(filepath)
>
> On Friday, October 23, 2020 at 12:13:07 PM UTC-4 jeremy@riftio.com 
> wrote:
>
>> I think you need to do an "eval" or the equivalent to filepath in order 
>> to expand the inner variable. I believe the ssh command is executing "ls 
>> /srv/jboss/server/${MAL}/log/" but MAL on the far end is empty. So you need 
>> to complete the expansion before calling ssh. 
>>
>> This might get you on the right track -- 
>> https://stackoverflow.com/questions/28997518/groovy-string-interpolation-with-value-only-known-at-runtime
>>
>> On Thursday, October 22, 2020 at 12:14:06 PM UTC-4 cw wrote:
>>
>>> I'm trying to set up a string parameter which will reference a variable 
>>> which will be created within the pipeline.  For instance, when building a 
>>> parameterized build, the user enters a file path in this 
>>> format: /srv/jboss/server/${MAL}/log/
>>>
>>> Where MAL is assigned via the pipeline and then I try to ls -ltr the 
>>> fully qualified path after MAL has been expanded.  However I'm not getting 
>>> it to expand; wondering what I'm doing wrong.
>>>
>>> node {
>>> MALarray = params.multi.split(',')
>>>
>>> MALarray.each { MAL ->
>>>  
>>> if (MAL in ['care''] )  {
>>> servers = ['xx.xx.xx.xx','xx.xx.xx.xx']
>>> }
>>>
>>> def soc_remote = [:]
>>> soc_remote.name = "${MAL} SOC"
>>> soc_remote.allowAnyHosts = true
>>>
>>> withCredentials([usernamePassword(credentialsId: 'Credentials', 
>>> usernameVariable: 'USER_ID', passwordVariable: 'USER_PASSWORD')]) {
>>> soc_remote.user = USER_ID
>>> soc_remote.password = USER_PASSWORD
>>> servers.each { server ->
>>> soc_remote.host = server
>>> stage("Run script on ${server}") {
>>> try {
>>> echo("MAL is ${MAL}")
>>> sshCommand remote: soc_remote, command: "ls -ltr ${filepath}"
>>> } catch (err) {
>>>   echo "something failed"
>>>   echo "${err}"
>>>   }
>>> }
>>> }
>>> }
>>> }
>>> } 
>>>
>>> Console output:
>>> *11:59:34* MAL is care 
>>> *11:59:34* [Pipeline] sshCommand 
>>> 
>>>  
>>> *11:59:34* Executing command on care SOC[xx.xx.xx.xx]: ls -ltr 
>>> /srv/jboss/server/${MAL}/log/ sudo: false 
>>> *11:59:35* ls: cannot access /srv/jboss/server//log/: No such file or 
>>> directory 
>>> *11:59:35* Failed command care SOC#1002 with status 2: ls -ltr 
>>> /srv/jboss/server/${MAL}/log/  
>>>
>>>

-- 
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/9c32e793-e83d-451a-b001-2ec7df3cb83an%40googlegroups.com.


Re: variable within a variable

2020-10-23 Thread jeremy mordkoff
I think you need to do an "eval" or the equivalent to filepath in order to 
expand the inner variable. I believe the ssh command is executing "ls 
/srv/jboss/server/${MAL}/log/" but MAL on the far end is empty. So you need 
to complete the expansion before calling ssh. 

This might get you on the right track 
-- 
https://stackoverflow.com/questions/28997518/groovy-string-interpolation-with-value-only-known-at-runtime

On Thursday, October 22, 2020 at 12:14:06 PM UTC-4 cw wrote:

> I'm trying to set up a string parameter which will reference a variable 
> which will be created within the pipeline.  For instance, when building a 
> parameterized build, the user enters a file path in this 
> format: /srv/jboss/server/${MAL}/log/
>
> Where MAL is assigned via the pipeline and then I try to ls -ltr the fully 
> qualified path after MAL has been expanded.  However I'm not getting it to 
> expand; wondering what I'm doing wrong.
>
> node {
> MALarray = params.multi.split(',')
>
> MALarray.each { MAL ->
>  
> if (MAL in ['care''] )  {
> servers = ['xx.xx.xx.xx','xx.xx.xx.xx']
> }
>
> def soc_remote = [:]
> soc_remote.name = "${MAL} SOC"
> soc_remote.allowAnyHosts = true
>
> withCredentials([usernamePassword(credentialsId: 'Credentials', 
> usernameVariable: 'USER_ID', passwordVariable: 'USER_PASSWORD')]) {
> soc_remote.user = USER_ID
> soc_remote.password = USER_PASSWORD
> servers.each { server ->
> soc_remote.host = server
> stage("Run script on ${server}") {
> try {
> echo("MAL is ${MAL}")
> sshCommand remote: soc_remote, command: "ls -ltr ${filepath}"
> } catch (err) {
>   echo "something failed"
>   echo "${err}"
>   }
> }
> }
> }
> }
> } 
>
> Console output:
> *11:59:34* MAL is care 
> *11:59:34* [Pipeline] sshCommand 
> 
>  
> *11:59:34* Executing command on care SOC[xx.xx.xx.xx]: ls -ltr 
> /srv/jboss/server/${MAL}/log/ sudo: false 
> *11:59:35* ls: cannot access /srv/jboss/server//log/: No such file or 
> directory 
> *11:59:35* Failed command care SOC#1002 with status 2: ls -ltr 
> /srv/jboss/server/${MAL}/log/  
>
>

-- 
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/5ddd0637-9663-4387-b7ea-178729c3b17bn%40googlegroups.com.


Re: master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread jeremy mordkoff
We have a similar issue that only seems to occur during long running jobs 
(over 5 hours). The traceback is different but we also see the EOF 
exception. My client is Ubuntu linux 

I tried to trace the issue by running tcpdumps at both ends on the ssh 
session from the master to the slave but I saw nothing amiss. I suspect 
that there is a connection inside the ssh session but that will be hard to 
catch using tcpdump. 

I wonder if I need to enable some kind of keep alives.


On Tuesday, September 29, 2020 at 4:47:22 AM UTC-4 ashish...@gmail.com 
wrote:

> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>
> Jenkins agent keeps disconnecting frequently, and we are getting below 
> logs in master.
>
> Can you please suggest how to resolve this? What are the steps to further 
> triage the same.
>
> Some of the questions we are trying to answer is:
>
>- What is EOFException?
>- Why does agent tries to connect to master when its already connected?
>- Why does eventually the ping / connection fails? 
>
> We keep seeing this pattern in logs too often and too frequently. Any help 
> would be appreciated.
>
> Results are same even if we try any of the below options:
>
>- Connected using *Launch agent from Browser*
>- Connected by *starting automator* in Mac which runs shell/zsh to run 
>agent.jar
>- Connected by running *plist* in Mac
>
> * Jenkins environment:*
>
>- Jenkins: 2.249.1
>- Master Node: Linux RHEL 8.1
>- Master Java Version: 1.8.0_242
>- Slave System: macOS Catalina, Version 10.15.6
>- Slave Java Version: 1.8.0_261
>
> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
> 2:45:21 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
> from remote:  is already connected to this master. Rejecting 
> this connection.Sep 29, 2020 2:45:31 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
> failed: java.io.EOFException Sep 29, 2020 2:45:31 
> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
> 2:45:32 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
> remote:  is already connected to this master. Rejecting this 
> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
> at 1601318492966 hasn't completed by 1601318732966at 
> hudson.remoting.PingThread.ping(PingThread.java:134)at 
> hudson.remoting.PingThread.run(PingThread.java:90) *
>
>  
>
> TIA
>
>  
>

-- 
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/2eeea79b-b0bb-40cb-9181-94ca2361182bn%40googlegroups.com.


Re: Suppressing certain builds

2020-09-17 Thread jeremy mordkoff

node { 
 stage("checkout") { 
   checkout scm 
   result = sh (script: "git log -1 | grep bump", returnStatus: true) 
   if (result == 0) { 
  println("CI bump commit...skipping build")
  currentBuild.result = 'NOT_BUILT'
  # can I just return here ? exit 0? 
   }
 }
 stage("build") { 


On Thursday, September 17, 2020 at 3:30:01 PM UTC-4 zil...@gmail.com wrote:

> Can you give a simple example?
>
> On Thursday, September 17, 2020 at 12:17:36 PM UTC-4 jeremy@riftio.com 
> wrote:
>
>> I use scripted pipelines
>>
>> I would like certain builds to abort early. (1) if it is just a branch 
>> creation event, (2) if the commit message is "bump" and (3) if the only 
>> change was in certain submodules. 
>>
>> I think I know all the pieces to make this work -- I can write a tool 
>> that could determine if a build was needed or not. What I don't know is 
>> what is the best way to abort the pipeline. Do I set the 
>> currentBuild.status and return? Or do I need to wrap all of the subsequent 
>> stages in an if?
>>
>

-- 
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/d4bf76d4-c7cb-406c-a66c-8ab9dd7d6ab4n%40googlegroups.com.


Suppressing certain builds

2020-09-17 Thread jeremy mordkoff
I use scripted pipelines

I would like certain builds to abort early. (1) if it is just a branch 
creation event, (2) if the commit message is "bump" and (3) if the only 
change was in certain submodules. 

I think I know all the pieces to make this work -- I can write a tool that 
could determine if a build was needed or not. What I don't know is what is 
the best way to abort the pipeline. Do I set the currentBuild.status and 
return? Or do I need to wrap all of the subsequent stages in an if?

-- 
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/5a5fa1aa-23ae-4515-9695-b2888f43fec1n%40googlegroups.com.


Re: how to build on branch creation but not build on other scm event/commit?

2020-09-17 Thread jeremy mordkoff
You could leave the Automatic triggering suppressed and write a tool to 
scan your GIT repo looking for new branches and trigger the build via an 
API call when a new branch is found. Sounds like you might need such a tool 
anyway so that developers could schedule builds. 

On Thursday, September 17, 2020 at 12:59:27 AM UTC-4 timb...@gmail.com 
wrote:

> 1. I have a multibranch pipeline job that takes 30min to run, has a lot of 
> branches, and my company is still at the earlier stages of devops 
> transformation, so with our current infrastructure we do not want to 
> trigger a build every commit.
>
> 2. Our job pipeline uses parameters heavily, so I would also like to 
> automatically build each branch on branch creation/detection. 
>
> How do I achieve the above 2 requirements?
>
> Using git scm/plugin/branchsource, if I set (or clear) "Suppress Automatic 
> SCM triggering", I get only one of the two requirements fulfilled: setting 
> it suppresses ALL automatic triggering, not providing 2. Clearing it 
> satisfies 2, automatically triggering a build on branch discovery, but also 
> builds every commit which we don't want.
>
> In my research I have found the basic branch build strategies plugin 
> ,
>  
> and while it provides some great sophisticated control over what branches 
> build when, in terms of ensuring the job is built on branch creation, it 
> seems to only provide added suppression.
>
> Any suggestions would be welcome. 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/ac468efa-99d3-458e-9114-3800ac5484d5n%40googlegroups.com.


Re: Ignore Post Build Job failure in Jenkins Pipeline

2020-08-21 Thread Jeremy Mordkoff
if you don't wait, then propagate is meaningless .. it can't be done.

I find scripted is more flexible, but any time a system gives you more rope, 
you have to be careful not to hang yourself.


---
Jeremy Mordkoff
Director of Engineering Services
[cid:b0edc09c-0e90-4f2f-a1f2-715660acd801]<https://www.riftio.com>
RIFT, inc
900 Chelmsford Street,  4th floor, tower 3
Lowell, MA 01851
1.978.257.2183 (cell)
<http://www.riftio.com>www.riftio.com<http://www.riftio.com>

From: jenkinsci-users@googlegroups.com  on 
behalf of Ven H 
Sent: Friday, August 21, 2020 1:54 PM
To: jenkinsci-users@googlegroups.com 
Subject: Re: Ignore Post Build Job failure in Jenkins Pipeline

Thanks a lot once again, Jeremy. Just curious. Are there any major functional 
differences between Declarative and Scripted? I thought there are only minor 
differences. So, if something works in Scripted approach, it should work in 
Declarative approach as well, right?

With that said, you have provided another option "Propagate". Can I use both 
"wait" & "propagate"? Sorry for being naive, but I am new to Pipeline scripting.

Regards,
Venkatesh


On Fri, Aug 21, 2020 at 11:13 PM jeremy mordkoff 
mailto:jeremy.mordk...@riftio.com>> wrote:
I only know scripted, which has 3 options:

wait for completion and propagate errors:
build job: 'lp_systemtest3/master'

no propagate errors
build propagate: false, job: 'lp_systemtest3/master'

don't wait
build wait: false, job: 'lp_systemtest3/master'

On Friday, August 21, 2020 at 1:05:08 PM UTC-4 
venh...@gmail.com<mailto:venh...@gmail.com> wrote:
Hi Jeremy,

Thanks a lot for your response. I am using a Declarative approach 
(Jenkinsfile). Could you please provide some more details on the don't wait 
option, if possible? JobA runs successfully and triggers JobB from Post build. 
But if JobB fails, it marks JobA also as failed even though JobA ran 
successfully. I want JobA to trigger JobB on Post success condition and then 
not fail JobA, if JobB fails, preferably without try/catch blocks.

Regards,
Venkatesh


On Fri, Aug 21, 2020 at 9:31 PM jeremy mordkoff  wrote:
Are you using scripted or declarative? I will assume scripted since that's all 
I know :)

There's a don't wait option. Or you could wrap the call in a try/catch. Or you 
could save currentBuild.result before calling job B and restore it after



On Friday, August 21, 2020 at 5:09:57 AM UTC-4 venh...@gmail.com wrote:
Hi,

I have a JobA defined in Jenkins Pipeline. When JobA builds successfully, I 
trigger JobB from the Post step. But, if JobB fails in some step, it marks JobA 
also as Failed.

Is there a way (some setting or option) to ignore the failure in JobB so that 
it doesn't fail JobA (since it built successfully)?

Regards,
Venkatesh

--
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/2ff128f9-90d4-496c-942e-321101096fa3n%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/2ff128f9-90d4-496c-942e-321101096fa3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/70e3e916-6a1d-47fd-8ab6-4544575c5d6fn%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/70e3e916-6a1d-47fd-8ab6-4544575c5d6fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-users/WtSGFeRvRS4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPp28eqeGVr75mKSk9x5yFoqbbx%2BD%3DM-qV7z_g7fau%2BSeyRf7g%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-users/CAPp28eqeGVr75mKSk9x5yFoqbbx%2BD%3DM-qV7z_g7fau%2BSeyRf7g%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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, sen

Re: Jenkins Integration with LDAP - Testing Connection Fails

2020-08-21 Thread jeremy mordkoff
sounds like the user is valid but not a member of any groups. Is that 
possible? 



On Thursday, August 20, 2020 at 1:28:21 PM UTC-4 Mk wrote:

> Hi Team,
>
> I am trying to configure LDAP(AD) Authentication in our Jenkins, Below is 
> my configuration settings, But test LDAP connection is failing.
>
> Environment:-
> Jenkins Version - 2.235.5(LTS)
> LDAP Plugin - 1.24
>
>
> Server - ldap://ad-ldap-server.com
> root DN: DC=domain,DC=com
> User search base: OU=Users,OU=Division,OU=Team,DC=domain,DC=com
> User search filter: sAMAccountName={0}
> Group search base: OU=Users,OU=Division,OU=Team,DC=domain,DC=com
> Group search filter: (&(objectclass=group)(cn={0}))
> Group membership
>   Group membership filter - 
> (&(objectCategory=group)(member:1.2.840.113556.1.4.1941:={0}))
> Manager DN: CN=jenkins,OU=Users,OU=Division,OU=Team,DC=domain,DC=com
> Manager Password: password
> Display Name LDAP attribute: displayname
> Email Address LDAP attribute: mail
>
>
> Error Message:-
>
> [image: 1.png]
>
> Please let me know what is missing in my configuration?. 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/b7a62833-43ca-4a9b-b229-dcba2b1a145an%40googlegroups.com.


Re: Ignore Post Build Job failure in Jenkins Pipeline

2020-08-21 Thread jeremy mordkoff
I only know scripted, which has 3 options:

wait for completion and propagate errors: 
build job: 'lp_systemtest3/master'

no propagate errors
build propagate: false, job: 'lp_systemtest3/master'

don't wait
build wait: false, job: 'lp_systemtest3/master'

On Friday, August 21, 2020 at 1:05:08 PM UTC-4 venh...@gmail.com wrote:

> Hi Jeremy,
>
> Thanks a lot for your response. I am using a Declarative approach 
> (Jenkinsfile). Could you please provide some more details on the don't wait 
> option, if possible? JobA runs successfully and triggers JobB from Post 
> build. But if JobB fails, it marks JobA also as failed even though JobA ran 
> successfully. I want JobA to trigger JobB on Post success condition and 
> then not fail JobA, if JobB fails, preferably without try/catch blocks.
>
> Regards,
> Venkatesh
>
>
> On Fri, Aug 21, 2020 at 9:31 PM jeremy mordkoff  
> wrote:
>
>> Are you using scripted or declarative? I will assume scripted since 
>> that's all I know :)
>>
>> There's a don't wait option. Or you could wrap the call in a try/catch. 
>> Or you could save currentBuild.result before calling job B and restore it 
>> after
>>
>>
>>
>> On Friday, August 21, 2020 at 5:09:57 AM UTC-4 venh...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I have a JobA defined in Jenkins Pipeline. When JobA builds 
>>> successfully, I trigger JobB from the Post step. But, if JobB fails in some 
>>> step, it marks JobA also as Failed.
>>>
>>> Is there a way (some setting or option) to ignore the failure in JobB so 
>>> that it doesn't fail JobA (since it built successfully)?
>>>
>>> Regards,
>>> Venkatesh
>>>
>> -- 
>> 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/2ff128f9-90d4-496c-942e-321101096fa3n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/2ff128f9-90d4-496c-942e-321101096fa3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/70e3e916-6a1d-47fd-8ab6-4544575c5d6fn%40googlegroups.com.


occasional exception from junit call

2020-08-21 Thread jeremy mordkoff
I use scripted pipelines with a library. The master and the slaves are 
running in ubuntu 16.04 docker containers. 

About a week ago we started getting occasional failures from this call: 

junit testResults: ".build/ub18_debug/artifacts/systemtest/*xml"

There are about 60 junit xml files in that directory. 

Since then I have tried updating jenkins to 2.251 (including a container 
restart), which warned me about a place where a function marked 
NONCPS was calling CPS code, so I fixed that and restarted all of the 
slaves. But the problem persists. I would estimate it happens 30% 
of the time. 

For now I have wrapped that call in a try block that sets the build result 
to UNSTABLE if the call fails. But not having the test results 
available is messing up all of our reporting tooks. I also tried reordering 
some code thinking that maybe the previous step had caused the 
problem but the problem stayed with the junit call. 

I am willing to try just about anything to get past this issue. Any 
suggestions at all are welcome.





The Jenkins console for that job reports

[Pipeline] junit
Recording test results
java.io.IOException: Unexpected termination of the channel
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
java.io.EOFException
at 
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353)
at 
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:804)
at java.io.ObjectInputStream.(ObjectInputStream.java:301)
at hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:49)
at hudson.remoting.Command.readFrom(Command.java:140)
at hudson.remoting.Command.readFrom(Command.java:126)
at 
hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to j7-ssh2
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
at hudson.remoting.Request.call(Request.java:202)
at hudson.remoting.Channel.call(Channel.java:954)
at hudson.FilePath.act(FilePath.java:1069)
at hudson.FilePath.act(FilePath.java:1058)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:114)
at 
hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:137)
at 
hudson.tasks.junit.JUnitResultArchiver.parseAndAttach(JUnitResultArchiver.java:167)
at 
hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:52)
at 
hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:25)
at 
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused: hudson.remoting.RequestAbortedException
at hudson.remoting.Request.abort(Request.java:340)
at hudson.remoting.Channel.terminate(Channel.java:1038)
at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)
Finished: FAILURE



The slave's log reports 

Aug 11, 2020 4:19:21 AM org.jenkinsci.remoting.util.AnonymousClassWarnings 
warn
WARNING: Attempt to (de-)serialize anonymous class 
org.jenkinsci.plugins.durabletask.FileMonitoringTask$FileMonitoringController$1;
 
see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
Aug 12, 2020 7:55:32 AM hudson.slaves.ChannelPinger$1 onDead
INFO: Ping failed. Terminating the channel channel.
java.io.IOException: Broken pipe
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:313)
at 
hudson.remoting.StandardOutputStream.write(StandardOutputStream.java:83)
at 
hudson.remoting.ChunkedOutputStream.sendFrame(ChunkedOutputStream.java:89)
at 
hudson.remoting.ChunkedOutputStream.sendBreak(ChunkedOutputStream.java:62)
at 
hudson.remoting.ChunkedCommandTransport.writeBlock(ChunkedCommandTransport.java:46)
at 
hudson.remoting.AbstractSynchronousByteArrayCommandTransport.write(AbstractSynchronousByteArrayCommandTransport.java:46)
at hudson.remoting.Channel.send(Channel.java:766)
at hudson.remoting.Request.callAsync(Request.java:237)
at hudson.remoting.Channel.callAsync(Channel.java:1032)
at hudson.remoting.PingThread.p

Re: Ignore Post Build Job failure in Jenkins Pipeline

2020-08-21 Thread jeremy mordkoff
Are you using scripted or declarative? I will assume scripted since that's 
all I know :)

There's a don't wait option. Or you could wrap the call in a try/catch. Or 
you could save currentBuild.result before calling job B and restore it after



On Friday, August 21, 2020 at 5:09:57 AM UTC-4 venh...@gmail.com wrote:

> Hi,
>
> I have a JobA defined in Jenkins Pipeline. When JobA builds successfully, 
> I trigger JobB from the Post step. But, if JobB fails in some step, it 
> marks JobA also as Failed.
>
> Is there a way (some setting or option) to ignore the failure in JobB so 
> that it doesn't fail JobA (since it built successfully)?
>
> Regards,
> Venkatesh
>

-- 
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/2ff128f9-90d4-496c-942e-321101096fa3n%40googlegroups.com.


Re: Piple line for multiple projects sharing the same SVN repository

2020-08-19 Thread jeremy mordkoff
You need 99 jobs for the 99 programs, but what about the libraries? I 
assume a program will depend on one or more libraries. Are there 
dependencies between libraries? (this is common and not a problem if it is 
understood.) Are there dependencies between programs?  (this would be bad.)

How fast is your job if there are no changes? Are the artifacts available 
so that the build system detects that nothing needs to be done quickly? If 
so, then you could consider a single jenkins job that iterated over the 
libraries in the correct order and then over the programs.  This would by 
default use a single workspace. It has the advantage of only scanning each 
library once. 

otherwisethere is actually nothing that says the build has to use the 
workspace checked out by jenkins. I suspect your predecessor had extra 
workspaces that he reused for every build. Have you found these so you know 
they exist?  Are there containers involved? It's possible the workspaces 
are not getting mounted inside the container.

If you are forced to have many jenkins jobs, then I would put a JenkinsFile 
in every program dir. whether they are scripted or declarative is up to 
you. I like scripted so much I rewrote everything my predecessor did 
because he used all declarative (and had terrible program structure). 

As far as ${EXECUTOR_NUMBER} not getting expanded, this could be an issue 
of timing. It's possible that whatever process is doing that expansion is 
before an executor is chosen. But the expansion in a script. Like I said, 
the build doesn't have to use the workspace created by jenkins.

On Wednesday, August 19, 2020 at 6:47:23 PM UTC-4 Anton Shepelev wrote:

> jeremy mordkoff:
>
> > I'm having a little trouble understanding exactly what you
> > are asking.
>
> I am sorry for an insufficiently clear description. Let me
> try again.
>
> Since our .NET projects are highly interdependent, we
> maintain them in a single SVN repository with a strucure
> like this:
>
> trunk
> programs
> program1
> program2
> ...
> program99
> library
> library1
> library2
> ...
> library999
>
> where each program depends on one of more libraries. I want
> to create 99 Jenkins items, using declarative pipelines,
> each building one of the 99 programs. We have several nodes
> registered on different machines with different
> environments. I want each node to checkout the SVN trunk
> exactly once and use that working copy in each pipeline to
> build each individual program. I do not understand how to
> set it up in Jenkins because each pipeline seems to use its
> own SVN working directory.
>
> The current configurtion, setup by a previous maintainer,
> relies on the Jenkins MSBuild plugin, and manages somehow to
> retain a single SVN working direcotory per node and
> executor, whose name is stored in a Jenkins global property
> SVN_REPO with the value `ExecutorRepo_${EXECUTOR_NUMBER}.'
> When I tried to specify this property in the "Local module
> directory" for the pipeline, the `${EXECUTOR_NUMBER}' part
> was left unexpanded in the actual path to the SVN working
> directory. I don't understand how and why it is expanded
> with the MSBuild plugin but is not with the declarative
> pipeline.
>
> > I think you are asking if it is possible to trigger
> > multiple builds in a single workspace.
>
> Yes.
>
> > If you use a single pipeline, this is trivial.
>
> As I said above, I prefer one pipeline per program, for the
> convenience of having a dedicated page on the Jenkins web-
> interface for each project and the ability to change the
> settings for building individual projects independently of
> other projects. It this can be achieved with a single
> pipelike, I should like to know how.
>
> > So perhaps you should consider writing a single pipeline
> > that iterates over all libraries and projects and builds
> > each one in turn.
>
> Is such iteration possible with the declarative syntax, or
> shall I switch to the scripted pipeline?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/243532db-2a12-499b-994c-eabb9c67b58bn%40googlegroups.com.


Re: Piple line for multiple projects sharing the same SVN repository

2020-08-17 Thread jeremy mordkoff
I'm having a little trouble understanding exactly what you are asking. I 
think you are asking if it is possible to trigger multiple builds in a 
single workspace. If you use a single pipeline, this is trivial. 

So perhaps you should consider writing a single pipeline that iterates over 
all libraries and projects and builds each one in turn.  




On Saturday, August 15, 2020 at 6:13:33 PM UTC-4 Anton Shepelev wrote:

> Hello, all
>
> We maintain hundreds of interdependent .NET libraries and programs
> that typically reference tenths of those libraries each in a single
> SVN repository. Maybe it is a non-standard, and even not a
> recommended approach, but creating a repository per program or
> library would introduce its own problems, especially because we use
> source (project) references by relative path instead of binary
> references.
>
> I have inherited a Jenkins configuration from a previous
> maintainer, whom I can no longer contact. He configured the
> building of each project not by means of pipelines, but entirely
> through the web-interface, as Freestyle projects with an MSBuild
> step. I think it is not a standard Jenkins functionality but a
> feature of the MSBuild plugin: https://plugins.jenkins.io/msbuild/ .
>
> He configured Jenkins so that it should build each project in the
> same local SVN mirror, in order not to checkout our unified
> repository for each of the many projects. He created a Jenkins
> global property `SVN_REPO' with the value
> `ExecutorRepo_${EXECUTOR_NUMBER}',
> but I can't understand how and where it is referenced, expanded, and
> used instead of the default working directory of each project. Can
> you help me to find that out? When I tried to specify that variable
> as "Local module directory" in the pipeline configuration,
> ${EXECUTOR_NUMBER} was not expanded, perhaps because that settings
> is expanded before an executor is chosen.
>
> Is there a way to confire multiple pipelines to reuse the same
> global SVN working directory on each node? For example, supposing I
> have this SVN repository:
>
> trunk
> programs
> program1
> program2
> ...
> program99
> library
> library1
> library2
> ...
> library99
>
> I want each agent to checkout trunk exactly once and build each
> program inside the same working directory. Is it possible?
>
>

-- 
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/3f2b22fa-041e-4340-b290-f49ee2d02c10n%40googlegroups.com.


Re: Pipeline design question

2020-08-14 Thread jeremy mordkoff
How do you maintain and verify backwards compatibility with older releases 
if you keep your devops code in a separate repo? I keep my devops code in 
the same repo as the product code so that I know I can always go back and 
rebuild an older release and get exactly the same results. 

The only exceptions to this is the code and config files for accessing the 
infrastructure servers, such as my debian mirrors and docker repo in 
artifactory, including the URLS, the gpg keys and CA certs needed. For this 
I generate a base docker image from which all of my other images are 
derived. This base image has all of these things pre-configured plus the 
latest security updates for all packages (debian, pypi and npm). I can go a 
month without rebuilding it and then rebuild it 5 times in a week. I run a 
build and test for all active branches once a week just to be sure any 
changes to this base image haven't introduced any new issues. It is very 
rare that this break an old branch and not master, in fact I only remember 
this happening once. 

My point is my build has changed dramatically over the years and if I had 
my devops code in it's own repo, I would have to create branches to match 
the product branches anyway so why not keep it all together? 

On Friday, August 14, 2020 at 1:30:49 PM UTC-4 Jérôme Godbout wrote:

> **
> So you add all these repositories to your jobs and then they are run each 
> time one of those repositories is updated, right?
>
> Well, I either have unit tests build every night more into scheduled build 
> into Jenkins pipeline options or manually for the distribution build they 
> are done manually with a tag number injected by the user.
> I do this because I don't have enough PC performance to run and build on 
> every commit. But in an ideal world I would put a webhook on my repos to 
> trig the Jenkins build when a push is done into the right branch. The 
> Jenkins common library are always taking the head of the master branch, 
> this should always work and have the most recent functions and bug fix (I 
> do not break backward compatibility and if I do, I update all the 
> Jenkinsfile right away). The setup and deploy is not large enough over here 
> to bother just yet, but you could easily use branch to prevent backward 
> compatibility issues with the common library.
>
> **
> How do things work on slaves? Is each repos cloned in its own directory in 
> the workspace directory?
>
> The master scheckout the pipelines repos to fetch the Jenkinsfile from 
> SCM. That repos only contain that file (or many of them) along with build 
> specific groovy/shell... scripts to help the build process. The first thing 
> it does on the slave node is to checkout the common tools and import the 
> needed one inside a subfolder (Amotus_Jenkins/).
>
> Once the tools are loaded, I do checkout the source and start the build as 
> it normally should. I use ENV var to set the branch or other options that 
> will be used to build that repos. Those env are injected by Jenkins 
> parameters options.
>
> The resulting artifacts are sent to artifactory/appcenter/ftp... and test 
> results are analyze right into Jenkins.
>
> That way, the only thing Jenkins known are credentials to repos and the 
> pipeline repos and parameters ask to user. The rest is done inside the 
> pipeline repos (unit test/build/deploy jenkinsfile). The source repos 
> doesn't even known if any CI exist on him, so If I want to build an old 
> version with a recent CI or change my CI it will still work.
>
> The checkout syntax into Jenkinsfile is a bit painful if you have git 
> submodules, but it will track the changes with the right plugins. My first 
> few stage mostly look like this, it's a shame that nearly all my 
> jenkinsfile file look like this but it straight forward once you see it 
> once:
>
> node("PHP && PHPComposer") {
> def amotusModules = [:]; // this dictionary hold the tools modules files I 
> made generic for all projects
> def amotusRepos = [
> [
> name: 'Repos Name'
> , url: 'https://bitbucket.org/repos2.git'
> , branch: "${params.AMOTUS_BRANCH}"
> , path: 'SourceRepos2'
> ]
> ];
>
> stage('Checkout Tools') {
> dir("Amotus_Jenkins") {
> checkout([$class: 'GitSCM'
> , branches: [[name: 'master']]
> , browser: [$class: 'BitbucketWeb', repoUrl: '
> https://bitbucket.org/repos.git']
> , doGenerateSubmoduleConfigurations: false
> , extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, 
> parentCredentials: true, recursiveSubmodules: true, reference: '', 
> trackingSubmodules: false], [$class: 'CleanCheckout']]
> , submoduleCfg: []
> , userRemoteConfigs: [[credentialsId: 'BitBucketAmotus', url: '
> https://bitbucket.org/repo.git']]
> ]);
> }
> }
>
> stage('Load option') {
> dir(pwd() + "/Amotus_Jenkins/"){
> // Load basic file first, then it will load all others options with their 
> dependencies
> load('JenkinsBasic.Groovy').InitModules(amotusModules);
> amotusModules['basic'].LoadFi

Re: Pipeline design question

2020-08-11 Thread jeremy mordkoff
I try to make the calls in my top level jenkinsfile atomic and complete, 
i.e. each one performs a single function. By using long, descriptive names 
I can avoid the need for lots of comments. It also makes building new 
pipelines easy and encourages reuse across files, stages and steps. If I 
see several sh calls in a row in a jenkinsfile, I am immediately looking at 
what they are trying to accomplish and if they will always be executed 
together, then I move them to a script or function. I do make my scripts 
slightly wordy. I find that 90% of the time CI problems are transient and 
by the time you enable debugging, the problem can be gone. A good logging 
convention is a must so that you can run grep on a log file and get a high 
level summary.

For each function, I look at whether it is likely to have to change when 
the product code changes versus when the devops code or the infrastructure 
changes.  If it is coupled to the product code (e.g. scripts. makefiles, 
dockerfiles, etc), then I create a shell script and store it in the CI 
folder with the other product code.  Everything else goes into scripts in 
the devops folder or groovy functions in the devops library file.  The idea 
is that developers are responsible for maintaining the CI folder and I own 
the devops folder. E.g. if the product has a new dependency on a debian 
package, it is up to dev to add it to the dockerfile, not me. But if I move 
my debian mirror into artifactory, that is on me.

bottom line .. make your top level jenkinsfile readable and isolated from 
the nitty-gritty details

my $0.02 


On Tuesday, August 11, 2020 at 12:01:09 PM UTC-4, Jérôme Godbout wrote:
>
> Hi, 
> this is my point of view only,but using a single script (that you put into 
> your repos make it easier to perform the build, I put my pipeline script 
> into a separated folder). But you need to make sure your script is verbose 
> enough to see where it has fail if anything goes wrong, sinlent and without 
> output long script will be hard to understand where it has an issue with 
> it. 
>
> Using multiple sh make it easier to see where it does fail since Jenkins 
> will display every sh invoke. 
>
> You can also put a function that will run some sh command into groovy and 
> load that file and execute a command from it. This leave more flexibility 
> from jenkins (decouple jenkins from the task to do) but you still can 
> invoke multiple sh command into that groovy script. So your repos can can 
> contain a groovy entry point that the pipeline will load and invoke that 
> script can call sh, sh scripts and/or groovy scripts as it please. 
>
> pipeline script --> repos groovy script --> calls (sh, groovy, shell 
> scripts...) 
>
> That avoid high maintance jenkins pipeline, the repos is more self aware 
> of his needs and can more easily changes between version. 
>
> I for one, use 3+ repos. 
> 1- The source code repos 
> 2- The pipeline and build script repos (this can evolve aside form the 
> source, so my build method can change and be applied to older source 
> version, I use branch/tag when backward compatibility is broken or a 
> specific version is needed for a particualr source branch) 
> 3- My common groovy, scripts tooling between my repos 
> 4- (optional) my unit tests are aside and can be run on multiple versions 
>
> This work well, I wish the shared library was more flexible and that I 
> could more easily do file manipulation into groovy, but I managed some 
> platform agnostic functions for most file/folder/path operations that I 
> reused between project. This make my pipeline script free of thousand of 
> if(isUnix()) and the like. My pipeline look the same for either 
> MacOS/Windows/Linux. 
>
> Hope this can help you decide or plan you build architecture. 
>
> Jerome 
>
> -Original Message- 
> From: jenkins...@googlegroups.com  <
> jenkins...@googlegroups.com > On Behalf Of Sébastien 
> Hinderer 
> Sent: August 11, 2020 10:33 AM 
> To: jenkins...@googlegroups.com  
> Subject: Pipeline design question 
>
> Dear all, 
>
> When a pipeline needs to run a sequence of several shell commands, I see 
> several ways of doing that. 
>
> 1. Several "sh" invocations. 
>
> 2. One "sh" invocation that contains all the commands. 
>
> 3. Having each "sh" invocation in its own step. 
>
> 4. Putting all the commands in a script and invoking that script through 
> the sh step. 
>
> Would someone be able to explain the pros and cons of these different 
> approaches and to advice when to use which? Or is there perhaps a reference 
> I should read? 
>
> Thanks, 
>
> Sébastien. 
>
> -- 
> 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 jenkins...@googlegroups.com . 
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/20200811143317.GB117214%40om.localdomain.
>  
>
>

-- 

Re: Separation of JUnit results by TestSuite

2020-08-06 Thread jeremy mordkoff
yes, exactly. I post process mine to remove the hostname from the class 
because my tooling generates the class based on the path. 

On Thursday, August 6, 2020 at 9:27:32 AM UTC-4, christop...@googlemail.com 
wrote:
>
> You mean postprocessing the result files to fake different class names to 
> workaround the laking separation of the testsuite by jenkins?
>
> jeremy@riftio.com schrieb am Mittwoch, 5. August 2020 um 18:37:56 
> UTC+2:
>
>> I believe this construct in the junit xml files can be safely modified to 
>> force jenkins to see the test results as two separate tests
>>
>> >
>>
>>
>>
>>
>> On Wednesday, August 5, 2020 at 2:38:26 AM UTC-4, 
>> christop...@googlemail.com wrote:
>>>
>>> Hi,
>>>
>>> I found a strange phenomenon in test result display of jenkins. I had 
>>> two tests with very instable test results, good, bad, bad, good, good, good 
>>> and every time I opened the display, the sequence was different. But when 
>>> opening the tests I found out all of them either failed or passed.
>>>
>>> What I found out:
>>> I am compiling the same code as a static and a dynamic link library and 
>>> I am calling the same Unit tests for both variants. Thus, the test names by 
>>> class and name are identically but they are separated by the name of the 
>>> testsuite.
>>> To explain the problem above: tests for one of the variants failed while 
>>> the other passed. That might lead to a race condition while displaying the 
>>> test results.
>>>
>>> Now I am wondering why Jenkins does not respect the testsuite while 
>>> evaluation the test results.
>>> The tools I am working with:
>>> I am writing xunit-style test results as xml.
>>> I am parsing these test results with xunit plugin using the tool JUnit.
>>>
>>> Some of the tests also are implemented with GoogleTest but none of these 
>>> is causing problems (or at least I am not aware).
>>>
>>> Is there any idea out there for me how to progess here? Can I fix this 
>>> by myself with selection of the tools or their parameters or is this an 
>>> issue in jenkins or one of the plugins that loose or disregard the property 
>>> 'testsuite' during evaluation?
>>>
>>> May thank in advance!
>>> BR,
>>> Christoph
>>>
>>

-- 
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/450368b9-a101--8d06-a6207bf9f336o%40googlegroups.com.


Re: Separation of JUnit results by TestSuite

2020-08-05 Thread jeremy mordkoff
I believe this construct in the junit xml files can be safely modified to 
force jenkins to see the test results as two separate tests


> Hi,
>
> I found a strange phenomenon in test result display of jenkins. I had two 
> tests with very instable test results, good, bad, bad, good, good, good and 
> every time I opened the display, the sequence was different. But when 
> opening the tests I found out all of them either failed or passed.
>
> What I found out:
> I am compiling the same code as a static and a dynamic link library and I 
> am calling the same Unit tests for both variants. Thus, the test names by 
> class and name are identically but they are separated by the name of the 
> testsuite.
> To explain the problem above: tests for one of the variants failed while 
> the other passed. That might lead to a race condition while displaying the 
> test results.
>
> Now I am wondering why Jenkins does not respect the testsuite while 
> evaluation the test results.
> The tools I am working with:
> I am writing xunit-style test results as xml.
> I am parsing these test results with xunit plugin using the tool JUnit.
>
> Some of the tests also are implemented with GoogleTest but none of these 
> is causing problems (or at least I am not aware).
>
> Is there any idea out there for me how to progess here? Can I fix this by 
> myself with selection of the tools or their parameters or is this an issue 
> in jenkins or one of the plugins that loose or disregard the property 
> 'testsuite' during evaluation?
>
> May thank in advance!
> BR,
> Christoph
>

-- 
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/c04ba5c7-d7e7-4176-a43e-41347a8636eco%40googlegroups.com.


Re: Help required: jenkins SSH connectivity issue

2020-08-04 Thread jeremy mordkoff
--r--  1 ccpuser ccpadmin  5418 Aug  4 14:58 test2-harbor123.pfx
> -rw-r--r--  1 ccpuser ccpadmin  7382 Aug  4 14:58 test2-harbor123.key
> -rw-r--r--  1 ccpuser ccpadmin  5465 Aug  4 14:58 test2-harbor123.crt
> -rw-r--r--  1 ccpuser ccpadmin  5418 Aug  4 14:58 test2-harbor.pfx
> -rw-r--r--  1 ccpuser ccpadmin  7382 Aug  4 14:58 test2-harbor.key
> -rw-r--r--  1 ccpuser ccpadmin  5465 Aug  4 14:58 test2-harbor.crt
> namespace/harbor created
> ./test2-harbor54321.pfx is certpath
> test2-harbor54321 is basename
> test2-harbor54321 is new secret name for harbor
> ./test2-harbor54321.key key file generated
> ./test2-harbor54321.crt crt file generated
> key filename is test2-harbor54321.key
> crt filename is test2-harbor54321.crt
> core: test2-harbor.tank.local
> notary: test2-harbor.tank.local
> secretName: test2-harbor54321
> values.yaml is updated
> secret/test2-harbor54321 created
>
> NAME: harbor
> LAST DEPLOYED: Tue Aug  4 14:58:39 2020
> NAMESPACE: harbor
> STATUS: deployed
> REVISION: 1
> TEST SUITE: None
> NOTES:
> Please wait for several minutes for Harbor deployment to complete.
> Then you should be able to visit the Harbor portal at 
> https://core.harbor.domain
> For more details, please visit https://github.com/goharbor/harbor
> Harbor certificate isntallation done
> Mail notification sent
>  
> Build step 'Execute shell' marked build as failure
> Finished: FAILURE
>
>  
>
> On Mon, Aug 3, 2020 at 3:05 PM jeremy mordkoff  > wrote:
>
>> The same solutions offered for client to host should apply for local 
>> system to host. Did you add the local system's public ssh key to the host's 
>> authorized key file? 
>>
>> I have no clue what a "crumb" is
>>
>>
>> On Monday, August 3, 2020 at 2:14:59 AM UTC-4, Sakshi Rathore wrote:
>>>
>>> could you please help here? 
>>>
>>> On Fri, Jul 31, 2020 at 3:52 PM Sakshi Rathore  
>>> wrote:
>>>
>>>>  thanks a lot, i just solved permission denied issue and able to ssh 
>>>> from client to host
>>>> 1. 
>>>> jenkins@harbortest-master-gro-a7c3cedfab:~/.ssh$ ssh 
>>>> ccpuser@harbortest-master-gro-a7c3cedfab
>>>> Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-64-generic x86_64)
>>>>
>>>>  * Documentation:  https://help.ubuntu.com
>>>>  * Management: https://landscape.canonical.com
>>>>  * Support:https://ubuntu.com/advantage
>>>>
>>>>  * Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
>>>>sudo snap install microk8s --channel=1.19/candidate --classic
>>>>
>>>>https://www.microk8s.io/ has docs and details.
>>>> This system has been minimized by removing packages and content that are
>>>> not required on a system that users do not log into.
>>>>
>>>> To restore this content, you can run the 'unminimize' command.
>>>> Last login: Fri Jul 31 13:31:29 2020 from 10.36.174.37
>>>> ccpuser@harbortest-master-gro-a7c3cedfab:~$ cd .ssh/
>>>>
>>>>  2. But in jenkins console i am still getting cant connect to the 
>>>> server :
>>>>
>>>> [image: image.png]
>>>>
>>>>
>>>> [image: image.png]
>>>>
>>>> and still from my local system to host i cant ssh directly:
>>>>
>>>> sakshi_rathore@MCN234 MINGW64 ~/.ssh (master)
>>>> $ ssh ccp...@10.32.141.35
>>>> ccp...@10.32.141.35: Permission denied 
>>>> (publickey,keyboard-interactive).
>>>>
>>>> Could you please also suggest for this. 
>>>>
>>>> On Fri, Jul 31, 2020 at 3:18 PM jeremy mordkoff  
>>>> wrote:
>>>>
>>>>> ssh is picky about permissions. 
>>>>>
>>>>> make sure the .ssh directory itself has perms 770 and any files in 
>>>>> that folder have perms 660 and that they are all owned by the correct 
>>>>> user 
>>>>> on both the client and server. 
>>>>>
>>>>> try adding *-o identitiesOnly=yes* on the ssh client command line. 
>>>>> There is a server config that limits the number of failed connects. 
>>>>>
>>>>> try running the client in verbose mode (-v or -vv) -- every now and 
>>>>> then a message shows up there with a hint. 
>>>>>
>>>>> if you're still stuck, set the server logging to debug and check 
>>>>> there. 

Re: Help required: jenkins SSH connectivity issue

2020-08-03 Thread jeremy mordkoff
The same solutions offered for client to host should apply for local system 
to host. Did you add the local system's public ssh key to the host's 
authorized key file? 

I have no clue what a "crumb" is


On Monday, August 3, 2020 at 2:14:59 AM UTC-4, Sakshi Rathore wrote:
>
> could you please help here? 
>
> On Fri, Jul 31, 2020 at 3:52 PM Sakshi Rathore  > wrote:
>
>>  thanks a lot, i just solved permission denied issue and able to ssh from 
>> client to host
>> 1. 
>> jenkins@harbortest-master-gro-a7c3cedfab:~/.ssh$ ssh 
>> ccpuser@harbortest-master-gro-a7c3cedfab
>> Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-64-generic x86_64)
>>
>>  * Documentation:  https://help.ubuntu.com
>>  * Management: https://landscape.canonical.com
>>  * Support:https://ubuntu.com/advantage
>>
>>  * Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
>>sudo snap install microk8s --channel=1.19/candidate --classic
>>
>>https://www.microk8s.io/ has docs and details.
>> This system has been minimized by removing packages and content that are
>> not required on a system that users do not log into.
>>
>> To restore this content, you can run the 'unminimize' command.
>> Last login: Fri Jul 31 13:31:29 2020 from 10.36.174.37
>> ccpuser@harbortest-master-gro-a7c3cedfab:~$ cd .ssh/
>>
>>  2. But in jenkins console i am still getting cant connect to the server :
>>
>> [image: image.png]
>>
>>
>> [image: image.png]
>>
>> and still from my local system to host i cant ssh directly:
>>
>> sakshi_rathore@MCN234 MINGW64 ~/.ssh (master)
>> $ ssh ccp...@10.32.141.35 
>> ccp...@10.32.141.35 : Permission denied 
>> (publickey,keyboard-interactive).
>>
>> Could you please also suggest for this. 
>>
>> On Fri, Jul 31, 2020 at 3:18 PM jeremy mordkoff > > wrote:
>>
>>> ssh is picky about permissions. 
>>>
>>> make sure the .ssh directory itself has perms 770 and any files in that 
>>> folder have perms 660 and that they are all owned by the correct user on 
>>> both the client and server. 
>>>
>>> try adding *-o identitiesOnly=yes* on the ssh client command line. 
>>> There is a server config that limits the number of failed connects. 
>>>
>>> try running the client in verbose mode (-v or -vv) -- every now and then 
>>> a message shows up there with a hint. 
>>>
>>> if you're still stuck, set the server logging to debug and check there. 
>>> *Always 
>>> keep one ssh session open as root to the server when changing the ssh 
>>> server config file (usually /etc/ssh/sshd_config)*
>>>
>>>
>>>
>>> On Friday, July 31, 2020 at 4:09:19 AM UTC-4, sakshira...@gmail.com 
>>> wrote:
>>>>
>>>>
>>>> thanks very much for all the advice , i tried in the given way but 
>>>> while conencting to the server to the client using manual ssh 
>>>>
>>>> i get below error everytime:
>>>>
>>>> ccpuser@harbortest-master-gro-a7c3cedfab:~$ ssh ccp...@10.32.141.35
>>>> The authenticity of host '10.32.141.35 (10.32.141.35)' can't be 
>>>> established.
>>>> ECDSA key fingerprint is 
>>>> SHA256:bSeIr7zG7863687fvTDsZrG3Kc77pUXMLZKwu4YMRfrY.
>>>> Are you sure you want to continue connecting (yes/no)? yes
>>>> Warning: Permanently added '10.32.141.35' (ECDSA) to the list of known 
>>>> hosts.
>>>> ccp...@10.32.141.35: Permission denied 
>>>> (publickey,keyboard-interactive). 
>>>> respective keys have been already added , public key to 
>>>> /home/.ssh/authorized_key 
>>>> ialso tried to add private key identity as part of troubleshoot
>>>>
>>>> ccpuser@harbortest-master-gro-a7c3cedfab:~/.ssh$ ssh-add ~/.ssh/id_rsa
>>>> Identity added: /home/ccpuser/.ssh/id_rsa (/home/ccpuser/.ssh/id_rsa)
>>>>
>>>>
>>>> i have also tried to disable host key checking in etc/ssh/ssh_config 
>>>> file
>>>> StrictHostKeyChecking no
>>>>
>>>> if i try to avoid permission denied error google suggestion leads me to 
>>>> password authentication and i want to do ssh login 
>>>>
>>>> I have tried everything to get it owkr adding ssh key authentication 
>>>> tojenkins server in credentials section and ssh-sites but nothing seems 
>>>> work

Re: How to throw an error if a parameter is empty?

2020-07-31 Thread jeremy mordkoff
@Haibinh is that a bash answer? 
@chencho -- are you looking for a solution in bash, or groovy? Declarative 
or scripted? 





On Friday, July 31, 2020 at 9:16:52 AM UTC-4, Haibinh Nguyen wrote:
>
> Hi, 
> How about this: 
>
> env.FIELD1  = params.FIELD1 
> switch(FIELD1) { 
> case "ABCD": 
> env.p4 = '/usr/bin/p4' 
> env.awk = 'awk' 
>  break 
>  case "":: 
>currentBuild.result = 'SUCCESS' 
>return 
>  break 
> } 
>
>
> On Fri, Jul 31, 2020 at 12:34 AM chencho m-a  > wrote: 
> > 
> > Hi, 
> > 
> > I have some parameters and i would like to check if they are empty, and 
> if so, dont start the build. 
> > 
> > Any clue? 
> > 
> > Thank you 
> > 
> > -- 
> > 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 jenkins...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/1c326abd-4cf2-44f3-9480-f1b9f85bcd70n%40googlegroups.com.
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/552471d5-c855-44ed-a952-ef515fee2702o%40googlegroups.com.


Re: Help required: jenkins SSH connectivity issue

2020-07-31 Thread jeremy mordkoff
>>
>>>
>>> echo "check1"
>>>
>>> ssh -i $SSHKEY_PATH ccp...@10.32.141.35 /bin/bash <>>
>>> this ssh key belongs to server login
>>>
>>> when i try to execute this using jenkins build:
>>> Warning: Identity file 
>>> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>>>  
>>> not accessible: No such file or directory.
>>> Host key verification failed.
>>> lost connection
>>> I have generated ssh key in ssh server for jenkins and put public key 
>>> into home/.ssh/authorized_keys location  and private key for ssh setup in 
>>> jenkins but i am not able to connect to the ssh server
>>> i also tried simple ssh to the server in build step but it is not 
>>> working. Please advise where I am wrong.
>>>
>>> On Wed, Jul 29, 2020 at 8:35 AM Sakshi Rathore  
>>> wrote:
>>>
>> I tried a lot of things but my ssh connection is not working from jenkins 
>>>> to ssh server.
>>>>
>>>> One more thing my Jenkins and ssh server is hosting on same IP address 
>>>> is there anyway i can resolve this issue?
>>>>
>>>> On Mon, 27 Jul, 2020, 9:39 AM Sakshi Rathore,  
>>>> wrote:
>>>>
>>> thanks , i tried this as well but while getting connection 
>>>>> encountring below error:
>>>>>
>>>>> Permission denied (publickey,password,keyboard-interactive) 
>>>>> build marked as failed. 
>>>>>
>>>>> On Thu, Jul 23, 2020 at 3:47 PM jeremy mordkoff  
>>>>> wrote:
>>>>>
>>>> I think the issue is that the client does not trust the server's host 
>>>>>> key. These keys are stored by the client in ~/.ssh/known_hosts  Try 
>>>>>> copying/appending your .ssh/known_hosts file to jenkins'
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Monday, July 20, 2020 at 5:43:39 PM UTC-4, Sakshi Rathore wrote:
>>>>>>>
>>>>>>> 0I have a bash script which connects and exexutes programs from my 
>>>>>>> local to remote server and now this should be executed from jenkins 
>>>>>>> build 
>>>>>>> so for this jenkins is taking continous changes from git for this 
>>>>>>> script 
>>>>>>> but my build is failing with below error:
>>>>>>>
>>>>>>> Warning: Identity file 
>>>>>>> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>>>>>>>  
>>>>>>> not accessible: No such file or directory. Host key verification 
>>>>>>> failed. 
>>>>>>> Build step 'Execute shell' marked build as failure
>>>>>>>
>>>>>>> I have tried to set ssh connectivity in my jenkins server for this 
>>>>>>> remote server incredentials and ssh plugins but using my key i am 
>>>>>>> getting 
>>>>>>> an error cant connect to the server.
>>>>>>>
>>>>>>> when i run the script from local it works fine and my ssh connection 
>>>>>>> gets established properly using SSH key.
>>>>>>>
>>>>>>> jenkins server is also integrated or installed on my kuberenets 
>>>>>>> cluster which is my remote server in this case and bash script should 
>>>>>>> execute on this kuberenets cluster.
>>>>>>>
>>>>>>> i generated ley for jenkins in remote server and using this key for 
>>>>>>> ssh plugin setup but i am getting cant connect to the server error 
>>>>>>> everytime.
>>>>>>>
>>>>>> -- 
>>>>>> 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 jenkins...@googlegroups.com.
>>>>>
>>>>>
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/jenkinsci-users/092a6094-5f76-40bf-b2f6-0accc42e6f57o%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/092a6094-5f76-40bf-b2f6-0accc42e6f57o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>

-- 
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/63ed9be4-f2d4-4d32-9157-c90e18d2420fo%40googlegroups.com.


Re: Need help - build "Execute Shell"

2020-07-29 Thread jeremy mordkoff
Normally a SSH keypair is created on the client (in your case the jenkins 
server) and then the public key is copied to the server. This is more 
secure because the private key is created on the client and is never copied 
anywhere else. 

This level of security is rarely needed or enforced in a lab, but it is a 
good habit anyway. 

Make sure the keys you use for jenkins do not have a pass-phrase.




On Wednesday, July 29, 2020 at 9:37:06 AM UTC-4, sakshira...@gmail.com 
wrote:
>
> thanks, i try this way . Could you please also suggest  Create an SSH key 
> pair  this step should be executed on jenkins server or ssh server. till 
> now i have executed on ssh server 
>
> On Wednesday, July 29, 2020 at 2:38:02 PM UTC+2 ice...@googlemail.com 
> wrote:
>
>>
>>>- 
>>>
>>>
>>>Create an SSH key pair (public/private) Ran the command “ssh-keygen 
>>>-t rsa -C "Jenkins agent key" -f "jenkinsAgent_rsa" “
>>>- 
>>>
>>>Create an SSH credential in the Jenkins machine and put the private 
>>>key there Created the credentials and put jenkinsAgent_rsa into it.
>>>
>>> These steps are fine
>>  
>>
>>>
>>>- 
>>>
>>>Create an SSH agent see 
>>>
>>> https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md#configure-launch-agents-via-ssh
>>>  – 
>>>This is creating a node which I didn’t do before – so I created the node 
>>>and selected the credential with the private key. The verification 
>>> strategy 
>>>slect is non-verifying.
>>>- 
>>>   
>>>   Select the SSH credential created before as credentials
>>>   - 
>>>   
>>>   Chose the verification strategy that you want, see the 
>>>   documentation, if you have problems start with the "Non verifying 
>>>   Verification Strategy" you can change it later
>>>   
>>>
>> This doing something completly different, you  are creating a jenkins 
>> agent via ssh,  what you need is an ssh-agent. 
>>
>> I assume you are using pipelines, the wrap the ssh-calling sh step in an 
>> sshagent wrapper (best to use the Snippet generator for the details).
>>  
>>
>>>
>>>- 
>>>
>>>Add the public key on ~/.ssh/authorized_keys This was done
>>>
>>>
>> Fine again ( at least if ~ expand to the correct user (whatever jenkins 
>> is running the agent as), unless you also explicitly specify the user in 
>> your ssh requests.  From the log it looks like
>> the agent is running as root (no a good idea, but that is another thing), 
>> so you would need to add the key to /root/.ssh/authorized_keys (and 
>> possibly allow remote root logins in the sshd config).
>>
>> but i am not able to establish the connection between jenkins and ssh 
>>> server
>>> my ssh and jenkins server both are hosted on same ip
>>>
>>

-- 
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/28acd998-8882-4b05-942f-5429f87f0368o%40googlegroups.com.


Re: Help required: jenkins SSH connectivity issue

2020-07-29 Thread jeremy mordkoff
There are two SSH keys involved when establishing a session 

The one you are setting here is the key used ti identify the client to the 
server (host). There is also the key that the server (host) sends down to 
the client. You can see this the first time you ssh to a host and it asks 
you if you want to accept the key. Once you do accept it, it is stored in 
.ssh/known_hosts and subsequent connections are verified automatically. 

You have two choices. Disable host key verification or add the host key 
manually to jenkins' known_hosts file.

to disable host key checking, add this to your .ssh/config 
StrictHostKeyChecking no
This can also be done on the commandline .. something like 
-o StrictHostKeyChecking=no

or you can pre-create the known_hosts file. One way would be to delete it, 
ssh to the host manually and then examine the known_hosts file. There 
should be one line in it something like this
jenkins7,10.64.10.74 ecdsa-sha2-nistp256 
E2VjZHNhLXNoYTItbmlzdHAyNTYIbmlzdHAyNTYAAABBBNiUivaQ4skdl0sc0A/a0aFxA1p/Sd/6AcYpZcjC0UA9YaO5ADJT+Ercb9fHrcuQdiEOMi36LVNdS5TY1EeFYzs=
copy that into jenkins' known_hosts file 



On Wednesday, July 29, 2020 at 2:50:04 AM UTC-4, Sakshi Rathore wrote:
>
> below is the part of my script where i am doing ssh and it works fine in 
> local.
>
> scp -i $SSHKEY_PATH $CERT_PATH ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH $KEY_FILE ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH $CRT_FILE ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH ./check.sh ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH ./old_server.sh ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH ./cert_status1.sh ccpuser@10.32.141.35:/home/ccpuser
> scp -i $SSHKEY_PATH ./new_server_cert.sh ccpuser@10.32.141.35:/home/ccpuser
>
> sed -i -e 's/\r$//' ./check.sh
> sed -i -e 's/\r$//' ./old_server.sh
> sed -i -e 's/\r$//'  ./cert_status1.sh
> sed -i -e 's/\r$//' ./old_server.sh
> sed -i -e 's/\r$//' ./new_server_cert.sh
>
>
> echo "check1"
>
> ssh -i $SSHKEY_PATH ccp...@10.32.141.35  /bin/bash <
> this ssh key belongs to server login
>
> when i try to execute this using jenkins build:
> Warning: Identity file 
> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>  
> not accessible: No such file or directory.
> Host key verification failed.
> lost connection
> I have generated ssh key in ssh server for jenkins and put public key into 
> home/.ssh/authorized_keys location  and private key for ssh setup in 
> jenkins but i am not able to connect to the ssh server
> i also tried simple ssh to the server in build step but it is not working. 
> Please advise where I am wrong.
>
> On Wed, Jul 29, 2020 at 8:35 AM Sakshi Rathore  > wrote:
>
>> I tried a lot of things but my ssh connection is not working from jenkins 
>> to ssh server.
>>
>> One more thing my Jenkins and ssh server is hosting on same IP address is 
>> there anyway i can resolve this issue?
>>
>> On Mon, 27 Jul, 2020, 9:39 AM Sakshi Rathore, > > wrote:
>>
>>> thanks , i tried this as well but while getting connection 
>>> encountring below error:
>>>
>>> Permission denied (publickey,password,keyboard-interactive) 
>>> build marked as failed. 
>>>
>>> On Thu, Jul 23, 2020 at 3:47 PM jeremy mordkoff >> > wrote:
>>>
>>>> I think the issue is that the client does not trust the server's host 
>>>> key. These keys are stored by the client in ~/.ssh/known_hosts  Try 
>>>> copying/appending your .ssh/known_hosts file to jenkins'
>>>>
>>>>
>>>>
>>>> On Monday, July 20, 2020 at 5:43:39 PM UTC-4, Sakshi Rathore wrote:
>>>>>
>>>>> 0I have a bash script which connects and exexutes programs from my 
>>>>> local to remote server and now this should be executed from jenkins build 
>>>>> so for this jenkins is taking continous changes from git for this script 
>>>>> but my build is failing with below error:
>>>>>
>>>>> Warning: Identity file 
>>>>> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>>>>>  
>>>>> not accessible: No such file or directory. Host key verification failed. 
>>>>> Build step 'Execute shell' marked build as failure
>>>>>
>>>>> I have tried to set ssh connectivity in my jenkins server for this 
>>>>> remote server incredentials and ssh plugins but using my key i am getting 
>>>>> an erro

Re: Help required: jenkins SSH connectivity issue

2020-07-23 Thread jeremy mordkoff
I think the issue is that the client does not trust the server's host key. 
These keys are stored by the client in ~/.ssh/known_hosts  Try 
copying/appending your .ssh/known_hosts file to jenkins'



On Monday, July 20, 2020 at 5:43:39 PM UTC-4, Sakshi Rathore wrote:
>
> 0I have a bash script which connects and exexutes programs from my local 
> to remote server and now this should be executed from jenkins build so for 
> this jenkins is taking continous changes from git for this script but my 
> build is failing with below error:
>
> Warning: Identity file 
> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>  
> not accessible: No such file or directory. Host key verification failed. 
> Build step 'Execute shell' marked build as failure
>
> I have tried to set ssh connectivity in my jenkins server for this remote 
> server incredentials and ssh plugins but using my key i am getting an error 
> cant connect to the server.
>
> when i run the script from local it works fine and my ssh connection gets 
> established properly using SSH key.
>
> jenkins server is also integrated or installed on my kuberenets cluster 
> which is my remote server in this case and bash script should execute on 
> this kuberenets cluster.
>
> i generated ley for jenkins in remote server and using this key for ssh 
> plugin setup but i am getting cant connect to the server error everytime.
>

-- 
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/092a6094-5f76-40bf-b2f6-0accc42e6f57o%40googlegroups.com.


Re: Do multibranch jobs lead to code duplication?

2020-07-22 Thread jeremy mordkoff
How do you normally handle branches and merging? I use the same tools and 
branching and merging rules as the rest of the team, i.e. development and 
QA. 

In our case, the teams are required to merge from master to their project 
branches on a regular basis, so they will eventually get my changes that I 
make in master.



On Tuesday, July 21, 2020 at 5:37:39 PM UTC-4, Martin Schmude wrote:
>
> Dear all,
>
> if I understand multibranch jobs right, then a Jenkinsfile in branch 
> "master" will be replicated into all other branches drawn from "master".
> It has to be like that because the Jenkinsfile is the "marker" that tells 
> Jenkins to build a branch, and how to do that. Branches without a 
> Jenkinsfile will not be built.
>
> This will often result in code duplication, with all the well-known issues.
> If a small change has to be made to the Jenkinsfile, it has to be applied 
> to all branches.
>
> How do you handle that issue? Is there a recommended practice?
>
>

-- 
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/26c8d410-37d8-4de5-8b7b-1b8bdeab9baao%40googlegroups.com.


Re: Help required: jenkins SSH connectivity issue

2020-07-22 Thread jeremy mordkoff
ouch. I always keep one window open ssh'd in as root when I play with 
sshd_config. Hopefully you have console access and a username/password with 
sudo rights. 

On Monday, July 20, 2020 at 5:43:39 PM UTC-4, Sakshi Rathore wrote:
>
> 0I have a bash script which connects and exexutes programs from my local 
> to remote server and now this should be executed from jenkins build so for 
> this jenkins is taking continous changes from git for this script but my 
> build is failing with below error:
>
> Warning: Identity file 
> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>  
> not accessible: No such file or directory. Host key verification failed. 
> Build step 'Execute shell' marked build as failure
>
> I have tried to set ssh connectivity in my jenkins server for this remote 
> server incredentials and ssh plugins but using my key i am getting an error 
> cant connect to the server.
>
> when i run the script from local it works fine and my ssh connection gets 
> established properly using SSH key.
>
> jenkins server is also integrated or installed on my kuberenets cluster 
> which is my remote server in this case and bash script should execute on 
> this kuberenets cluster.
>
> i generated ley for jenkins in remote server and using this key for ssh 
> plugin setup but i am getting cant connect to the server error everytime.
>

-- 
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/366717fe-86d5-4f83-8990-7584308b3a36o%40googlegroups.com.


Re: SSH Agent, z/OS USS, and git authentication problems

2020-07-21 Thread jeremy mordkoff
CI and passphrases never mix :) You're going to need some password-less 
keys even if they have limited access. 

On Monday, July 20, 2020 at 4:48:23 PM UTC-4, Randall Becker wrote:
>
> Turns out, you cannot use a key-pair with a passphrase in this situation. 
> SSH key-pairs without a passphrase works correctly (but passphrases are 
> mandatory in our shop).
>
> On Monday, 20 July 2020 14:14:47 UTC-4, Randall Becker wrote:
>>
>> I'm going to have to dig deeper and probably debug the GitSCM plugin on 
>> the agent. -Dibm.file.encoding does not help the situation. I have a call 
>> later today that might shed some light on the situation.
>>
>> On Friday, 17 July 2020 09:47:19 UTC-4, Mark Waite wrote:
>>>
>>>
>>> https://github.com/jenkinsci/git-client-plugin/blob/eeec334af0b6447f3db9fb88d55728911a092d73/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L2411
>>>  has 
>>> specific code for z/OS.  I do not have access to z/OS so cannot test that 
>>> code.  It was merged based on a submission from people that said it works.  
>>>
>>> You're welcome to suggest improvements in that area with the 
>>> understanding that I can only evaluate that code by inspection, not by 
>>> execution.
>>>
>>> Mark Waite
>>>
>>> On Thu, Jul 16, 2020 at 7:49 AM Randall Becker  
>>> wrote:
>>>
 That's what we were trying to do originally. There is a problem. When 
 GitSCM creates the GIT_SSH content on z/OS agent the file name is encoded 
 as an IBM1047 EBCDIC regardless of the -Dfile.encoding argument, even 
 though the original private key and passphrase are coming from a 
 UTF8/US-ASCII controller. When this goes to git and then SSH, the file is 
 still encoded as IBM1047 and is when it hits the KEX code, fails. When we 
 use the SSH Agent, this problem does not occur. I want to use the correct 
 using GitSCM credential ID, but it does not work. I do not have a decent 
 debug environment that would clearly demonstrate this, isolate the section 
 of code where this is (not) happening, or allow me to easily fix this. The 
 most important bit is that the private key should be encoded in UTF8 or 
 US-ASCII when supplied to GIT_SSH, not the default encoding. Somehow, the 
 SSH Agent Plugin does this correctly.

 On Monday, 13 July 2020 17:41:07 UTC-4, Mark Waite wrote:
>
> If the operation you're performing is a checkout, why use the 
> ssh-agent wrapper?  Why not use the same credentials ID as an argument to 
> checkout rather than wrapping checkout in ssh-agent?
>
> On Mon, Jul 13, 2020 at 8:45 AM Randall Becker  
> wrote:
>
>> I wish it was that simple. The issue definitely appears to be the 
>> encoding of the private key during a key exchange. When using SSH-Agent 
>> and 
>> git commands from within a shell in the pipeline, the authentication 
>> works 
>> fine. So this is likely an interaction with the GitSCM plugin not being 
>> aware of IBM-1047 encodings.
>>
>> On Sunday, 12 July 2020 16:08:31 UTC-4, Ivan Fernandez Calvo wrote:
>>>
>>> I think that this is the reason why it does not work 
>>> https://support.cloudbees.com/hc/en-us/articles/224910467-Why-am-I-unable-to-authenticate-via-sshagent-inside-docker-
>>>
>>> El sábado, 11 de julio de 2020, 22:25:08 (UTC+2), Randall Becker 
>>> escribió:

 I'm having issues trying to get an agent to authenticate using the 
 SSH Agent plugin on a R2.4 z/OS USS agent with a Docker Jenkins 
 controller. 
 The goal is to convince GitSCM to actually fetch properly. We get SSH 
 authentication errors no matter what happens. This is using Pipelines.

 I've tried 
 sshagent (credentials: ['mvs-randall']) {
 checkout([$class: 'GitSCM',
 branches: [[name: '*/development']],
 extensions: [
 [$class: 'CleanBeforeCheckout'],
 [$class: 'SubmoduleOption', 
 disableSubmodules: false, parentCredentials: true,
 recursiveSubmodules: true, 
 reference: '', trackingSubmodules: false]],
 
 doGenerateSubmoduleConfigurations: false, submoduleCfg: [],
 userRemoteConfigs: [[url: 
 'g...@xx.xxx.xxx.xxx:proj/repo.git'']]])
 }
 and
 checkout([$class: 'GitSCM',
 branches: [[name: '*/development']],
 extensions: [
 [$class: 'CleanBeforeCheckout'],
 [$class: 'SubmoduleOptio

Re: Help required: jenkins SSH connectivity issue

2020-07-21 Thread jeremy mordkoff
Where is that file referenced? In your .ssh/config file? It sounds like a 
simple path issue -- the config file is referencing a location that is not 
available to jenkins. You can override this on the command line, e.g. 
something like -i /c/Users/jenkins/ssh/id_rsa


On Monday, July 20, 2020 at 5:43:39 PM UTC-4, Sakshi Rathore wrote:
>
> 0I have a bash script which connects and exexutes programs from my local 
> to remote server and now this should be executed from jenkins build so for 
> this jenkins is taking continous changes from git for this script but my 
> build is failing with below error:
>
> Warning: Identity file 
> /c/Users/D35N/Downloads/GitHubProjeckt/Automation/GitHubProjeckt/newharbortestkey
>  
> not accessible: No such file or directory. Host key verification failed. 
> Build step 'Execute shell' marked build as failure
>
> I have tried to set ssh connectivity in my jenkins server for this remote 
> server incredentials and ssh plugins but using my key i am getting an error 
> cant connect to the server.
>
> when i run the script from local it works fine and my ssh connection gets 
> established properly using SSH key.
>
> jenkins server is also integrated or installed on my kuberenets cluster 
> which is my remote server in this case and bash script should execute on 
> this kuberenets cluster.
>
> i generated ley for jenkins in remote server and using this key for ssh 
> plugin setup but i am getting cant connect to the server error everytime.
>

-- 
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/8c8c7032-4d1f-4d67-834c-871922e3b33do%40googlegroups.com.


Re: Cant connect to the remote server from jenkins using ssh key

2020-07-21 Thread jeremy mordkoff
You are positive the key works and that jenkns is ssh'ing as the right 
user? If so, can you check that the key is the only one offered? Finally, 
enable debug logs on the target's SSH server and look for the cause. 


On Tuesday, July 21, 2020 at 3:03:10 AM UTC-4, sakshira...@gmail.com wrote:
>
> How can i resolve below issue for ssh configuration for remote server to 
> jenkins:
>
> jenkins.plugins.publish_over.BapPublisherException: Failed to connect and 
> initialize SSH connection. Message: [Failed to connect session for config 
> [Remote Machine]. Message [Auth fail] 
>
>
> i have added ssh key for connection as per 
> https://linuxtechlab.com/how-to-easily-add-ssh-credentials-on-jenkins-server/
>
> I need to run a script on remote server from jenkins . 
>

-- 
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/136d5114-db1f-41f0-b4fc-8e0e90352127o%40googlegroups.com.


Re: Splitting/Merging/Clustering JUnit test results?

2020-05-13 Thread jeremy mordkoff
Hi, 

I am heading down this path.  My plan is build a web app that can accept 
test results in various formats, and can aggregate them by build and 
identify them by type. 

It will track sources and link back to them

It will have the ability to normalize the xml paths, e.g. 
/net/server1/workspace and /net/server2/workspace could both be normalized 
to /net/server/workspace

It will have the ability to augment the paths, e.g. building on the example 
above, it could convert the paths to /net/server/functional/workspace and 
/net/server/coverage/workspace

It will compare builds and identify tests that are flaky and tests that are 
failing continually

It will link to JIRA 

It will link to testlink

It will identify builds that have only been through CI testing from those 
that have also had additional testing done

It will identify builds that have been through QA or have been released 
from internal builds. 

I have a framework that we have been using for years that does track 
builds, but it does not track test results yet. I do plan to opensource 
this, if anyone is interested in helping or has additional ideas, please 
ping me directly jeremy dot mordkoff at riftio dot com 





On Friday, February 14, 2020 at 8:29:52 AM UTC-5, Simon Richter wrote:
>
> Hi, 
>
> I have a matrix job that in each leaf runs the test suite twice, once 
> normally and once with memory checking enabled, each of which generates 
> an XML file that can be parsed with the JUnit parser. 
>
> Now I'd like to present the results in the overview in a useful way: 
>
> 1. separate normal/memcheck runs from the same build 
> 2. merge results from different cells of the matrix 
> 3. if tests fail only in some configurations, try to cluster by label 
>
> Problems: 
>
> 1. I have the JUnit plugin parse both generated XML files, but only the 
> normal test run (...)shows up in the result 
> summary, not the memory checker (...). 
>
> 2. Test results are only available inside the matrix configurations, no 
> summary is available 
>
> 3. I haven't looked at yet, since I need result merging first. 
>
>Simon 
>
>

-- 
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/2e3a8430-45df-40f8-acc2-05138ec7b732%40googlegroups.com.


aborting builds based on checkin comment

2020-05-07 Thread jeremy mordkoff
We use git and SCM polling to trigger builds. There are two situations 
where I do not want a commit to cause a build.  One is when we bump the 
release number and the other is when I initially create a branch. 

Does anyone have a groovy snippet that returns all of the commit messages 
since the last build as a list of strings? 

-- 
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/80275977-d085-43bc-8402-181ec70baeb3%40googlegroups.com.


Re: The pipeline emailextrecipients step takes too long time

2020-04-26 Thread Jeremy Mordkoff
sending email always involves a forward lookup and many mail servers do a 
reverse lookup on the sender's IP.


---
Jeremy Mordkoff
Director of Engineering Services
[cid:7231f95f-ee20-460d-bb39-189076c048ad]<https://www.riftio.com>
RIFT, inc
900 Chelmsford Street,  4th floor, tower 3
Lowell, MA 01851
1.978.257.2183 (cell)
<http://www.riftio.com>www.riftio.com<http://www.riftio.com>

From: jenkinsci-users@googlegroups.com  on 
behalf of Sverre Moe 
Sent: Sunday, April 26, 2020 3:32 PM
To: Jenkins Users 
Subject: Re: The pipeline emailextrecipients step takes too long time

How so?

Does emailextrecipient do a DNS lookup on each author it can find?

søndag 26. april 2020 20.12.03 UTC+2 skrev jeremy mordkoff følgende:
check that DNS is working. I've seen huge delays on basic ops when DNS lookups 
are timing out. Check forward and reverse lookups.



On Sunday, April 26, 2020 at 12:30:59 PM UTC-4, slide wrote:
Can you add timestamps? It's hard to tell from what you posted when things are 
occurring.

On Sun, Apr 26, 2020, 01:16 Sverre Moe  wrote:
Yes it did.

Just one simple little commit, and Checkout took a little over 1 minute


[Pipeline] 
emailextrecipients<https://build-ci.spacetec.no:8443/view/All%20meosconfig/job/meosconfig-dashboard-layouts/job/master/168/console#>
  Collecting change authors...
build: 168
  adding author: Sverre Moe


Adding Sverre Moe with address sve...@company.com
Analyzing: sve...@company.com
Looking for: sve...@company.com
starting at: 0
firstFoundIdx: 0
firstFoundIdx-substring: sve...@company.com
=> found type: 0
Analyzing: sve...@company.com
Looking for: sve...@company.com
starting at: 0
firstFoundIdx: 0
firstFoundIdx-substring: sve...@company.com
=> found type: 0
Analyzing: sve...@company.com
Looking for: sve...@company.com
starting at: 0
firstFoundIdx: 0
firstFoundIdx-substring: sve...@company.com
=> found type: 0

lørdag 25. april 2020 21.51.25 UTC+2 skrev slide følgende:
I think the debug logs will just go to the build log.

On Sat, Apr 25, 2020, 11:58 Sverre Moe  wrote:
Tried to configure debug
Manage Jenkins > Configure System > Extended Email Notification >Enable Debug

I added a System Log for "hudson.plugins.emailext" and Log Level ALL.

Hope I can find something about why it takes so long.

fredag 24. april 2020 23.20.40 UTC+2 skrev slide følgende:
You can turn on debug mode in the global config for Email Ext. The code isn't 
really doing anything major, it just looks at the changesets and get the 
authors, so I am not sure why it would be taking that long.

On Fri, Apr 24, 2020 at 1:59 PM Sverre Moe  wrote:
Calling the pipeline step emailextrecipients when there are changes takes too 
much time.
A normal git checkout that takes 10-15 seconds, will usually take 1-2 minutes 
when there are changes, just because of emailextrecipients.
All I want is the authors from the current build changes. I see no reason why 
this should take so long.

I took a small look at the code for emailextrecipients, and it seems it looks 
also on previous builds.

def recipients = emailextrecipients([developers()])

Our developers want the builds to run as fast as it can. Time is precious.
I am considering removing this recipients. I already have the git repository 
maintainers I can send email notifications to if anything goes wrong.
The backside of removing this, is I cannot send email notifications for the 
developers, just the maintainers (and those only want notifications for release 
build, and not all continuous builds).

The reason I call emailextrecipients during the Checkout stage, is because that 
is the only stage where I have access to the git repository. Later in the build 
if it fails I do not have access to git anymore.

The emailextrecipients code does have some Debug logging. How can I enable this 
to see what it is actually doing?

I was thinking of implementing my own parsing of the change records. It cannot 
possibly take more than a few seconds to find the authors of all 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 jenkins...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/de0f53c9-9512-4fd6-a258-e604412ff77a%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/de0f53c9-9512-4fd6-a258-e604412ff77a%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Website: http://earl-of-code.com

--
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkins...@googlegroups.com.
To 

Re: The pipeline emailextrecipients step takes too long time

2020-04-26 Thread jeremy mordkoff
check that DNS is working. I've seen huge delays on basic ops when DNS 
lookups are timing out. Check forward and reverse lookups. 



On Sunday, April 26, 2020 at 12:30:59 PM UTC-4, slide wrote:
>
> Can you add timestamps? It's hard to tell from what you posted when things 
> are occurring.
>
> On Sun, Apr 26, 2020, 01:16 Sverre Moe > 
> wrote:
>
>> Yes it did.
>>
>> Just one simple little commit, and Checkout took a little over 1 minute
>>
>> [Pipeline] emailextrecipients 
>> 
>>   Collecting change authors...
>> build: 168
>>   adding author: Sverre Moe
>>
>> Adding Sverre Moe with address sve...@company.com 
>> Analyzing: sve...@company.com 
>> Looking for: sve...@company.com 
>>  starting at: 0
>>  firstFoundIdx: 0
>>  firstFoundIdx-substring: sve...@company.com 
>>  => found type: 0
>> Analyzing: sve...@company.com 
>> Looking for: sve...@company.com 
>>  starting at: 0
>>  firstFoundIdx: 0
>>  firstFoundIdx-substring: sve...@company.com 
>>  => found type: 0
>> Analyzing: sve...@company.com 
>> Looking for: sve...@company.com 
>>  starting at: 0
>>  firstFoundIdx: 0
>>  firstFoundIdx-substring: sve...@company.com 
>>  => found type: 0
>>
>>
>> lørdag 25. april 2020 21.51.25 UTC+2 skrev slide følgende:
>>>
>>> I think the debug logs will just go to the build log.
>>>
>>> On Sat, Apr 25, 2020, 11:58 Sverre Moe  wrote:
>>>
 Tried to configure debug
 Manage Jenkins > Configure System > Extended Email Notification >Enable 
 Debug

 I added a System Log for "hudson.plugins.emailext" and Log Level ALL.

 Hope I can find something about why it takes so long.

 fredag 24. april 2020 23.20.40 UTC+2 skrev slide følgende:
>
> You can turn on debug mode in the global config for Email Ext. The 
> code isn't really doing anything major, it just looks at the changesets 
> and 
> get the authors, so I am not sure why it would be taking that long.
>
> On Fri, Apr 24, 2020 at 1:59 PM Sverre Moe  wrote:
>
>> Calling the pipeline step emailextrecipients when there are changes 
>> takes too much time.
>> A normal git checkout that takes 10-15 seconds, will usually take 1-2 
>> minutes when there are changes, just because of emailextrecipients.
>> All I want is the authors from the current build changes. I see no 
>> reason why this should take so long.
>>
>> I took a small look at the code for emailextrecipients, and it seems 
>> it looks also on previous builds.
>>
>> def recipients = emailextrecipients([developers()])
>>
>> Our developers want the builds to run as fast as it can. Time is 
>> precious.
>> I am considering removing this recipients. I already have the git 
>> repository maintainers I can send email notifications to if anything 
>> goes 
>> wrong.
>> The backside of removing this, is I cannot send email notifications 
>> for the developers, just the maintainers (and those only want 
>> notifications 
>> for release build, and not all continuous builds).
>>
>> The reason I call emailextrecipients during the Checkout stage, is 
>> because that is the only stage where I have access to the git 
>> repository. 
>> Later in the build if it fails I do not have access to git anymore.
>>
>> The emailextrecipients code does have some Debug logging. How can I 
>> enable this to see what it is actually doing?
>>
>> I was thinking of implementing my own parsing of the change records. 
>> It cannot possibly take more than a few seconds to find the authors of 
>> all 
>> 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 jenkins...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/de0f53c9-9512-4fd6-a258-e604412ff77a%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Website: http://earl-of-code.com
>
 -- 
 You received this message because you are subscribed to the Google 
 Groups "Jenkins Users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to jenkins...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-users/fbf04c99-b61b-4109-ac21-50a77fca08c0%40googlegroups.com
  
 

Re: See pipeline properties in dashboard

2020-04-23 Thread jeremy mordkoff
I did stumble on the setting showing up in the UI when I 'view 
configuration' for the job. But I would prefer to see it in a column if 
possible. 


On Thursday, April 23, 2020 at 10:17:26 AM UTC-4, jeremy mordkoff wrote:
>
> If I use this syntax 
>
> properties([
> pipelineTriggers([cron('0 21 * * *')])
> ])
>
> Then the cron spec shows up under "periodic build trigger' in my list 
> views. But it does not  show up if I use this syntax 
>
> properties([
> pipelineTriggers([
> [$class: "SCMTrigger", scmpoll_spec: 'H 22 * * *']
> ])
> ])
>
> Is there a workaround? A plugin I should use?  
>
> BTW, The 'cron Trigger' column never shows me anything.
>
> Also, is there a way to make a property take affect without running the 
> job once? 
>
>
>
>
>

-- 
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/478add57-1cab-40e3-a472-8eeddd380fbf%40googlegroups.com.


See pipeline properties in dashboard

2020-04-23 Thread jeremy mordkoff
If I use this syntax 

properties([
pipelineTriggers([cron('0 21 * * *')])
])

Then the cron spec shows up under "periodic build trigger' in my list 
views. But it does not  show up if I use this syntax 

properties([
pipelineTriggers([
[$class: "SCMTrigger", scmpoll_spec: 'H 22 * * *']
])
])

Is there a workaround? A plugin I should use?  

BTW, The 'cron Trigger' column never shows me anything.

Also, is there a way to make a property take affect without running the job 
once? 




-- 
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/156556c6-5c62-49ac-ae7e-035fe8d47246%40googlegroups.com.


Re: job is sucess but am not reciving mails please help

2020-04-18 Thread jeremy mordkoff
Check the mail queue on the jenkins master node (usually "sudo mailq"). Or 
try "echo test | mail -s test "jafargmail.com" on the master node. 
gmail is very picky about whom they will accept mail from. Where are you 
sending from? Does it have SPF and/or DKIM ? 

On Friday, April 17, 2020 at 8:45:11 AM UTC-4, Jafar Shaik wrote:
>
> Started by user jhonson 
> Running as SYSTEM
> Building in workspace /var/lib/jenkins/workspace/good
> No emails were triggered.
> [good] $ /bin/sh -xe /tmp/jenkins6568088358673350241.sh
> + echo 'hello india'
> hello india
> Email was triggered for: Always
> Sending email for trigger: Always
> Sending email to: jafar...@gmail.com 
> 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/11c0c758-1083-4454-bb3e-cfccd12ba090%40googlegroups.com.


Re: Splitting/Merging/Clustering JUnit test results?

2020-04-15 Thread jeremy mordkoff
I have a similar issue, except my test results some from multiple jobs

my basic build pipeline runs unit tests then invokes the systemtest 
pipeline. These run 10 to 30 times a day.
I also have a nightly pipeline that runs a lot of additional tests, like 
coverage, interop, stress, load, upgrade. It takes many hours so it only 
runs once a day against whatever basic build is most recent.

I would like to be able to aggregate the test results of the three 
pipelines together into some master report. 

I was thinking of creating an external web service that would accept 
(pointers to) junit xml files and aggregate the results for me. It would 
also generate links back into jenkins in case I needed to do some 
investigating.

Back to your problem...if the xml path inside your tests is the same 
regardless of whether the test run includes memchecker, then one set of 
results might be overwriting the other. Just postprocess the junit files 
and tweak the paths. I do this now to remove any host or workspace 
specifics from them so I can compare one build to the next.

On Friday, February 14, 2020 at 8:29:52 AM UTC-5, Simon Richter wrote:
>
> Hi, 
>
> I have a matrix job that in each leaf runs the test suite twice, once 
> normally and once with memory checking enabled, each of which generates 
> an XML file that can be parsed with the JUnit parser. 
>
> Now I'd like to present the results in the overview in a useful way: 
>
> 1. separate normal/memcheck runs from the same build 
> 2. merge results from different cells of the matrix 
> 3. if tests fail only in some configurations, try to cluster by label 
>
> Problems: 
>
> 1. I have the JUnit plugin parse both generated XML files, but only the 
> normal test run (...)shows up in the result 
> summary, not the memory checker (...). 
>
> 2. Test results are only available inside the matrix configurations, no 
> summary is available 
>
> 3. I haven't looked at yet, since I need result merging first. 
>
>Simon 
>
>

-- 
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/99c15303-f0ee-42dd-ba02-2a653e4a06f9%40googlegroups.com.


Re: a lot of jobs

2020-04-15 Thread jeremy mordkoff
I was thinking about this the other day. My plan is to create a simple 
jenkins job that manages all of my other jenkins jobs. Some of the other 
suggestions might feed into this. 

My goal is to able to bootstrap a new jenkins server in minutes for 
disaster recovery and for bringing up new development sites. 

roughly the steps would be 

   1. deploy some docker servers (we use MAAS)
   2. spin up a jenkins server instance using a Dockerfile in the devops 
   repo
   3. create this one special job and run it.  I am hoping I can define 
   this job in my Dockerfile. This job will
  1. survey MAAS for a list of jenkins build hosts and add them with 
  executors and labels based on their size
  2. pull the list of jobs from the devops repo (format TBD)
  3. create the jobs
  4. kick them off in some prescribed order (some have parameters or 
  cron properties so they need to be run once manually)
   
I would be happy to share whatever I come up with although I can't promise 
it will be very soon. Any suggestions for projects I should look at for 
integration or inspiration? 





On Wednesday, November 14, 2012 at 7:39:07 PM UTC-5, Marcin Biegan wrote:
>
> Hi, 
>
> I wanted to ask how do you handle configuring multiple jobs. We have 
> about 10 maven projects to build in at least 2 versions (trunk/ 
> branch), which makes 20 jobs, some more for additional tests, 
> releases, maybe deployment, verification, etc. Manually adding 
> permissions and adjusting configuration of jobs is cumbersome. Is 
> there a working plugin which would allow to set some 'parent' job 
> which would define default configuration? (Template Project Plugin is 
> not enough, because it 'works' only at job creation). I know also 
> about Configuration Slicing Plugin, but this will not work in my case 
> as it requires admin permissions. 
>
> Thanks 
> Marcin Biegan 
>

-- 
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/017b0551-1864-421c-9de7-a64e991e335e%40googlegroups.com.


Re: Job Inheritance Plugin

2020-04-15 Thread jeremy mordkoff
I went back and forth on this. In the end, I put everything in code. I 
decided I wanted the minimum amount of stuff configured in jenkins. 

I started out with a wrapper pipeline that loaded the "guts" of the job. 
This was extremely restrictive in that each job had to conform at some 
level to the expectations of the wrapper. I switched to a library of code 
and all of my common parameters are stored in the library. I found that 
this was also easier to debug as I could create a jenkins job that loaded 
the library and ran the unit tests that I defined inside it. 

This is all using multi-branch pipelines, BTW, and my devops code is in the 
same repo as the product code, so it all gets branched at the same time. 
This gives me more confidence that I can reproduce any build later, no 
matter how much my devops code changes. If you store this library in a 
different repo, then make sure you have some way to select the correct 
version or else you will have trouble reproducing old builds (I often have 
7 or more branches in development so this is important to me). 


On Wednesday, April 15, 2020 at 11:49:48 AM UTC-4, marouane zhani wrote:
>
> Hi everybody,
>
> Since a lot of my jobs have more or less the same set of parameters, I 
> wanted to implement a "parent job" where we have the shared configuration, 
> and all "children" jobs should just inherit from the "parent" and change 
> the parameters if needed.
>
> I have found that the "inheritance job plugin",which is fitting more or 
> less my needs. However, I am still having the following problems with it: 
>
>
>-  How to get the parameters of the parent job (as environment 
>variables for example) and use them in the build steps of the child job. 
>-  Is it possible to have the same structure with pipelines or 
>multi-job? I mean here if it's possible to have just one parent multi-job 
>where we have the common configuration, and then all the other multi-jobs 
>should use the parent one as a reference. 
>
>
> Looking forward to your help.
>
> Thank you in advance,
>
> Marouane ZHANI
>

-- 
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/fd6ff22e-4fcd-4f1f-8a68-7b1a39c8c496%40googlegroups.com.


Re: Anyway to programatically update a Jenkinsfile?

2019-10-01 Thread jeremy mordkoff
I use a templating tool (m4) so I can build up a groovy script using 
macros. In the first stage of my Jenklinsfiie, I call a bash script that 
generates a groovy script, which I then load and execute. The loaded script 
has N stages. Note that if the ordering of your stages changes, jenkins 
will stop showing history, so I try to always add stages at the end. 



On Tuesday, October 1, 2019 at 11:43:25 AM UTC-4, Jeff Sault wrote:
>
> Does anyone know of any libraries/tools that will allow me to 
> add/remove/update sections of a Jenkinsfile programatically? I have a load 
> of different projects which I need to update to include some new mandatory 
> parameters. I'd like to go down the 'shared library' route but in this 
> instance its not really possible. Parsing the jenkinsfile is non-trivial 
> but I assume theres something in groovy/jenkins land which can already do 
> the job.
>
> Thanks
> Jeff
>

-- 
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/7a2da374-5734-4eb9-a4a2-fed3254d8ca4%40googlegroups.com.


Re: Generate stage from script stdout

2019-08-19 Thread jeremy mordkoff
yes. You can generate groovy code using any tool you want and then use load 
to import it, e.g. 

node('docker') {
checkout scm
// this step generates Jenkinsfile.do_merge
sh script: './bin/git/needs_merging -j'
pipeline = load 'Jenkinsfile.do_merge'
pipeline.execute()
}


and the generated code looks like 

$ cat Jenkinsfile.do_merge 
// Jenkins job definition for the daily-merge job.
// 
// GENERATED by needs_merging 
//
// DO NOT EDIT
//


def execute() {
/// your code goes here
}

return this




On Sunday, August 18, 2019 at 3:31:17 PM UTC-4, Yeikel Santana wrote:
>
> Dear Jenkins Community, 
>
> I am aware that we can generate dynamic stages using groovy scripts. 
> Question is, can we also do this from the standard output of a script? 
>
> For example, I have a script written in Nodejs that I execute with "sh 
> node script.js" and that It can produce standard output to the console.I 
> would like to use its outputs to generate new stages . Is this possible? Do 
> I need to parse the output from groovy in order to do something like this? 
>
> I would like to avoid rewriting this script to groovy as much as possible. 
>
> Thank you!
>

-- 
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/5a64dba0-5cb1-4fef-bcf0-0fbe9325cc39%40googlegroups.com.


Re: Converting to pipeline questions

2019-07-29 Thread jeremy mordkoff
My personal advice is to pick declarative or scripted pipelines and stick 
to that everywhere. Switching back and forth always leads to mistakes.  And 
so keeping the Jenkinsfiles in source control is huge plus and I would 
never go back to putting any logic inside my jenkins job config. Why are 
you averse to the repository fetch? 

I found that there were just enough things that I could not do in 
declarative so I needed to use scripted. 

Finally, I try to keep the nitty gritty details of my build process in 
scripts in source control. For instance, I don't call make from Jenkins. I 
call a bash script which calls make (among other things). I found that the 
serialization restrictions in Jenkins make writing serious scripts for it 
pretty difficult and frustrating since what looks like a perfectly valid 
script will throw unintelligible errors when run inside Jenkins. 

I believe serialization is also important for executing code inside of 
containers or on other nodes, but I do not know that for a fact. 



On Monday, July 29, 2019 at 11:40:56 AM UTC-4, Louis Elston wrote:
>
> 07/17/19 – wrote this…
>
> We are currently using Windows \ Jenkins 2.107.1 (no pipeline), and I am 
> researching going to pipeline. We have a nightly build job, that fetches 
> from repositories, and submits and waits on other jobs. I see 9 jobs 
> running on the same Master node (we only have a master), at the same time. 
> I am not clear on if we should have one Jenkinsfile or multiple 
> Jenkinsfiles. It will not be a multibranch pipeline, as we do not create 
> test branches and then merge back to a master. In the repository we have 
> product1.0 branch, product2.0 branch etc., and build only one branch (the 
> latest one). While I do like the Blue Ocean editor, it is only for 
> MultiBranch pipelines.
>
> Looking for directions and\or examples on how to convert existing Jenkins 
> non-pipeline systems, to pipeline.  I did find this…
> https://wiki.jenkins.io/display/JENKINS/Convert+To+Pipeline+Plugin. It 
> does help a little in that it gives you some converted steps, but cannot 
> convert all the steps, and will give comments in the pipeline script 
> "//Unable to convert a build step referring to...please verify and convert 
> manually if required." There is an option "Recursively convert downstream 
> jobs if any" and if you select that, it appears to add all the downstream 
> jobs to the same pipeline script, and really confuses the job parameters. 
> There is also an option to "Commit JenkinsFile" (if doing declarative). I 
> will play with this some more, but it is not the be all and end all of 
> converting to pipeline, and I still am not sure of whether I should be have 
> one or more scripts.
>
> Added 07/26/19 - Let’s see if I have my research to date correct…
>
> A Declarative pipeline (Pipeline Script from SCM), is stored in a 
> Jenkinsfile in the repository. Every time that this Jenkins job is 
> executed, a fetch from the repository is done (to get the latest version of 
> the Jenkinsfile).
>
> A Pipeline script is stored as part of the config.xml file in the 
> Jenkins\Jobs folder (it is not stored in the repository, or in a separate 
> Jenkinsfile in the jobs folder). There is a fetch from the repository only 
> if you put it in (you do not need to do a repository fetch to get the 
> Pipeline script).
>
> Besides our nightly product build, we also have other jobs. I could create 
> a separate Declarative Jenkinsfile for each of them (JenkinsfileA, 
> JenkinsfileB, etc.) for each of the other jobs and store then in the 
> repository also (in the same branch as the main Jenkinsfile), but that 
> would mean that every one of those additional jobs, to get the particular 
> Jenkinsfile for that job, would also need to do a repository fetch 
> (basically fetching\cloning the repository branch for each job, and have 
> multiple versions of the repository branch unnecessarily downloaded to the 
> workspace of each job).
>
> That does not make sense to me (unless my understanding of things to date 
> is incorrect). Because the main product build does require a fetch every 
> time it is run (to get any possible developer check-ins), I do not see a 
> problem doing Declarative Jenkinsfile for that job. For the other jobs (if 
> we do not leave then for the time being in the classic (non-pipeline) 
> format)), they will be Pipeline scripts.
>
> Is there any way of (or plans for), being able to do Declarative pipeline 
> without having to store in the repository and doing a fetch every time 
> (lessening the need to become a Groovy developer)? The Blue Ocean script 
> editor appears to be an easier tool to use to create pipeline scripts, but 
> it is only for MultiBranch pipelines (which we don’t do).
>
> Serialization (restarting a job), is that only for when a node goes down, 
> or can you restart a pipeline job (Declarative or Scripted), from any point 
> if it fails?
>
> I see that there are places to look to see w

Re: Build jobs take 10 minute long pause on final "exit 0"

2019-07-23 Thread jeremy mordkoff
I had noticed this and I had assumed that it was writing out the layers to 
disk.  I will also check for background tasks per Rob's comment


On Friday, June 21, 2019 at 5:01:17 PM UTC-4, Manny DaSilva wrote:
>
> Actually, it looks like the "exit 0" has nothing to do with it, but the 
> long pause is really at the end of the last Build step and before starting 
> Post-build
>
> On Friday, June 21, 2019 at 4:06:01 PM UTC-4, Manny DaSilva wrote:
>>
>> Anyone noticing Jenkins taking a long pause, up to 10 minutes, right 
>> after the "exit 0" at the end of the Build steps before starting Post-build 
>> section in freestyle build jobs?
>>
>>

-- 
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/db1b382e-d8d8-4043-ae88-615e76d07f1d%40googlegroups.com.


Re: How does one get the basic jenkins mailer to send raw console?

2014-10-30 Thread jeremy mordkoff
I have the same question. The conversion of pathnames in the mailed out 
logs makes them unreadable on smartphones. I would like to mail out the log 
as is, with no conversion.

Does anyone know where (approximately) the code that makes this change 
would live? I don't mind a little hacking 

JLM


On Wednesday, February 13, 2013 8:11:32 PM UTC-5, Rodney Stanton wrote:
>
> There is a builtin , very clever, log filter, that is replacing paths to 
> artifacts inside logs with the path to the Jenkins artifact.  Is there a 
> way to send Raw console?
>
> Rodney
>

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