繁体   English   中英

GitLab项目部署中的权限被拒绝

[英]Permission Denied in GitLab project deploy

我正在尝试在AWS服务器上设置GitLab。

我正在尝试做的-

  1. 将分支从本地系统推送到GitLab服务器。
  2. 合并GitLab服务器上的分支,并使用SSH部署到登台服务器。
  3. 如果一切正常,则使用SSH部署到生产服务器。
  4. 还原登台服务器或生产服务器上的更改。

我到目前为止所做的

  • 在服务器上设置GitLab。

  • 可以从本地服务器推送分支,并且可以在GitLab上合并。

问题:

我在部署分支机构时面临的问题是-

无法在登台服务器上部署分支。

在此处输入图片说明

    stages:
      - staging

    deploy_staging:
      stage: staging
      before_script:
        - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
        - chmod 644 ~/.ssh/known_hosts
      script:
        - ssh user@ip "cd /home/public_html/gitlab-test &&
            git checkout master &&
            git pull origin master "
      environment: staging
      only:
        - master

我跟着

https://docs.gitlab.com/ee/ci/ssh_keys/README.html

https://www.sebastianklier.com/gitlab/2017/10/01/automatic-deployments-to-remote-with-gitlab-ci.html

https://florianbrinkmann.com/cn/3473/deployment-gitlab-ci/

https://hackernoon.com/setting-up-ci-cd-on-gitlab-step-by-step-guide-part-1-826385728223

但是看起来我缺少什么。 任何视频教程或详细说明将不胜感激。

我不是在使用Docker。

暂无
暂无

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

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