Reputation: 2626
I created this simple pipeline where I am pulling a bitbucket repo -
pipeline {
agent any
stages {
stage('Checkout from bitbucket') {
steps {
echo "Hello World"
git branch: 'feature/myFeature', changelog: false, credentialsId: 'my_bitbucket', poll: false, url: 'https://[email protected]/IT_AEM/infrastructure.git'
}
}
}
}
When I run the build, it succeeds. Where is the git repo downloaded in Jenkins and where can I view it?
Cheers
Upvotes: 7
Views: 18984
Reputation: 5319
Your repo is cloned to your workspace in default. $WORKSPACE
environment variable contains this path. You can define the workspace in configuration of nodes. You can see some details about workspace in this post: Inconsistent Jenkins workspace path on slave machines
Upvotes: 6
Reputation: 102
As said here:
Jenkins clones git repository to the job workspace in
${JENKINS_HOME}/jobs/<JOB_NAME>/workspace
And as it says here you can modify this path:
After adding a new git repository
(project configuration > Source Code Management > check the GIT option
) to the project navigate to the bottom of the plugin settings, just above Repository browser region. There should be an Advanced button. After clicking it a new form should appear, with a value described as Local subdirectory for repo (optional). Setting this tofolder
will make the plugin to check out the repository into the folder relative to your workspace. This way you can have as many repositories in your project as you need, all in separate locations.
Upvotes: 2