Search code examples
gitgitlabgitlab-cigitlab-ci-runner

The term 'release-cli' is not recognized as a name of a cmdlet, function, script file, or executable program Gitlab CI/CD


I am learning about CI/CD with the goal in mind to optimize the development.

At work we use Windows 11 machines and we have our own Gitlab server (we dont use Public Gitlab).

After downloading Gitlab runner, I have followed the simple instructions to start the runner that were provided under Gitlab Repository -> Settings -> CI/CD -> Runners

My runner config:

[[runners]]
  name = "Runner for ESP32 test application"
  url = "https://xxx.xxx.xxxxxxxx.lt/"
  id = 5
  token = "xxxxxxxxxxxxxxxxxxx"
  token_obtained_at = 2023-12-11T09:30:58Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  shell = "pwsh"
  [runners.cache]
    MaxUploadedArchiveSize = 0

After I have created a runner, I have created a .gitlab-ci.yml file:


stages:          # List of stages for jobs, and their order of execution
  - release


release_job:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  rules:
    - if: $CI_COMMIT_TAG                 # Run this job when a tag is created
  script:
    - echo "running release_job"
  release:                               # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
    tag_name: '$CI_COMMIT_TAG'
    description: '$CI_COMMIT_TAG'


Solution

  • Using Shell (pwsh) executor...

    You are using a shell executor, moreover on Windows. The pipeline is written for docker container registry.gitlab.com/gitlab-org/release-cli:latest. Use docker executor.