Deployment 通过gitlab持续集成自动部署

Deployment 通过gitlab持续集成自动部署,deployment,continuous-integration,gitlab,digital-ocean,Deployment,Continuous Integration,Gitlab,Digital Ocean,我想设置从gitlab分支到digitalocean droplet的自动部署。我在droplet中创建了一个runner和exec git克隆。但现在我无法将gitlab-ci.yml配置为从分支“dev”到droplet的自动部署 My gitlab-ci.yml: image: python:3.5 staging: type: deploy only: - dev script: # there must be some kind of connection to t

我想设置从gitlab分支到digitalocean droplet的自动部署。我在droplet中创建了一个runner和exec git克隆。但现在我无法将gitlab-ci.yml配置为从分支“dev”到droplet的自动部署

My gitlab-ci.yml:

image: python:3.5
staging:
  type: deploy
  only:
  - dev
  script:
  # there must be some kind of connection to the droplet to further code executed already on server
  - git pull
  # - server restart

如何连接到gitlab-ci.yml中的服务器以发出“git pull”命令?

好的,我解决了这个问题。首先,我们需要将GitLab CI runner添加到服务器。您可以在文档中看到如何执行此操作。然后来自gitlab-ci.yml的所有命令都将在服务器上执行。因此,“git pull”命令也将在运行程序启动的服务器上执行。

好的,我解决了这个问题。首先,我们需要将GitLab CI runner添加到服务器。您可以在文档中看到如何执行此操作。然后来自gitlab-ci.yml的所有命令都将在服务器上执行。因此,“git pull”命令也将在运行程序启动的服务器上执行。

您的意思是我必须在本地服务器上安装git ci runner?我的本地服务器也有全局静态ip。你的意思是我必须在本地服务器上安装git ci runner?我的本地服务器也有全局静态ip。我不希望它出现在digital ocean server上,它是我安装的本地windows服务器,@Oliver,你能看看这个问题吗?我不希望它出现在digital ocean server上,它是我安装的本地windows服务器,@Oliver,你能看看这个问题吗?