Re: Jenkins 2.0 pipeline as code executor question

2017-05-12 Thread Marslo Jiao
Hi Cuong,

There's no any other files created outside of workspace.
I'm looking for the why the *# of executor* was set as* 2*, but multiple 
jobs running on this node.

I think it should be the issue of Jenkins.

On Friday, May 12, 2017 at 12:18:09 AM UTC+8, Cuong Tran wrote:
>
> Hi,
>
> What I meant is to you should update your build script so it doesn't 
> create files outside of the build workspace or anything that would prevent 
> it to run concurrently. For example, this creates file inside your 
> workspace and can run on multi-executor slave without any issue:
>
> stage {
>sh 'rm -f hello.txt; date > hello.txt' # hello is inside workspace
>sh 'npm install foo'
> }
>
> where it would cause problems when you run it concurrently:
>
> stage {
>sh 'rm -f /Users/devops/hello.txt; date > /Users/devops/hello.txt'
>sh 'npm install -g foo'
> }
>
>
> On Wednesday, May 10, 2017 at 8:40:31 PM UTC-7, Marslo Jiao wrote:
>>
>> What "avoid using locations outside of the workspace" means?
>>
>> On Thursday, May 11, 2017 at 1:10:59 AM UTC+8, Cuong Tran wrote:
>>>
>>> You should make your build commands work correctly when running inside 
>>> the same node (avoid using locations outside of the workspace).
>>>
>>> On Wednesday, May 10, 2017 at 4:52:06 AM UTC-7, Marslo Jiao wrote:

 Is there anyway that I can manage the executor number for the same 
 Jenkins job (using jenkins 2.0 pipeline as code)? All multiple builds in 
 the same job will failed due to resource conflict.


 Here is my situation:


- In the slave configuration, the *# of executors *was set as *2:*

  
 

- But lots Jenkins job will be triggered on this node at the same 
time:

  
 


 The Jenkinsfile is:
 node ('ios') {
 stage ("Preparation") {
 sh '''
 ... ...
 '''
 }
 stage ("Preparation") {
 sh '''
 ... ...
 '''
 }
 ...
 }

 Thanks a lot.

>>>

-- 
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/d16072d4-a37b-4a16-a6ee-8501d3c922fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-12 Thread Marslo Jiao
Hi Björn,

This job is about to build an app based on iOS. During the app building. 
The conflict, for example is, there's a key need to be installed like:
security unlock-keychain -p  xxx.keychain
security import  -k xxx.keychain -t priv -f pkcs12 -A -P <
LOGIN_PWD>

The key will be unlock once and import once. It will cause conflict when 
the older-build is building the package, and the newer-build unlock the key.

On Thursday, May 11, 2017 at 10:16:58 PM UTC+8, Björn Pedersen wrote:
>
>
> Hi, 
>
> what kind of ressource conflict is happening? If some part of your build 
> opens a tcp port, then conflicts may be resolved by using the 
> port allocator plugin.
>
> Björn
>

-- 
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/2f509fb4-24b9-406b-bdc2-68d905feefe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-11 Thread Cuong Tran
Hi,

What I meant is to you should update your build script so it doesn't create 
files outside of the build workspace or anything that would prevent it to 
run concurrently. For example, this creates file inside your workspace and 
can run on multi-executor slave without any issue:

stage {
   sh 'rm -f hello.txt; date > hello.txt' # hello is inside workspace
   sh 'npm install foo'
}

where it would cause problems when you run it concurrently:

stage {
   sh 'rm -f /Users/devops/hello.txt; date > /Users/devops/hello.txt'
   sh 'npm install -g foo'
}


On Wednesday, May 10, 2017 at 8:40:31 PM UTC-7, Marslo Jiao wrote:
>
> What "avoid using locations outside of the workspace" means?
>
> On Thursday, May 11, 2017 at 1:10:59 AM UTC+8, Cuong Tran wrote:
>>
>> You should make your build commands work correctly when running inside 
>> the same node (avoid using locations outside of the workspace).
>>
>> On Wednesday, May 10, 2017 at 4:52:06 AM UTC-7, Marslo Jiao wrote:
>>>
>>> Is there anyway that I can manage the executor number for the same 
>>> Jenkins job (using jenkins 2.0 pipeline as code)? All multiple builds in 
>>> the same job will failed due to resource conflict.
>>>
>>>
>>> Here is my situation:
>>>
>>>
>>>- In the slave configuration, the *# of executors *was set as *2:*
>>>
>>>  
>>> 
>>>
>>>- But lots Jenkins job will be triggered on this node at the same 
>>>time:
>>>
>>>  
>>> 
>>>
>>>
>>> The Jenkinsfile is:
>>> node ('ios') {
>>> stage ("Preparation") {
>>> sh '''
>>> ... ...
>>> '''
>>> }
>>> stage ("Preparation") {
>>> sh '''
>>> ... ...
>>> '''
>>> }
>>> ...
>>> }
>>>
>>> Thanks a lot.
>>>
>>

-- 
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/195ce203-ed4e-4c54-9c26-12f21d937f3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-11 Thread 'Björn Pedersen' via Jenkins Users

Hi, 

what kind of ressource conflict is happening? If some part of your build 
opens a tcp port, then conflicts may be resolved by using the 
port allocator plugin.

Björn

-- 
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/cc7438af-b615-4461-97cc-73b97e9c6ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-10 Thread Marslo Jiao
What "avoid using locations outside of the workspace" means?

On Thursday, May 11, 2017 at 1:10:59 AM UTC+8, Cuong Tran wrote:
>
> You should make your build commands work correctly when running inside the 
> same node (avoid using locations outside of the workspace).
>
> On Wednesday, May 10, 2017 at 4:52:06 AM UTC-7, Marslo Jiao wrote:
>>
>> Is there anyway that I can manage the executor number for the same 
>> Jenkins job (using jenkins 2.0 pipeline as code)? All multiple builds in 
>> the same job will failed due to resource conflict.
>>
>>
>> Here is my situation:
>>
>>
>>- In the slave configuration, the *# of executors *was set as *2:*
>>
>>  
>> 
>>
>>- But lots Jenkins job will be triggered on this node at the same 
>>time:
>>
>>  
>> 
>>
>>
>> The Jenkinsfile is:
>> node ('ios') {
>> stage ("Preparation") {
>> sh '''
>> ... ...
>> '''
>> }
>> stage ("Preparation") {
>> sh '''
>> ... ...
>> '''
>> }
>> ...
>> }
>>
>> Thanks a lot.
>>
>

-- 
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/c300e7c1-a4f3-4579-8208-8941083bef71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-10 Thread Cuong Tran
You should make your build commands work correctly when running inside the 
same node (avoid using locations outside of the workspace).

On Wednesday, May 10, 2017 at 4:52:06 AM UTC-7, Marslo Jiao wrote:
>
> Is there anyway that I can manage the executor number for the same Jenkins 
> job (using jenkins 2.0 pipeline as code)? All multiple builds in the same 
> job will failed due to resource conflict.
>
>
> Here is my situation:
>
>
>- In the slave configuration, the *# of executors *was set as *2:*
>
>  
> 
>
>- But lots Jenkins job will be triggered on this node at the same time:
>
>  
> 
>
>
> The Jenkinsfile is:
> node ('ios') {
> stage ("Preparation") {
> sh '''
> ... ...
> '''
> }
> stage ("Preparation") {
> sh '''
> ... ...
> '''
> }
> ...
> }
>
> Thanks a lot.
>

-- 
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/b2a7fd65-bed9-4b1f-946b-9d8269d9939a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.0 pipeline as code executor question

2017-05-10 Thread Marslo Jiao
The Jenkinsfile is

node ('ios') {
stage ("Preparation") {

// repo checkout

}
stage ("Build") {
// npm install
// npm run my-command

}
...
}

Build Trigger is:




-- 
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/d30cb56e-3b31-4967-8ef7-519afb2ce15a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.0 pipeline as code executor question

2017-05-10 Thread Marslo Jiao


Is there anyway that I can manage the executor number for the same Jenkins 
job (using jenkins 2.0 pipeline as code)? All multiple builds in the same 
job will failed due to resource conflict.


Here is my situation:


   - In the slave configuration, the *# of executors *was set as *2:*

 


   - But lots Jenkins job will be triggered on this node at the same time:

 



The Jenkinsfile is:
node ('ios') {
stage ("Preparation") {
sh '''
... ...
'''
}
stage ("Preparation") {
sh '''
... ...
'''
}
...
}

Thanks a lot.

-- 
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/660f282d-9db0-4d95-aa44-aca876a71570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.