The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events