如何在特定的gitlab-runner上访问CItesting中的屏幕截图

我想使用特定的亚军(在我的电脑上工作,而不是“共享亚军”)在CItesting中制作我的应用程序的屏幕截图。

它是一个基本的docker运动员。 我试图将builds_dir传递给完整path/home/myuser/mybuilds runnerconfiguration,但成功testing后,该文件夹是空的。 (它似乎是相对于构build,而不是Linux的path)

截图可能会被采取,但path似乎是相对的:

 app.browserWindow.capturePage().then(function (imageBuffer) { fs.writeFile('/home/myuser/mybuilds/page-full-path.png', imageBuffer) }) 

那么如何在Docker中构build后访问构build文件夹?

编辑
我可以使用这样的artifacts

 app.browserWindow.capturePage().then(function (imageBuffer) { console.log("This test path"); console.log(path.join(__dirname)); var mypath = path.join(__dirname, '../..', 'testimgages', "test.png"); fs.writeFile(mypath, imageBuffer) }) 

然后在gitlab-ci.yml中

 mytest script: - mytests artifacts: paths: -testimages 

然后从gitlab.com下载图片,但有没有办法让它更快或本地查看,而不去gitlab.com?

如果它在你的服务器上,那么你可以添加如下内容: -v /some/local/path:/data/screenshots:rw到你的docker run命令中。 它会绑定你的服务器上的本地目录到容器中的/ data / screenshots。 然后你所有的保存将出现在本地目录。

如果你不想添加音量,你可以使用docker cp复制文件:

 docker cp <containerId>:/data/screenshots /local/path 

您可以使用docker psfind您的容器ID。