How to use Go with a private GitLab repo

后端 未结 11 1695
时光说笑
时光说笑 2020-12-04 11:11

GitLab is a free, open-source way to host private .git repositories but it does not seem to work with Go. When you create a project it generates a URL of the fo

11条回答
  •  余生分开走
    2020-12-04 11:58

    Easiest way with Gitlab

    before_script:
      - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf https://gitlab.com/
      - go env -w GOPRIVATE=gitlab.com/${CI_PROJECT_NAMESPACE}
    

    See more details here: https://docs.gitlab.com/ee/user/project/new_ci_build_permissions_model.html#dependent-repositories

提交回复
热议问题