简体   繁体   中英

Deno - Gitlab Private Repo

Have created a multi-repo project. Aka each repo can execute seperately but also relies on other modules (which can also execute seperately) for specific tasks.

These are all stored in a private gitlab account/project/repo.

After doing some reading, it looks like GitLab don't support PA tokens for reading a private repo like Deno suggests.

Deplying manually with a Deploy Token works as expected aka

https://{username}:{token}@gitlab.com/{user}/{project}/{repo}.git

However, I'm looking to automate the deployment process as much as possible. So it'd be great to get any info required to make this possible. Is there an alternative method to achieving a simple import?

import { something } from 'https://gitlab.com/{user}/{project}/{repo}/mod.ts'

Is there something I'm missing? or is this only achievable manually/hooking into the GL API to automate it yourself/moving to a supported git solution (github)?

Basic auth support was added back in version 1.8 . All you need is set the environment variable, and Deno will use that against the correct domain when fetching the imports

DENO_AUTH_TOKENS=a1b2c3d4e5f6@deno.land

However at the time of writing this on June 10th 2021 (version 1.11.0 of Deno) it's still not possible to use it with GitLab. The reason actually has nothing to do with authentication; the URL to get the raw source returns application/json as the Content-Type, which Deno doesn't recognize as a valid import. This is an issue that has to be resolved on GitLab's side, there is already an issue opened to track the progress.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM