我在固定的内部IP上有一个GitLab实例,并且如果主机名指向该IP,则在客户端上配置hosts文件。
但是在使用主机名时我们无法使Drone工作。我们在端口80上安装了Gitlab,在端口8000上安装了Drone。它在配置为固定IP时有效:
我们的撰写文件:
version: '2'
services:
gitlab:
image: 'gitlab/gitlab-ce:latest'
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://our.host.name.com'
gitlab_rails['gitlab_shell_ssh_port'] = 22
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
drone-server:
image: drone/drone:0.7.3
links:
- "gitlab:our.host.name.com"
ports:
- "8000:8000"
volumes:
- /home/drone:/var/lib/drone/
- /home/drone/cache:/var/lib/drone/cache/
- /home/foresight/keys:/var/lib/drone/keys
environment:
DRONE_OPEN: "true"
DRONE_SERVER_ADDR: ":8000"
DRONE_HOST: "http://our.host.name.com:8000"
DRONE_ADMIN: <redacted>
DRONE_GITLAB: "true"
DRONE_GITLAB_URL: "http://our.host.name.com"
DRONE_GITLAB_CLIENT: <redacted>
DRONE_GITLAB_SECRET: <redacted>
DRONE_SECRET: <redacted>
drone-agent:
image: drone/drone:0.7.3
command: agent
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
DRONE_SERVER: ws://drone-server:8000/ws/broker
DRONE_DEBUG: "true"
DRONE_SECRET: <redacted>
当我以这种方式配置时,无人机似乎不接受来自GitLab的触发器。
当然,我重置了无人机缓存,更新了回调网址以使用域名,并重新激活了存储库。
我找不到任何无人机的日志文件,可以深入了解触发器失败的原因。