简体   繁体   English

Deno - Gitlab 私人回购

[英]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. Aka 每个 repo 可以单独执行,但也依赖于其他模块(也可以单独执行)来执行特定任务。

These are all stored in a private gitlab account/project/repo.这些都存储在私有 gitlab 帐户/项目/存储库中。

After doing some reading, it looks like GitLab don't support PA tokens for reading a private repo like Deno suggests.在做了一些阅读之后,看起来 GitLab 不支持 PA 令牌来读取 Deno 建议的私人回购。

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)?或者这只能手动实现/挂钩到 GL API 以自己自动化/移动到受支持的 git 解决方案(github)?

Basic auth support was added back in version 1.8 . 在 1.8 版本中添加了基本身份验证支持。 All you need is set the environment variable, and Deno will use that against the correct domain when fetching the imports您只需要设置环境变量,Deno 将在获取导入时将其用于正确的域

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.然而,在 2021 年 6 月 10 日(Deno 的 1.11.0 版)撰写本文时,它仍然无法与 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.获取原始源代码的 URL 返回application/json作为 Content-Type,Deno 无法将其识别为有效导入。 This is an issue that has to be resolved on GitLab's side, there is already an issue opened to track the progress.这是一个必须在 GitLab 方面解决的问题,已经打开了一个问题来跟踪进度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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