Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add an external URL to the proxy

I am having an issue with a test run being stuck via a GitLab pipeline, though it does work when I run my test locally. I have found the common issue which is it gets stuck when trying to call an external URL.

Example url: https://api.us.cajama.com/v3.6

From what I have heard, it might need to be added to the proxy, but I am not sure how to do that. Can someone direct me in adding this URL to the proxy so GitGab have access to this external service?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is it a change in the gitlab-ci.yml file or something else?

>Solution :

You need to configure your proxy settings

Add your environment variable to gitlab-ci.yml

variables:
  http_proxy: http://your-proxy-server:proxy-port
  https_proxy: http://your-proxy-server:proxy-port
  no_proxy: "localhost,127.0.0.1,api.us.cajama.com"

Add this proxy settings to your job that requires access to the external URL

stages:
  - test
    test-job:
      stage: test
      script:
        - echo "Running tests"
        - export http_proxy="http://your-proxy-server:proxy-port"
        - export https_proxy="http://your-proxy-server:proxy-port"
        - export no_proxy="localhost,127.0.0.1,api.us.cajama.com"
        - your-test-command

You can fill the placeholders with your own record

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading