Jenkins Pipeline Across Multiple Docker Images

狂风中的少年 提交于 2019-12-05 17:19:10

I had to resort to a scripted pipeline and combine all the stages

def pythons = ["2.7.14", "3.5.4", "3.6.2"]

def steps = pythons.collectEntries {
    ["python $it": job(it)]
}

parallel steps

def job(version) {
    return {
        docker.image("python:${version}").inside {
            checkout scm
            sh 'pip install pipenv'
            sh 'pipenv install --dev'
            sh 'pipenv run pytest --junitxml=TestResults.xml'
            junit 'TestResults.xml'
        }
    }
}

The resulting pipeline looks like

Ideally we'd be able to break up each job into stages (Setup, Build, Test), but the UI currently doesn't support this (still not supported).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!