問題描述
從另一個大廳到達一個大廳任務的容器 (Reach one concourse task's container from another one)
‑ aggregate:
‑ task: run‑frontend‑server # Serve the frontend
file: devops‑repo/pipeline/tasks/serve‑client‑dist.yml
image: client‑dist‑image
‑ task: test‑frontend # Fire tests at the frontend
pull: run‑frontend‑server
file: devops‑repo/pipeline/tasks/test‑e2e.yml
image: docker‑registry‑protractor
在這裡,我想在一個容器中運行量角器測試,該容器啟動 chrome 和 firefox 進行前端測試,並在另一個容器中運行 SUT,即我要測試的頁面。
在任務文件一切都設置為指向本地主機,但正如您所見,我想連接到為網頁提供服務的外部容器(第一個任務的容器)。這可以在不使用 docker‑compose 的情況下從大廳完成嗎?
參考解法
方法 1:
In concourse, your system under test isn't meant to be run in a task container. Task/build containers are temporary containers spun up with arbitrary networking and file systems, so there's no way to definitively talk between containers.
Further, your task containers could be run on completely different workers, which don't necessarily have the ability to talk to one another.
Instead, you should be talking to some kind of external, permanent integration system, or running your SUT in the same task container as is running the tests.
(by David Karlsson、materialdesigner)