【发布时间】:2017-06-30 05:09:31
【问题描述】:
我有一个 jenkins 容器,它触发一个 maven 容器来构建一个 java 代码。 现在我想用 selenium 测试相同的代码。 我有另一个硒服务器容器。 但是使用 selenium 运行测试的命令是需要 Maven 的 mvn 命令。 由于我在 selenium 容器内执行此操作,因此无法识别 mvn。 如何在 selenium 容器内使用 maven 容器?可以嵌套吗? 我不想将所有东西都安装在同一个容器中。 这是 Jenkins 文件:
node {
stage('checkout') {
git credentialsId: 'Gitlab_cred', url: 'urlhere'
}
stage('Build') {
docker.image('mvn_custom_image').inside('-u root'){
//mvn commands to build the project
}
}
stage('Archive and Packaging') {
archiveArtifacts '**/*.war'
}
stage('Integration Test') {
docker.image('selenium/node-firefox:3.4.0-dysprosium').inside{
//I want to run mvn command using selenium here
// This image doesn't have mvn
}
}
}
我可以在另一个容器中使用“docker.image('mvn_custom_image').inside”吗(在我的情况下是 selenium)?
或任何其他具有类似结果的方式。
【问题讨论】:
标签: maven selenium docker jenkins-pipeline