首先,一个有效的命令:
使用在.Renviron文件中设置的GITLAB_PAT变量
cred <- git2r::cred_token( token = 'GITLAB_PAT' );
remotes::install_gitlab('myuser/myproject',
credentials = cred ,upgrade = FALSE )安装成功!但允许访问myuser的所有私有包。
从envvar GITLAB_PAT使用GitLab PAT
Downloading GitLab repo myuser/myproject@master
from URL https://gitlab.com/api/v4/projects/12345678/repository/archive.tar.gz?sha=master
√ checking for file 'C:\Users\myuser\AppData\Local\Temp\RtmpCMKBuc\remotes7e0820dc515b\myproject-master-b31c5baa8f1d2d4967b00b739216cbb9b50d74b1/DESCRIPTION' (2.8s)
- preparing 'myproject': (526ms)
√ checking DESCRIPTION meta-information ...
- checking for LF line-endings in source and make files and shell scripts
- checking for empty or unneeded directories
- building 'myproject_0.1.0.tar.gz'
...
** testing if installed package keeps a record of temporary installation path
* DONE (myproject)其次,我的非工作区尝试使用DEPLOY_TOKEN:
使用在.Renviron文件中设置的DEPLOY_TOKEN,以便仅对包含包的存储库具有读取访问权限
cred <- git2r::cred_token( token = 'MYPROJECT_TOKEN' );
remotes::install_gitlab('myuser/myproject',
credentials = cred ,upgrade = FALSE )使用Gitlab PAT授予访问权限的->消息,这不是我想要的。
从envvar GITLAB_PAT使用GitLab PAT
Skipping install of 'myproject' from a gitlab remote, the SHA1 (b31c5bac) has not changed since last install.
Use `force = TRUE` to force installation总而言之,我可以使用DEPLOY_TOKEN在Gitlab上安装一个私人项目的R包吗?
发布于 2020-04-25 02:25:40
我在组部署令牌https://www.youtube.com/embed/8kxTJvaD9ks?rel=0上找到了有用的完整视频
这给出了int:
git clone https://gitlab+deploy-token-157011:-vz-oxsbL2y_ffdZoedq@gitlab.com/myuser/myproject.git按照这个方向,这是可行的:(从.gitlab-ci.yml中提取)
`- R -e "devtools::install_git(paste0('https://',Sys.getenv('DEPLOY_USERNAME'),":",
Sys.getenv('DEPLOY_TOKEN'),
'@gitlab.com/myuser/myproject.git"'), upgrade = FALSE)"`使用gitlab变量
部署用户名=gitlab+DEPLOY-TOKEN-157011和DEPLOY_TOKEN=-vz-oxsbL2y_ffdZoedq
https://stackoverflow.com/questions/61353552
复制相似问题