我正在尝试为存储在私有仓库中的R包构建gitlab CI文件。该包依赖于另一个私有仓库中的R包。为了安装依赖包,我使用以下方法,但会暴露用户名/密码细节,因此并不是最佳方法。
是否有其他替代方案可以从私有的gitlab仓库安装依赖包?
是否有其他替代方案可以从私有的gitlab仓库安装依赖包?
image: rocker/rstudio
stages:
- build
build_job:
stage: build
before_script:
- apt-get update
script:
- Rscript -e "install.packages(c('covr','testthat','devtools'))"
- Rscript -e "devtools::install_git('https://username:password@gitlab.com/project.git')"
- Rscript -e "devtools::test()"
- R CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual
- mkdir build
- mv "${PKG_FILE_NAME}" $CI_PROJECT_DIR/build
artifacts:
paths:
- build/
expire_in: 1 week