在Github操作/工作流中使用ddev
我用ddev设置了验收测试。它们在本地运行于在Github操作/工作流中使用ddev,github,typo3,github-actions,acceptance-testing,ddev,Github,Typo3,Github Actions,Acceptance Testing,Ddev,我用ddev设置了验收测试。它们在本地运行于ddev composer cookieman:test。我想对Github操作使用相同的设置 有人在Github操作/工作流中使用ddev吗?直到ddev的健康检查失败为止: ... Creating ddev-router ... done Failed to start extension-cookieman-master: ddev-router failed to become ready: logOutput=2019/11/15 02:
ddev composer cookieman:test
。我想对Github操作使用相同的设置
有人在Github操作/工作流中使用ddev吗?直到ddev的健康检查失败为止:
...
Creating ddev-router ... done
Failed to start extension-cookieman-master: ddev-router failed to become ready: logOutput=2019/11/15 02:24:19 [emerg] 1630#1630: no servers are inside upstream in /etc/nginx/conf.d/default.conf:89
nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:89
nginx: configuration file /etc/nginx/nginx.conf test failed
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
ddev-router healthcheck endpoint not responding
, err=container /ddev-router unhealthy: 2019/11/15 02:24:19 [emerg] 1630#1630: no servers are inside upstream in /etc/nginx/conf.d/default.conf:89
nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:89
nginx: configuration file /etc/nginx/nginx.conf test failed
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
ddev-router healthcheck endpoint not responding
##[error]Process completed with exit code 1.
rfay提到ddev路由器和底层docker守护进程之间通过套接字的通信错误。EDIT:
我将我的发现应用到Github行动中,也可以包含在其他项目中:
我得出结论,问题出在docker-gen身上
在模板的第一行(或者jwilder的)中,.Docker.CurrentContainerID是空的,这似乎在某些上下文中发生在某些人身上
建议删除“仅暴露”对我不起作用。我改了一点模板,不依赖容器,就是这样
:)
这仍然有点脏,只是concpet的证明:
- 这是已更改的模板(比较上游{}部分,在那里我删除了检查容器是否与路由器位于同一网络上的检查)
- 在我的工作流程中
#这将失败,也不会执行任何启动后挂钩ddev start | |退出0
docker cp nginx-debug.tmpl ddev路由器:/app/nginx debug.tmpl
docker exec ddev router sh-c“docker gen-仅公开-通知'sleep 1&&nginx-s reload'/app/nginx-debug.tmpl/etc/nginx/conf.d/default.conf”
- 。。。ddev现已恢复正常
ddev start | | docker cp.ddev/patches/ddev router/nginx.tmpl ddev router:/app/nginx.tmpl
-这会触发容器重启,从而触发docker gen运行ddev start
ddev启动之后,我设法将/etc/nginx/conf.d/default.conf
从ddev路由器中取出。而且它是相当空的(张贴在上面)。所有这些都是因为插座出现故障;)由于docker compose正在工作,我想套接字是可以访问的。你知道我该怎么检查吗?看来与插座的通信本身并没有问题。我使用了jwilder/nginx代理,它的行为完全相同。docker gen只是不报告nginx的任何上游{}配置。我添加了很多调试输出,如果有一种方法可以更改模板而不影响其他用途,我们肯定可以完成。这是我不能确定的。.Docker.CurrentContainerID只需要确定ddev路由器(也称为“CurrentContainer”)和其他容器是否在同一网络上。在Github操作的上下文中,此变量为null。我的巫毒不足以使正确的条件保持旧的行为。我在docker gen上发表了一篇文章:订阅了那篇文章。我想这是我写作的基础。
name: Tests
on: [push, pull_request]
jobs:
tests-via-ddev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: export DEBIAN_FRONTEND=noninteractive
# update docker
- run: sudo -E apt-get purge -y docker docker-engine docker.io containerd runc nginx
- run: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- run: sudo -E add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- run: sudo -E apt-get update
- run: sudo -E apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# install linuxbrew
- run: sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
- run: echo "::add-path::/home/linuxbrew/.linuxbrew/bin"
# install ddev + docker-compose
- run: brew tap drud/ddev && brew install ddev docker-compose
# Start ddev
- run: ddev start || exit 0
# Debug
- run: ls -als .ddev/
- run: curl 127.0.0.1 || exit 0
- run: curl 127.0.0.1/healthcheck || exit 0
- run: docker ps || exit 0
# we want Clover coverage
- run: ddev exec enable_xdebug
# Run tests
- run: ddev composer cookieman:test
- run: docker ps || exit 0
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c36601a06fd6 drud/ddev-router:v1.11.0 "/app/docker-entrypo…" 27 seconds ago Up 24 seconds (unhealthy) 0.0.0.0:4430->4430/tcp, 0.0.0.0:4444->4444/tcp, 0.0.0.0:8025->8025/tcp, 80/tcp, 0.0.0.0:8080->8080/tcp ddev-router
18152602a054 drud/ddev-webserver:v1.11.0-built "/start.sh" 30 seconds ago Up 28 seconds (healthy) 8025/tcp, 127.0.0.1:32770->80/tcp, 127.0.0.1:32769->443/tcp ddev-extension-cookieman-master-web
33aca55715f2 selenium/standalone-chrome:3.12 "/opt/bin/entry_poin…" 32 seconds ago Up 30 seconds 4444/tcp ddev-extension-cookieman-master-chrome
6c852ae62974 drud/ddev-dbserver:v1.11.0-10.2-built "/docker-entrypoint.…" 32 seconds ago Up 30 seconds (healthy) 127.0.0.1:32768->3306/tcp ddev-extension-cookieman-master-db
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
# ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
default off;
https on;
}