Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Repository cloning path with a Windows runner pipeline

Kiko_BZ June 28, 2022

I am triying to create a custom pipeline with Bitbucket by using a Windows runner (on my own PC) in order to automate my building process on Unity game engine.

I have configured the bitbucket-pipelines.yml and the runner correctly, but I need to know the exact path where my repository is been cloned in order to open the Unity project.

I cannot find the local repository because it seems to be cleared after the step has been executed.

 

The "script" section of my step on the bitbucket-pipelines.yml file looks like this:

 

Start-Process -wait -FilePath C:\"Program Files"\Unity\Hub\Editor\2020.3.2f1\Editor\Unity.exe -ArgumentList "-batchmode","-nographics", "-quit", "logFile ./logbuild.log","-projectPath [THIS IS THE UNKNOWN INFO]", "-executeMethod BuildScript.PerformBuild"
Which is the exact path where the project is been cloned?
Thank you so much.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2022

Hi @Kiko_BZ,

The path where a repo is cloned when using a Windows runner is

{Path-to-atlassian-runner-dir}\atlassian-bitbucket-pipelines-runner\temp\{runner-uuid}\{some-number}\build

where
{Path-to-atlassian-runner-dir} is the path to the directory where you have the atlassian-bitbucket-pipelines-runner directory
{runner-uuid} is the UUID of the runner you are using
{some-number} is based on the EPOCH time, when the build gets started


You can create a variable during the build (in the script of your bitbucket-pipelines.yml file), get the location of the current directory (which is the clone directory), and then use that variable:

- $curDir=Get-Location
- Write-Host "$curDir"

I used the latter command to print the value of $curDir variable.

Is this something that works for you?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events