Bamboo Source code checkout ignores alternative sub-directory
Asked by Gerald Ortner:

I created a plan where I want to checkout the sources from three different repositories in an alternative sub-directory each.

Bamboo creates the sub-dirs in the working directory but checks out the source code to the working dir root.

As the source dir is cleaned up before checkout I got the sources of one repo only.

Bamboo Version: 5.15.3 build 51515  
Source Code Repo: Plastic SCM plugin 5.10.1

UPDATE: issue still occurs with Bamboo 6.3.0  
Even if there is only one repo the sub directory option doesn't work. Maybe it's an issue of the plasticscm plugin.


Answers:
author: rsperafico
body: Hello [@Gerald Ortner](/t5/user/viewprofilepage/user-id/1170994),
> I want to checkout the sources from three different repositories in an alternative sub-directory each.
>
> As the source dir is cleaned up before checkout I got the sources of one repo only.

Since you mentioned the build is checking out of 3 repositories, you will be required to provide distinct "Checkout Directory" to each of your repositories, e.g.:

```
(Task 1) Source Code Checkout A
* Checkout Directory = directoryA

(Task 2) Source Code Checkout B
* Checkout Directory = directoryB

(Task 3) Source Code Checkout C
* Checkout Directory = directoryC
```

As a result, you will have in the Build Working Directory

```
<bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/directoryA
<bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/directoryB
<bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/directoryC
```

Kind regards,

Rafael

comments: author: Gerald Ortner
body: Hi Rafael,

that's what I did.

Here's the complete task config

![Screenshot from 2018-01-09 15-06-21.png](https://community.atlassian.com/t5/image/serverpage/image-id/12215iC53FFA9C83E1FF2C/image-dimensions/816x739?v=v2 "Screenshot from 2018-01-09 15-06-21.png")

After running the job only the source files of repo 3 (embeddedserver) exist in the working directory. The sub directories have been created but are empty.


author: rsperafico
body: Hello [@Gerald Ortner](/t5/user/viewprofilepage/user-id/1170994),

Thank you for your update.

Could you please make use of 3 Source Code Checkout tasks as suggested previously?

Kind regards,

Rafael


author: Gerald Ortner
body: Hi [@rsperafico](/t5/user/viewprofilepage/user-id/781554)  
even when I create just one task that checks out the source to a differen t directory the source remains in the working directory.   
Meanwhile I guess it's an issue of the plasticscm plugin because I tried the same with a git repo and it worked fine.


author: rsperafico
body: Hello [@Gerald Ortner](/t5/user/viewprofilepage/user-id/1170994),

Please, get in touch with 3rd party vendor explaining the issue you are experiencing, so they can review the plugin and release a new version with a fix.

Kind regards,

Rafael


author: Gerald Ortner
body: I informed the vendor about this issue.


author: somethingblue
body: Hi Gerald,

Bamboo doesn't do that automatically, but an alternative to this could be to break up the steps into discreet script tasks. So, task1 checks out the first target repo and copies it to the desired directory, task2 and 3 do the same thing, then task 4 does whatever he needs to with the local copies.

Hopefully this helps.

Cheers,

Branden

comments: author: Gerald Ortner
body: Thanks for the reply. I'll try this workaround.  
However the source code checkout task offers the possibility to checkout the source to a different directory. So it should work.

![Screenshot from 2018-01-09 14-25-35.png](https://community.atlassian.com/t5/image/serverpage/image-id/12213i7F2AB58026E90F1B/image-dimensions/468x278?v=v2 "Screenshot from 2018-01-09 14-25-35.png")  

update: I upgraded bamboo to 6.3.0 build 60304 and the issue remains.


Tags: check-out

sub-directory