Re: Declarative pipeline "when" tag is pushed

2018-01-03 Thread Lynn Lin
Steven Foster <stevengfos...@gmail.com>于2017年12月21日 周四上午9:54写道:

> I think you can get that with this:
>
> when {
> expression {
> env.TAG_NAME != null
> }
> }
>


Thanks,it works

>
> You get the env.TAG_NAME from the branch api when it's a tag build.
> A shortcut would be helpful, I suggested it here
> https://issues.jenkins-ci.org/browse/JENKINS-48523
>
This is even great

> <https://issues.jenkins-ci.org/browse/JENKINS-48523>
>
> On Wednesday, December 20, 2017 at 7:12:44 AM UTC, Lynn Lin wrote:
>>
>> HI ,All,
>>
>>  i followed with page
>> https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin to
>> enable tag will trigger a new build then the questions comes
>>
>> How can I use "when" in declarative pipeline to do something like
>> deployment when a new tag is pushed to remote repository
>>
>>
>> stage('Example Deploy') {
>> when {
>> branch 'production' // here how we can use tag as condition
>> }
>> steps {
>> echo 'Deploying'
>> }
>> }
>>
>>
>>
>>
>> "
>>
>>- When used with the Branch API Plugin
>><https://wiki.jenkins.io/display/JENKINS/Branch+API+Plugin>, tags
>>will show up as a new category. The default configuration of Branch API
>>will not trigger builds for tags automatically.
>>
>>This is by design, as one of the use-cases for tag discovery is to
>>use the tag job to perform deployment. If tags were built automatically,
>>given that the order in which the tag jobs actually execute is undefined,
>>the automatic build could cause significant issues. Branch API does 
>> provide
>>a mechanism to control what gets built automatically (known as the
>>BranchBuildStrategy) but that cannot be configured until you have at
>>least one extension plugin that provides a BranchBuildStrategy.
>>
>>If you want tags to build automatically, you will need an extension
>>plugin for Branch API that implements at least one BranchBuildStrategy,
>>see AngryBytes/jenkins-build-everything-strategy-plugin
>><https://github.com/AngryBytes/jenkins-build-everything-strategy-plugin> 
>> for
>>a prototype example of such an extension plugin.
>>
>> “
>>
>>
>> Thanks
>> Lynn
>>
> --
> 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/D0jCrBe-7A0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/9db42595-b6ad-4496-bf3f-0cd2db6c6ae2%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/9db42595-b6ad-4496-bf3f-0cd2db6c6ae2%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Declarative pipeline "when" tag is pushed

2017-12-19 Thread Lynn Lin
HI ,All,

 i followed with 
page https://wiki.jenkins.io/display/JENKINS/GitHub+Branch+Source+Plugin to 
enable tag will trigger a new build then the questions comes 

How can I use "when" in declarative pipeline to do something like 
deployment when a new tag is pushed to remote repository


stage('Example Deploy') {
when {
branch 'production' // here how we can use tag as condition 
}
steps {
echo 'Deploying'
}
}




"

   - When used with the Branch API Plugin 
   , tags will 
   show up as a new category. The default configuration of Branch API will not 
   trigger builds for tags automatically. 
   
   This is by design, as one of the use-cases for tag discovery is to use 
   the tag job to perform deployment. If tags were built automatically, given 
   that the order in which the tag jobs actually execute is undefined, the 
   automatic build could cause significant issues. Branch API does provide a 
   mechanism to control what gets built automatically (known as the 
   BranchBuildStrategy) but that cannot be configured until you have at 
   least one extension plugin that provides a BranchBuildStrategy. 
   
   If you want tags to build automatically, you will need an extension 
   plugin for Branch API that implements at least one BranchBuildStrategy, 
   see AngryBytes/jenkins-build-everything-strategy-plugin 
    for 
   a prototype example of such an extension plugin.

“


Thanks
Lynn

-- 
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/7f91e19e-1e8f-45a4-8a36-d5d620867979%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


run jenkins pipeline fails "docker": error=2, No such file or directory

2017-11-24 Thread Lynn Lin
hi

I am following this guide to have a run jenkins pipeline in my mac 
 https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
agent {
docker { image 'node:7-alpine' }
}
stages {
stage('Test') {
steps {
sh 'node --version'
}
}
}
}





and it reports below error

[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine[Pipeline] }[Pipeline] // 
stage[Pipeline] sh[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.[Pipeline] withDockerContainer[Pipeline] // withDockerContainer[Pipeline] 
}[Pipeline] // node[Pipeline] End of Pipelinejava.io.IOException: error=2, No 
such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.(Proc.java:249)
at hudson.Proc$LocalProc.(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
at hudson.Launcher$ProcStarter.start(Launcher.java:450)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
at 
org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho

at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at 
com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file 
or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.(Proc.java:249)
at hudson.Proc$LocalProc.(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
at hudson.Launcher$ProcStarter.start(Launcher.java:450)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
at 
org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
at 
org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
at 
org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at 
com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
at 
org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

-- 
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/e40b57a2-e315-41d6-981d-a88bc48964e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


enable qemu in jenkins

2015-03-26 Thread Lynn Lin
Hi all,

I have a jenkins(1.598)  server setup(ubuntu 14.04) ,in this server , I
also setup qemu, in this qemu, I create a ubuntu OS with NAT network
configuration . I followed
Libvirt Slaves Plugin
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743 to
configure  and see following failure
net.schmizz.sshj.userauth.UserAuthException: Exhausted available
authentication methods

configuration is :
Hypervisor TypeQEMUXENLXCBHYVE[image: Help for feature: Hypervisor Type]
http://10.32.100.55:8080/configure# Hypervisor Host[image: Help for
feature: Hypervisor Host] http://10.32.100.55:8080/configure# Username[image:
Help for feature: Username] http://10.32.100.55:8080/configure# SSH
Port[image:
Help for feature: SSH Port] http://10.32.100.55:8080/configure# URI
parameters[image: Help for feature: URI parameters]
http://10.32.100.55:8080/configure# Concurrent Slaves Capacity[image:
Help for feature: Concurrent Slaves Capacity]
http://10.32.100.55:8080/configure# Use Native Java libvirt client Native
Credentialsqemu2  Add

I can ssh lynn@10.32.100.55 without password successfully


Any advice ?

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


enable qemu in jenkins

2015-03-26 Thread Lynn Lin
Hi all,

I have a jenkins(1.598)  server setup(ubuntu 14.04) ,in this server , I
also setup qemu, in this qemu, I create a ubuntu OS with NAT network
configuration . I followed
Libvirt Slaves Plugin
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743 to
configure  and see following failure
net.schmizz.sshj.userauth.UserAuthException: Exhausted available
authentication methods

configuration is :
Hypervisor TypeQEMUXENLXCBHYVE[image: Help for feature: Hypervisor Type]
http://10.32.100.55:8080/configure# Hypervisor Host[image: Help for
feature: Hypervisor Host] http://10.32.100.55:8080/configure# Username[image:
Help for feature: Username] http://10.32.100.55:8080/configure# SSH
Port[image:
Help for feature: SSH Port] http://10.32.100.55:8080/configure# URI
parameters[image: Help for feature: URI parameters]
http://10.32.100.55:8080/configure# Concurrent Slaves Capacity[image:
Help for feature: Concurrent Slaves Capacity]
http://10.32.100.55:8080/configure# Use Native Java libvirt client Native
Credentialsqemu2  Add

I can ssh lynn@10.32.100.55 without password successfully


Any advice ?

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


Fwd: enable qemu in jenkins

2015-03-26 Thread Lynn Lin
-- 转发的邮件 --
发件人: *Lynn Lin* lynn.xin@gmail.com
日期: 2015年3月26日星期四
主题: enable qemu in jenkins
收件人: jenkinsci-users@googlegroups.com jenkinsci-users@googlegroups.com


Hi all,

I have a jenkins(1.598)  server setup(ubuntu 14.04) ,in this server , I
also setup qemu, in this qemu, I create a ubuntu OS with NAT network
configuration . I followed
Libvirt Slaves Plugin
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743
https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=65670743 to
configure  and see following failure
net.schmizz.sshj.userauth.UserAuthException: Exhausted available
authentication methods

configuration is :
Hypervisor TypeQEMUXENLXCBHYVE[image: Help for feature: Hypervisor Type]
http://10.32.100.55:8080/configure# Hypervisor Host[image: Help for
feature: Hypervisor Host] http://10.32.100.55:8080/configure# Username[image:
Help for feature: Username] http://10.32.100.55:8080/configure# SSH
Port[image:
Help for feature: SSH Port] http://10.32.100.55:8080/configure# URI
parameters[image: Help for feature: URI parameters]
http://10.32.100.55:8080/configure# Concurrent Slaves Capacity[image:
Help for feature: Concurrent Slaves Capacity]
http://10.32.100.55:8080/configure# Use Native Java libvirt client Native
Credentials
qemu2  Add

I can ssh lynn@10.32.100.55
javascript:_e(%7B%7D,'cvml','lynn@10.32.100.55'); without password
successfully


Any advice ?

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


Re: I'm using LTS version of Jenkins, but there's a bug that has not been fixed yet and I would like to upgrade to the latest and greatest.

2014-02-11 Thread Lynn Lin
We are also waiting for 1.532.2

junkins amarg...@gmail.com于2014年2月11日星期二写道:

 I am waiting for 1.532.2 release too.
 Is there any votes mechanism to gauge how many are interested with this
 topic?

 Regards,
 Junkins,
 --
 On Sunday, February 9, 2014 3:18:03 PM UTC-6, Dave wrote:

 I switched the update site back to http://updates.jenkins-ci.
 org/update-center.json, but I don't see an option to upgrade.  What do I
 need to do?

 On a related note, the fix is supposed to be in 1.532.2, when would that
 fix be available?

 Thanks,
 Dave

  --
 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.comjavascript:_e(%7B%7D,'cvml','jenkinsci-users%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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/groups/opt_out.


Re: Is it possible to block a build job if another one is running which is not part of up- or downstream?

2012-07-03 Thread Lynn Lin
Lynn
在 2012-6-28 下午7:32,Bap old_ho...@a1.org.uk写道:

 Quoting Jan Seidel wakkal...@gmail.com:

  Hi folks,

 I am trying to parallelize some of our builds to speed things up.
 This particular build is quite special as it also interacts with
 databases.
 Multiple write access on a database will wreck the content, so this must
 be
 avoided by all means. It takes us in worst cast out of business for 2
 weeks
 and creates loads of work and stress.

 Don't ask me why the DB design is as it is, that's pretty complicated,
 insane, sooo wrong and not worth discussing in order to fix that issue and
 let the build jobs just do what they are meant to do.
 Have been there, didn't like it, went away!

 The initial build job is a dispatcher that decides which job to run. So
 far
 quite easy but it also checks for 2 conditions which requires to almost
 identical jobs asides of one of the repositories location.
 *So the jobs access mostly the same ressources including the database
 which
 must not be simultaneously!* So they are a kind of *siblings*
 The default is set that inhibits to spawn duplicate jobs but with this
 second condition is it changing a bit. The second condition requires to
 block a job if a duplicate or the sibling is running

 This brings me to a dumb situation. Either I find a way to:

- refer to related AND non-related jobs which may block a build
- block on top-level (the dispatcher). This works but scraps all my
efforts to get jobs not sharing same ressources to run in parallel
- do not block jobs and hope that the developers don't botch it and
wreck a database *yuk*

 Do you know a solution to block a job if a clone or a sibling already is
 running?


 https://wiki.jenkins-ci.org/**display/JENKINS/Throttle+**
 Concurrent+Builds+Pluginhttps://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin

 Create your lock in the global config:
 category = db-modifiers
 max total concurrent builds = 1

 Then enable throttle concurrent builds in any job that modifies the
 database, and select the category.


 HTH,
 Bap.



 Cheers

 Jan







Re: Is it possible to block a build job if another one is running which is not part of up- or downstream?

2012-07-03 Thread Lynn Lin
Lynn
在 2012-6-28 下午6:41,Jan Seidel wakkal...@gmail.com写道:

 Hi folks,

 I am trying to parallelize some of our builds to speed things up.
 This particular build is quite special as it also interacts with
 databases. Multiple write access on a database will wreck the content, so
 this must be avoided by all means. It takes us in worst cast out of
 business for 2 weeks and creates loads of work and stress.

 Don't ask me why the DB design is as it is, that's pretty complicated,
 insane, sooo wrong and not worth discussing in order to fix that issue and
 let the build jobs just do what they are meant to do.
 Have been there, didn't like it, went away!

 The initial build job is a dispatcher that decides which job to run. So
 far quite easy but it also checks for 2 conditions which requires to almost
 identical jobs asides of one of the repositories location.
 *So the jobs access mostly the same ressources including the database
 which must not be simultaneously!* So they are a kind of *siblings*
 The default is set that inhibits to spawn duplicate jobs but with this
 second condition is it changing a bit. The second condition requires to
 block a job if a duplicate or the sibling is running

 This brings me to a dumb situation. Either I find a way to:

- refer to related AND non-related jobs which may block a build
- block on top-level (the dispatcher). This works but scraps all my
efforts to get jobs not sharing same ressources to run in parallel
- do not block jobs and hope that the developers don't botch it and
wreck a database *yuk*

 Do you know a solution to block a job if a clone or a sibling already is
 running?



 Cheers

 Jan