firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.03k stars 115 forks source link

extra-hosts via config file #1264

Closed alexey-vostrikov closed 2 weeks ago

alexey-vostrikov commented 2 weeks ago

it is working if --extra-host argument used

but i want to specify extra-host in ~/.gitlab-ci-local/variables.yml

for groups and projects

alexey-vostrikov commented 2 weeks ago

for example like this

global:
  CI_SERVER_URL: "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}"
  CI_REGISTRY: "${CI_TEMPLATE_REGISTRY_HOST}"
  CI_API_V4_URL: "${CI_SERVER_URL}/api/v4"
  CI_JOB_URL: "${CI_SERVER_URL}/${CI_PROJECT_PATH}/-/jobs/${CI_JOB_ID}"
  CI_PIPELINE_URL: "${CI_SERVER_URL}/${CI_PROJECT_PATH}/pipelines/${CI_PIPELINE_IID}"
  CI_JOB_TOKEN: "${AUTHORIZATION_PASSWORD}"
  PRIVILEGED: true
  NEEDS: true
  extra_hosts:
    - "gitlab.example.com:10.10.10.5"
firecow commented 2 weeks ago

Command line arguments has nothing to do with .gitlab-ci-local-variables.yml or ~/.gitlab-ci-local/variables.yml

You have to use .gitlab-ci-local-env og ~/.gitlab-ci-local/.env for those :smile:

alexey-vostrikov commented 2 weeks ago

OK, i found that in .env

EXTRA_HOST=registry.local:10.10.10.1 gitlab.local:10.10.10.2

is worked, but it should be documented at least

alexey-vostrikov commented 2 weeks ago

/reopen

alexey-vostrikov commented 2 weeks ago

If i use .env i can not set different extra_hosts for different group