Re: SharedLibrary, clone, using resources

2017-11-07 Thread Jakub Michalec
I have a bit different scenario, I don't use Jenkinsfile in this jobs, 
they're more like 'utility' jobs eq Clean Azure Env etc.

So, I want to get pipeline groovy script which use Powershell in stages 
from folder scripts.

Also, I use Stash (atlassian git).

I decide to create new repo, just for Jenkins shared library, but still 
getting only scripts folder would made less noise :)


W dniu poniedziałek, 6 listopada 2017 19:17:59 UTC+1 użytkownik itchymuzzle 
napisał:
>
> Sounds a little related: 
>
> Provide lightweight checkout capability for bitbucket to avoid repo clone 
> of rmulti-branch pipelinejobs link 
>  
>

-- 
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/3ba67f4c-0319-4caa-9011-aee247d50ccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-06 Thread itchymuzzle


Sounds a little related: 

Provide lightweight checkout capability for bitbucket to avoid repo clone 
of rmulti-branch pipelinejobs link 
 

-- 
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/3a780803-e052-42c3-a7b8-e5cb471c13cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-03 Thread jerome
Jenkins checkout the Jenkinsfile first and then the scm inside the jenkins 
checkout. If you can, try to enable the Lightweight checkout on the 
jenkinsfile checkout.

Side note, I for one make a repos for the jenkins file that is not the same 
as the code repos, so my server and build setup evolve at different pace as 
the code and I can build old version into a recent configuration (jenkins 
updated and jenkinsfile needed to be modified for a while). I did more 
enjoy doing it this way then having my Jenkins file static into a revision 
of the source repos. I can also try different Jenkinsfile with the same 
source code Jenkinsfile checkout use build parameter.
Side note #2: I also use mercurial with sub repos, so my jenkinsfile pull 
subrepos for the shared scripts/lib/exe that I use during the build 
process, this work like a charm.

-- 
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/3bbb7e7e-f34b-47b6-9218-84dd8014a009%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-03 Thread Mark Waite
On Fri, Nov 3, 2017 at 10:37 AM itchymuzzle  wrote:

> I have this same question.
>

I thought that the branch source plugins (GitHub, Gitea, and possibly
Bitbucket) provide a technique to avoid the copy of the full repository to
retrieve the Jenkinsfile.

However, if you're trying to avoid cloning the shared library repository,
I'm not sure what that will gain, since the shared library repository needs
to provide multiple files, not just the single Jenkinsfile.

I think it is wise to keep the size of the shared library repository small,
containing only shared library components.  You don't want unrelated
changes causing concern for the users of the shared library.

Mark Waite

> --
> 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/c42cc35d-d081-4cf1-8435-bc96b9abf386%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: SharedLibrary, clone, using resources

2017-11-03 Thread itchymuzzle
I have this same question.  

-- 
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/c42cc35d-d081-4cf1-8435-bc96b9abf386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-03 Thread Jakub Michalec


W dniu piątek, 3 listopada 2017 16:26:08 UTC+1 użytkownik itchymuzzle 
napisał:
>
> Please post something which is readable.  Thanks.
>

Hello,
I have question regarding SharedLibrary, I put some powershell script 
(/scripts/…) in same repository and I want to use them during builds.

Atm, I use it like this

@Library('JenkinsSharedLibrary') _


pipeline {
agent { node { label 'azure' } }


options {
skipDefaultCheckout()
}

stages {
stage('Clean Workspace') {
steps {   
deleteDir()
checkout scm
}
}


stage()
}


Thanks to that in workspace I get all scripts from repo, but jenkins job is 
cloning repo two times
• First, to get Job from Repository (Pipeline from SCM)
• Second, in checkout scm

In logs

Get job:

Obtained jobs/Cloud_Deployment/cloud_azure_polling.groovy from git http:
//git.***.jenkinssharedlibrary.git
Loading library JenkinsSharedLibrary@master



Clone Lib:
Cloning the remote Git repository
Cloning repository http://git.***./jenkinssharedlibrary.git



Is it possible to made it in one step? 

-- 
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/75356e13-9354-4f50-86c7-1570f9127f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SharedLibrary, clone, using resources

2017-11-03 Thread itchymuzzle
Please post something which is readable.  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/cc1a1fd3-d2c6-440c-b3be-642f1634dbc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


SharedLibrary, clone, using resources

2017-11-03 Thread Jakub Michalec


Hello,

I have question regarding SharedLibrary, I put some powershell script 
(/scripts/…) in same repository and I want to use them during builds.

 

Atm, I use it like this

 

@Library('JenkinsSharedLibrary') _

 

pipeline {

agent { node { label 'azure' } }

 

options {

skipDefaultCheckout()

}



stages {

stage('Clean Workspace') {

steps {   

deleteDir()

checkout scm

}

}

 

stage()

}

 

Thanks to that in workspace I get all scripts from repo, but jenkins job is 
cloning repo two times

   - First, to get Job from Repository (Pipeline from SCM) 
   - Second, in checkout scm 

 

In logs

 

Get job:

 

Obtained jobs/Cloud_Deployment/cloud_azure_polling.groovy from git 
http://git.***.jenkinssharedlibrary.git

Loading library JenkinsSharedLibrary@master

 

Clone Lib:

Cloning the remote Git repository

Cloning repository http://git.***./jenkinssharedlibrary.git

 

Is it possible to made it in one step?

-- 
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/9d0a6fd4-bd4b-44e5-b774-9a043fbc05fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.