Gitlab-runner shell executor 在 ssl 上突然出错
Gitlab-runner shell executor suddenly error on ssl
昨天我的 shell 执行器使用默认测试 yml 工作正常:
stages:
- test
- build
- deploy
test:
stage: test
script: echo "Running tests"
build:
stage: build
script: echo "Building the app"
deploy_staging:
stage: deploy
script:
- echo "Deploy to staging server"
- export
environment:
name: staging
url: https://staging.example.com
only:
- master
但现在我收到以下错误:
Running with gitlab-runner 10.3.0 (5cf5e19a)
on gitlab01ShellSQLRunner (9ec36953)
Using Shell executor...
Running on debian...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/9ec36953/0/dev/SQL'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@10.45.18.14/dev/SQL.git/': SSL: certificate subject name (Gitlab01) does not match target host name '10.45.18.14'
ERROR: Job failed: exit status 1
这是我无法理解的原因,因为三件事:
1.runnersurl是https://gitlab01(为什么突然要用ip了?)
2.ip匹配urlhttps://gitlab01.YXNET.local~别名https://gitlab01
3. 昨天有效:
Running with gitlab-runner 10.3.0 (5cf5e19a)
on gitlabShellRunner (d36a5267)
Using Shell executor...
Running on debian...
Fetching changes...
HEAD is now at 6e9a125 added CI/CD file
From https://gitlab01/dev/SQL
6e9a125..84de9fd master -> origin/master
Checking out 84de9fd7 as master...
Skipping Git submodules setup
$ echo "Running tests"
Running tests
Job succeeded
在这种情况下发生的事情是我重新启动了 debian 机器,它重置了主机名...所以没有主机名让 gitlab 默认使用 IP...
正在检查 ip,因为 SSL 证书导致找不到它...
想知道为什么每次我重新启动 linux 机器时它总是丢失我的主机名,但事实就是如此...
我在 gitlab runner 上的连接有同样的错误...
因此我添加到 .gitlab-ci.yml
:
variables:
GIT_SSL_NO_VERIFY: "true"
并且 gitlab runner 能够连接并克隆 repo。
昨天我的 shell 执行器使用默认测试 yml 工作正常:
stages:
- test
- build
- deploy
test:
stage: test
script: echo "Running tests"
build:
stage: build
script: echo "Building the app"
deploy_staging:
stage: deploy
script:
- echo "Deploy to staging server"
- export
environment:
name: staging
url: https://staging.example.com
only:
- master
但现在我收到以下错误:
Running with gitlab-runner 10.3.0 (5cf5e19a)
on gitlab01ShellSQLRunner (9ec36953)
Using Shell executor...
Running on debian...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/9ec36953/0/dev/SQL'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@10.45.18.14/dev/SQL.git/': SSL: certificate subject name (Gitlab01) does not match target host name '10.45.18.14'
ERROR: Job failed: exit status 1
这是我无法理解的原因,因为三件事:
1.runnersurl是https://gitlab01(为什么突然要用ip了?)
2.ip匹配urlhttps://gitlab01.YXNET.local~别名https://gitlab01
3. 昨天有效:
Running with gitlab-runner 10.3.0 (5cf5e19a)
on gitlabShellRunner (d36a5267)
Using Shell executor...
Running on debian...
Fetching changes...
HEAD is now at 6e9a125 added CI/CD file
From https://gitlab01/dev/SQL
6e9a125..84de9fd master -> origin/master
Checking out 84de9fd7 as master...
Skipping Git submodules setup
$ echo "Running tests"
Running tests
Job succeeded
在这种情况下发生的事情是我重新启动了 debian 机器,它重置了主机名...所以没有主机名让 gitlab 默认使用 IP...
正在检查 ip,因为 SSL 证书导致找不到它...
想知道为什么每次我重新启动 linux 机器时它总是丢失我的主机名,但事实就是如此...
我在 gitlab runner 上的连接有同样的错误...
因此我添加到 .gitlab-ci.yml
:
variables:
GIT_SSL_NO_VERIFY: "true"
并且 gitlab runner 能够连接并克隆 repo。