更新时间:2023-09-30 08:03:10
您可以在junit
之前创建一个临时容器,以提取测试结果文件以将测试结果复制到您的工厂.最后将其删除
You could create an temporary container just before junit
to extract test results files to copy test result to your workspsace. And finally remove it
sh 'docker create --name temporary-container spring-image'
sh 'docker cp temporary-container:/var/www/java/target/surefire-reports .'
sh 'docker rm temporary-container'
junit 'surefire-reports'
您还可以查看 docker-pipeline 文档,该文档为您提供一些抽象来构建docker镜像
You could also take a look do docker-pipeline documentations which provides you some abstraction to build docker images