简体   繁体   English

如何从自动化套件中运行Dockerfile或docker-compose文件

[英]How to run Dockerfile or docker-compose file from automation suite

I am creating an automation framework using selenium and my entry point in execution is creating containers of different db types, load them with database dumps and then start with tests. 我正在使用selenium创建一个自动化框架,执行的切入点是创建不同db类型的容器,将它们与数据库转储一起加载,然后从测试开始。

I have one simple and might be a foolish question If I create a docker-compose file which creates the above mentioned container and generally we do docker-compose up command to run the docker compose file. 我有一个简单的问题,可能是一个愚蠢的问题:如果我创建一个创建上述容器的docker-compose文件,并且通常我们执行docker-compose up命令来运行docker compose文件。

But can I control the docker-compose/Dockerfile when the execution is going on, like 但是执行时我可以控制docker-compose/Dockerfile

Test starts from TestNG -> Before scripts execute to run the docker-compose file and create containers. 测试从TestNG -> Before执行脚本,以运行docker-compose文件并创建容器。

how can I control that? 我该如何控制?

Thanks in advance 提前致谢

I can think of the following options: 我可以想到以下选项:

1- use ansible to deploy for you, you can write a play book with the steps advantages: scaling, will manage everything for you, you can add notifications, but requires managing ansible itself and learning it. 1-使用ansible为您部署,您可以编写具有以下优点的剧本:扩展,将为您管理一切,可以添加通知,但需要管理ansible本身并对其进行学习。

2- use a shell script that will start things in order start the containers (or however you want the order to be) then start the TestNG, cheap and dirty solution. 2-使用将执行启动操作的shell脚本来启动容器(或者您要执行的命令),然后启动TestNG廉价而肮脏的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM