How to execute more code after rescue part

2017-11-14 Thread stanley . shen
Hello, all I am having a flow job like this: /* functions to parse github pull requst , and some variables for state */ def result = false guard { job1 . ### will be failed job2 result = true } rescue { } if (result) { add comment to pull request set build to SUCCESS } else {

jenkins is very slow after a long time running

2017-08-04 Thread stanley . shen
Hello, all Recently, we meet this issue again and again. After some time, the jenkins becomes very very slow to open, but from backend , it's still working. And I see there are many light process related to jenkins, last time when it happens, I see there are about 1K ps -efL | grep jenkins

Re: How can I get inject environment from a freestyle job in pipeline job

2017-06-28 Thread Stanley Shen
. Regards, Stanley > On Jun 29, 2017, at 1:24 AM, Richard Ginga <rgi...@disruptorbeam.com> wrote: > > #1. try unclicking "Use Groovy sandbox" at the bottom of the script window. > > #1 and #2 could be you don't have permissions. I am an admin of my jenkins > m

Re: How can I get inject environment from a freestyle job in pipeline job

2017-06-28 Thread Stanley Shen
Thanks for replying. I tried solution #1 you provided, but it report error like "org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method” For #2, it also report error like “org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:

How can I get inject environment from a freestyle job in pipeline job

2017-06-27 Thread stanley . shen
Hello, all I am trying to trigger a freestyle job in pipeline and need to get a inject environment from that job. Before with flow job, we can use thing like c = build("test job1") uuid = c.build.properties["environment"]["uuid"] But I didn't find a way to do this similar in pipeline script.

How to mount volume correctly for jenkins docker slave

2017-03-10 Thread stanley . shen
Hello, all I am having a docker image used for jenkins slave. I tried to mount a volume from the host VM, but during job running, it fails to create things in mounted volume. It shows permission denied, I added RW to the volume "/repo/test:/home/ubuntu/repo:rw". The current user is ubuntu, I

How to distinct github push/merge event in github plugin

2017-02-23 Thread stanley . shen
Right now we are using github plugin to do something automatically. When some code is pushed to repo, the job will be triggered. But we have more specific requirement that the job is triggered only when we merge a PR. Normal direct push will not trigger this job. How can we do that? It seems

Re: How to initialize some bash helper function in all bash scripts

2017-02-04 Thread stanley . shen
Thanks for reply. Yes, they works, but in both ways, we need some manual configuration on jenkins master/slave, and it makes the maintenance hard if there are quite lot such things. I am trying to find a way so that it's wholly independent on jenkins master/slave so that even we add a new

How to initialize some bash helper function in all bash scripts

2017-02-03 Thread stanley . shen
Hello, all I am having a requirement to share some bash script function in nearly all jobs. Right now I defined them as environment variable, and eval them in jobs as needed. I was trying to find a more elegant way but got no lucky, for example in some where I can define some bash functions

Is there a plugin to execute bash script in docker container

2017-01-23 Thread stanley . shen
Hello, all I am having some jobs need to be executed exclusive in one jenkins node, the block plugin helps in this case. But I am wondering if there is better solution, for example we can have docker container to execute such bash scripts. I had a look in jenkins plugin but it seems I didn't

How to inject bash function to "execute bash" step for all jobs

2016-11-21 Thread stanley . shen
Hello, all I am having one bash function and I want to use it in all "execute bash" step. My Idea is that we can define the bash function in somewhere, and it can be inject to all "execute bash". Then I no need to do some manual work to load this function and I can use it directly. Is there

How to limited user to certain jobs

2016-10-05 Thread stanley . shen
Hello, all I am trying to limited some user to access certain jobs, and cannot see other jobs which are not related to them. I am using the "Project-based Matrix Authorization Strategy" to access control, and it seems I cannot get what I want by this. Also I try to create user view, but which