How to use Gitlab CI using host configuration?

Hello Gitlab community,

My name is Panagiotis Parthenis and I am a software Engineer.
I was trying to use the GitLab CI/CD pipelines, but I would need some help. In my case, I would like each push to execute the CI/CD pipelines and build the project locally on my PC.

In order to work properly, I install a windows runner locally on my windows PC. The Runner is configured using the shell option. Also, I disable the other (defaults) runners, to force the GitLab CI/CD use my runner.

The CI configuration from .gitlab-ci.yml is the following
- build
stage: build
- cd C:\pp\project
- ls
- mvn clean install

But script execution mvn clean install I am getting the following error:

I would like to use the maven, java which is installed on my host Windows PC, in which runner is installed. How may I define the maven from my PC on CI/CD.

Thanks in advance for your time and your collaboration.

Best regards,
Panagiotis Parthenis

You have two options,

  1. specify full path to mvn binary like C:\some\path\to\mvn
  2. change PATH environment variable and add path of the directory where your mvn binary is. Add to the PATH on Windows 10 | Architect Ryan

Hello Balonik,

Thank you for your response and I am sorry for my late response but I haven’t time to validate your solution earlier.

It actually worked :rocket: !!
I used the 2nd option, to change the PATH environment variable!!

I really appricate your help !!

Best regards,
Panagiotis Parthenis