-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clone repos under directory with same name as repo by default #776
Comments
This might already be possible and just needs some documentation showing how to do it. I tried to configure this behavior, but couldn't really do it. The first impediment is that it's not easy to get the repo name. I had to do the following to extract it: I tried to use
This ended up just creating a directory called |
Git plugin documentation suggests this can be achieved with pipeline {
agent any
options {
skipDefaultCheckout true
}
stages {
stage('Checkout') {
steps {
dir('subdir') {
checkout scm
}
}
}
}
}
That should not be the default behavior, because longer directory paths have a higher risk of exceeding the MAX_PATH limit on Windows. |
|
@KalleOlaviNiemitalo Can you point me to the code that sets the value of the workspace directory currently? I don't know whether this is handled by the plugin or whether this is something built into Jenkins itself. |
@tudortimi, I think it's WorkspaceLocatorImpl in branch-api-plugin. That implements the WorkspaceLocator extension point but is not listed on that page because of bug jenkins-infra/backend-extension-indexer#58. |
The WorkspaceLocator extension point is called from Slave.getWorkspaceFor in core, which is called from AbstractBuild.decideWorkspace in core; that one also checks for a custom workspace. |
What feature do you want to see added?
The plugin generally creates a workspace based on the name of the Bitbucket project, repo and branch names. This means that a repo called
some-repo
will not be cloned under a directory calledsome-repo
(as agit clone
would do), but under something likesome-project_some-repo_some-branch
. This can cause issues with tools that use the directory name (e.g. Gradle uses the directory name as a project name).It's clear that all three names have to be used in order to generate unique directory names. It would be great if the plugin would have the option of creating an extra directory where the code is clone:
some-project_some-repo_some-branch/some-repo
.Upstream changes
No response
The text was updated successfully, but these errors were encountered: