-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch CI_PROJECT_ID from gitlab instance #1168
Comments
Yeah, it's probably best to just leave it undefined.
Use this one for now. |
sweet! thank you |
It is better to set CI_SERVER_PROTOCOL: "https"
CI_SERVER_PORT: "443"
CI_SERVER_URL: "${CI_SERVER_PROTOCOL}://${CI_SERVER_HOST}:${CI_SERVER_PORT}"
CI_API_V4_URL: "${CI_SERVER_URL}/api/v4"
CI_JOB_TOKEN: glpat-XxXx(personal access token) and get the project id from gitlab api or even acquire CI_JOB_TOKEN via JWT? OAUTH2? another machanism? |
Wondering why the project ID is always set to 1217, wouldn't it be better to simply try to get the project ID at runtime then if the latter fails we simply keep it empty so the user can overwride it? |
We will always default to 1217. Are you guys having problems overriding it to your desired value? |
I have no problem to set it manually, but i want to set it automatically by making in API request in gitlab-ci-local internally |
Auto fetch CI_PROJECT_ID from public repositories., implement something using CI_JOB_TOKEN to fetch CI_PROJECT_ID from private repositories. I've changed the title |
gitlab-ci-local/src/predefined-variables.ts
Line 23 in 357299d
I am using CI_PROJECT_ID in scripts to
curl
the GitLab API, and it's always failing because 1217 is not correct, nor a valid id for any project.in my curl scripts i am looking up the id by searching project names. otherwise i am setting CI_PROJECT_ID myself in other projects' dotenv files within my job.
either way, it doesn't seem wise to define a variable which will never be correct
i can imagine a scenario where a blank CI_PROJECT_ID might cause problems for people, maybe we can discuss a solution for this case? but ideally we would set it to the correct id based on the full path results from
git remote origin
? and if we're offline we can use cached previous results from a file in.gitlab-ci-local/
or make it blank, or something elseThe text was updated successfully, but these errors were encountered: