I am currently learning about CI/CD. My goal is to learn how to optimize and automate some of the daily tasks that I go through at my work. For example, creating a release everytime something is pushed to the repository with a new tag. I had some experience with Github actions and it was really easy to set it up. It only took a few minutes.
However I cannot get this to work on GitLab.
I have tried to setup self-managed runner. I have followed the steps below :
Installed GitLab runner on windows. I have followed the following guide:
Install GitLab Runner on Windows | GitLab
I have started and registered runner. I can confirm that everything went fine because I can see active runner:
My .gitlab-ci.yml file:
stages: # List of stages for jobs, and their order of execution
- if: $CI_COMMIT_TAG # Run this job when a tag is created
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
Issues that I have encountered along the way:
When I initially tried to run the job (I have created a tag) , I got some error about pwsh. Something like:
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh":
The error did not go away even after I have manually installed powershell using the following command line command:
winget install Microsoft.PowerShell
So I have decided change the shell from the “pswh” to “powershell” in my config.toml file as suggested in this stackoverflow post:
After this, I no longer get error regarding pwsh. I tried to run job again. This time, I am getting different error:
release-cli : The term 'release-cli' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:278 char:1
I have manually installed release-cli by following installation steps here:
I have added it to my user environment path and confirmed if I can use release-cli from the cmd and powershell:
However, even after manually installing release-cli and confirming that it works, I am still getting the same issue when I try to run job.
We use our own GitLab server so I assume using Runner SaaS is not an option for us, is that correct?
What could be the reason that even after manually installing release-cli I still cannot get the job to run and return an error saying that it cannot run release-cli ?