Quantcast

How to use Jenkinsfile in pipeline builds?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to use Jenkinsfile in pipeline builds?

Mark Allison
I have a pipeline build and I want to move it to source control. I've copied out the script from the the project into a Jenkinsfile and added it to git. In my pipeline I have code like this:

#!groovy​
node
{

        stage
('checkout') {

            deleteDir
()
            git
'http://git.server/markallison/my-project.git'
       
}
       
        stage
('build') {
           
// build code


           
}    

   
... etc

I like to have a clean workspace every time the build runs, so how do I do this without having to have a separate project for my Jenkinsfile?            

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0cf05e7f-0f14-4f5f-94d6-0995b33ac500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use Jenkinsfile in pipeline builds?

Mark Allison
Actually this works fine, ignore. I had misconfigured something.

On Wednesday, 11 January 2017 20:10:36 UTC, Mark Allison wrote:
I have a pipeline build and I want to move it to source control. I've copied out the script from the the project into a Jenkinsfile and added it to git. In my pipeline I have code like this:

#!groovy​
node
{

        stage
('checkout') {

            deleteDir
()
            git
'<a href="http://git.server/markallison/my-project.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit.server%2Fmarkallison%2Fmy-project.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE5_FTK2UBvlNa4RzowtEEgJUN_Xg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgit.server%2Fmarkallison%2Fmy-project.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE5_FTK2UBvlNa4RzowtEEgJUN_Xg&#39;;return true;">http://git.server/markallison/my-project.git'
       
}
       
        stage
('build') {
           
// build code


           
}    

   
... etc

I like to have a clean workspace every time the build runs, so how do I do this without having to have a separate project for my Jenkinsfile?            

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/7c6c8d1a-7ff1-41bb-b329-8c6e580d99ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...