why my pipeline creates different workspaces?

36 views
Skip to first unread message

jesus fernandez

unread,
Oct 8, 2020, 4:50:26 AM10/8/20
to Jenkins Users
I am quite new to Jenkins. I managed to create a simple pipeline to pull from perforce and build the project every commit, but I find sometimes it creates a different workspace such as project@2, project@tmp, project@tmp@2 and so on... why does this happen I have even set the customworkspace. Sorry if this is an obvious question. Here is my pipeline: 


pipeline 
{   
    agent {
        node {
            label 'master'
            customWorkspace 'C:/Users/User/.jenkins/workspace/Project'
        }
    }
    options { timestamps () }
    
    stages{
        stage('Get latest'){
            steps{
                p4sync charset: 'none', credential: 'somecredentials', 
                populate: syncOnly(force: false, have: true, modtime: false, 
                parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], 
                pin: '', quiet: true, revert: false), 
                source: streamSource('//Project/main')   
            }
        }
        
        stage('Build'){
            steps{
                script {
                    def msbuild = tool name: 'MSBuild', type: 'hudson.plugins.msbuild.MsBuildInstallation'
                    bat "\"${msbuild}\" Project/Source/age2-GRDK.sln /t:Rebuild" 
                } 
            }
        }
    }
    
    post{
        changed{
            mail to: 'somemail',
            subject: "Status of: ${currentBuild.fullDisplayName}",
            body: "${env.JOB_NAME} has result ${currentBuild.result}"
        }
    }
   
}

Victor Martinez

unread,
Oct 30, 2020, 2:39:40 PM10/30/20
to Jenkins Users
Directories with an ampersand (like @tmp, @script, @libs, @2) are specifically created by the pipeline internals, each one got a different context. The ones with number are most likely related to a concurrent build running while other previous build is still running, to avoid clashing with accessing the same workspace

jesus fernandez

unread,
Nov 6, 2020, 6:20:21 AM11/6/20
to Jenkins Users

Gracias por aclararlo ahora tiene sentido :)
Reply all
Reply to author
Forward
0 new messages