Bitbucket pipellines debugging locally on windows 10 ?

TV
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 19, 2018

I'm trying to debug bitbucket pipelines locally on my machine(Windows 10, Hyper-V). I followed the tutorial https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html. However, when I mount the volume on the container, there are no folders in it, it is empty.  

I'm running this command :

Capture.PNG

 

 

 Can anyone please suggest what should be done. It will be helpful. Thank You!

2 answers

0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2018

Hi,

Can you verify the *full path* for the volume mounting? Is the full path actually "/host_mntC/z_copied" or is it a subdirectory of other directories?

From the docker CLI documentation:

When the host directory of a bind-mounted volume doesn’t exist, Docker will automatically create this directory on the host for you. In the example above, Docker will create the /doesnt/exist folder before starting your container.

https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only

This seems to be consistent with the behaviour you're seeing.

Thanks,

Phil

0 votes
Gabriel M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2018

Hi TV,

Did you try to set up a Dockerfile to run into your container?

I'm asking this because, you may be able to set up a Docker File that runs your scripts that, for example:
1) Clone your repository
2) Run your builds/tests

You can also take a look on this Docker documentation that has some good tips on how to achieve it:
https://docs.docker.com/engine/reference/commandline/build/#examples

TV
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 20, 2018

Hi Gabriel,

Yes, I have a Dockerfile. I can run the builds in it. But when I mount the volume in the container for the image it doesn't have any file in it.

Can you suggest anything please.

Thank You!

Gabriel M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2018

Hi TV,

 

I think that you can add something like this to your Dockerfile (before the Build step):

FROM ubuntu
ADD .ssh /root/.ssh // For the private and public key
RUN mkdir /usr/… // For copying the known_hosts file
ADD known_hosts /usr/… // Copy the known_hosts file.
RUN mkdir /opt/myservice/code_to_be_synced
RUN cd /opt/myservice/code_to_be_synced
RUN git clone username@gitrepo // This is to clone the code base

These steps add an SSH key to your container and, clone your repository. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events