我想自动部署一个简单的docker-compose.yml文件,其中包含来自gitlab-ci.yml的数据库和api。我有一个ubuntu服务器运行在一个特定的ip上,在这个ip上,我可以用docker-compose up -d手动地运行gitlab项目,但是我如何通过gitlab-ci.yml自动实现这一点,而不需要使用gitlab运行程序呢?
我正试图通过GitLab CI将我的Docker部署到服务器上。我在yml文件中设置了变量,并通过SSH连接到服务器。是否可以在yml文件中自动使用变量,还是必须一个一个地将它们传递给SSH?
另外,我想知道是否有比我的方式更好的部署方法。
deploy:
image: alpine
variables:
#this may be overridden by parent pipeline, or it will be latest
my_nginx: registry.gitlab.com/myprofile/nginx:latest
before_script
我正在尝试使用gitlab和AWS设置CI。我已经在运行ubuntu 16.04的aws实例上正确设置了gitlab-runner。
但是我在部署时遇到了这个错误。
Cloning repository...
Cloning into '/builds/m4kamran/project-test'...
Checking out ea183ff7 as production...
Skipping Git submodules setup
$ pip install docker-compose
/bin/sh: eval: line 72: pip: not found
ER
我无法在远程主机上使用来自gitlab CI/CD管道运行器的SSH成功地进行docker-compose。 docker-compose失败,错误如下: http.client.RemoteDisconnected: Remote end closed connection without response
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))