This article explains how to create an Azure DevOps project, clone its Azure Repos Git repository to a local folder, add your Ranorex Studio solution, and commit a Ranorex-specific .gitignore file to keep your repository clean.
Prerequisites
Before you start, make sure you have:
- Access to an Azure DevOps organization.
- Azure DevOps organization owner or project administrator permissions.
- Git installed on your workstation.
- Access to the Azure DevOps project or organization where you want to create the repository.
- A local Ranorex Studio solution that contains:
- A
.rxslnfile. - A
.rxtstfile.
- A
- A Windows build runner with Ranorex Studio or Ranorex Runtime installed and licensed, if you plan to run the solution from an Azure pipeline.
Review Azure DevOps Permissions
Before you create the project and repository, review the Azure DevOps organization, project, and repository settings that may affect repository access and pipeline creation.
Organization-level settings
In Azure DevOps, go to Organization Settings and review the following settings:
- Go to Pipelines > Settings and disable Restrict the creation of classic pipelines only if you plan to use Classic pipelines. YAML pipelines work without changing this setting.
- Make sure Public projects is turned off unless your organization intentionally requires public projects.
- Go to Users and confirm that the user creating the pipeline is a Project Administrator in the target project or has the required project collection permissions.
Project-level permissions
In Azure DevOps, go to Project Settings > Repositories > Security and make sure the group your user belongs to has the following permissions:
- Contribute
- Create branch
- Create tag
If your project uses YAML pipelines, review the following pipeline settings:
- Allow YAML pipelines: Enabled. Protect access to repositories in YAML pipelines: Enabled recommended.
- If Protect access to repositories in YAML pipelines is enabled, Azure DevOps prompts you to authorize repository access the first time the pipeline runs.
Repository-level permissions
Azure Pipelines uses a build service account to read source files and run the pipeline. Before you create the pipeline, make sure the build service account can access the repository.
- Go to Project Settings > Repositories.
- Select the repository.
- Go to Security.
- Select the build service account, for example:
- Build Service (ProjectName)
- Project Collection Build Service Accounts
-
Set the following permissions to Allow:
Permission
Required
Read
Yes
Contribute
Recommended
Create tag
Recommended
Bypass policies when completing pull requests
Optional. Use this only if your branch policies require it.
If your project protects the main branch with branch policies, ensure the pipeline branch builds successfully, or that the build service account has the required permissions to complete the workflow.
Create a New Azure DevOps Project
Create a project with Git version control so your Ranorex solution can be stored in a repository and used by pipelines.
- Sign in to your Azure DevOps organization.
- Create a new project, and set:
- Project name
- Description
- Click Advanced to expand the following fields:
- Version control: Git
-
Work item process: Basic (default) or as required by your organization
- Click Create project.
Create the repository folder
For the integration to work, your Ranorex Studio solution must be available to Azure DevOps through version control. In this guide, you do that by cloning the Azure Repos Git repository to a local folder (for example, on the Ranorex Studio machine).
- Create a folder where you want to store your repositories (for example, myProjects).
-
Open the folder.
Clone the Azure DevOps project folder
Clone the repository from Azure DevOps into your local folder:
- Open a terminal in your local folder. If you use Git for Windows, you can right-click an empty area and select Git Bash Here.
- In Azure DevOps, go to Repos > Files, select Clone, and copy the clone URL.
-
In the terminal, run:
$ git clone <clone-url> -
Press Enter.
Git downloads the repository into a new subfolder inside your local folder.
Add a Ranorex .gitignore file
A .gitignore file tells Git which files and folders to ignore so they don’t get committed. The integration can still work without it, but your commits may include unnecessary build files, output files, or temporary files.
- Copy the provided Ranorex
.gitignorefile into the root of your cloned repository folder. - Copy or drag your Ranorex Studio solution folder into the cloned repository folder.
- Confirm that your Ranorex Studio solution folder contains:
- A
.rxslnfile.
- A
-
After pulling in your Ranorex Solution File, your local Azure project repository folder should contain the following:
After you add the .gitignore file and Ranorex Studio solution, commit and push the files to Azure DevOps.
Open a terminal in the cloned repository folder and run:
git add .gitignore
git commit -m "Add .gitignore"
git push
As a result, refresh Repos > Files in Azure DevOps. You should see the .gitignore file in the repository.