If you're using pipeline, change to that directory with the
dir('/users/username/projectname') { } wrapper around the checkout step;If you're using a freestyle job, use the git plugin extension 'checkout to a subdirectory' <https://plugins.jenkins.io/git/#checkout-to-a-sub-directory> On Fri, Mar 26, 2021 at 10:54 AM [email protected] <[email protected]> wrote: > OK, so this is kind of complex so hang with me. We're moving from > StarTeam to Github and I'm trying to reproduce what I'm doing in StarTeam > with Github. StarTeam was easy because I owned the repository machine as > well as administrated the tool. With Github, we're hosted. So I'm admin > on the project but can't create an RSA Token on the machine for easy > access. So I had to play around to make a personal access token work. In > order to make that access token work, I had to run the checkout job on a > different node so that it was running as a user that lived in Github as > well (access token's namesake). So when this job gets called from the > jenkins job, I want it to clone to the calling job's workspace > (/opt/jenkins/workspace/<project_name>). Well since in order to > authenticate, it lives in it's own shell, the workspace for this guy, and > where it wants to clone to, is /home/<username>/<project_name>. All that > for my question: how can I specify what folder to checkout to? I tried to > use "checkout to specific local branch" but it fails saying "is not a valid > branch name". Well, yeah, branch is referring to branch not folder, lol. > In StarTeam this is easy, you just specify working folder. Any help? > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/128374b8-63d5-4b8c-86bb-5f214f5e68d2n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/128374b8-63d5-4b8c-86bb-5f214f5e68d2n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtG6VTjt8F7Vj5pJW13VQJTfxCqRuZuDHjj5zZTa3jJ9%3Dg%40mail.gmail.com.
