0

I'm using the below code in the gilab-ci.yml file

stages:
    - test

newman_tests:
    stage: test
    image:
        name: postman/newman
        entrypoint: [""]
    script:
        - newman --version
        - newman run ./Postman_Collections/APIAutomation.json

Also, this is my below config.toml file.

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "Landlord Sales"
  url = "https://gitlab.shared.pub.tds.*****.com/"
  token = "<token>"
  executor = "shell"
  shell = "powershell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "AimoPractice"
  url = "https://gitlab.com/"
  token = "<token>"
  executor = "shell"
  shell = "powershell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

This is getting executed for https://gitlab.com/ url. I'm using a specific runner as below: enter image description here I'm getting the below error after executing the pipeline.

enter image description here

Also, I referred to the below solution- $CI_COMMIT_TAG in "if" statemets of regular job through which I understood that I should be using some tags (Correct me if I'm wrong)

Also, let me know if I need to make any changes to the code.

Patrick
  • 2,885
  • 1
  • 14
  • 20
Jagruuti
  • 104
  • 2
  • 14
  • 1
    Given you're running on a windows runner, are you hosting your own runner with a custom executor? It's attempting to run a powershell script that has bash inside it. – Patrick Oct 11 '21 at 01:30
  • Hi @Patrick, I have edited my description. I'm executing on Windows 10. I'm using a specific runner with Gitlab.com. While registering the gitlab-runner, I selected the shell executor. – Jagruuti Oct 11 '21 at 04:32
  • You need to go and quickly re-register your runners with a new token. I can't edit your post because the queue is full (probably from people who are trying to do the same edit I am), but those token are a secret, and can now allow others to de-register your runners. – Patrick Oct 11 '21 at 17:59
  • @Patrick But why should I re-register the runner, if I have registered it properly for the first time? If you want you can answer this question if you are unable to edit it. – Jagruuti Oct 12 '21 at 04:10
  • 1
    Coming back to this, I've not been able to reproduce your problem. I've registered a fresh powershell runner (using runner version 14.3), used (mostly) your exact CI you posted above, and the script ran fine. One thing to note is that if you're using _exactly_ what you posted above, you need to add a `tag` key to your CI/CD to ensure it's using your runner exclusively. Otherwise shared runners may pick up untagged jobs if you have them enabled. I don't think that's the issue though, since you're obviously on a windows box. – Patrick Oct 21 '21 at 03:55
  • Hey @Patrick , I added tags and it is working now. But I'm getting a new error- newman : The term 'newman' is not recognized as the name of a cmdlet, function, script file, or operable program. – Jagruuti Oct 21 '21 at 10:49

0 Answers0