Tag: multibranchpipe道

如何避免在多分支pipe道中进行双重结账

当运行一个工作时,SVN仓库被检出,将Jenkinsfile(存储在我的应用程序的根目录)放到workspace/branch_name@script , workspace/branch_name@script再次检出到workspace/branch_name 。 构build需要35-40分钟(大型应用程序,CakePHP)。 Jenkinsfile: #!groovy pipeline { agent any stages { stage('Build Environment & Test App') { steps { sh 'chmod +x ./scripts/* ./application/app/Console/cake' sh 'make test' junit 'junit.xml' } } } } 做testing: #!/bin/bash -e CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # `JOB_BASE_NAME` set from Jenkins global environment variables export DOCKER_COMPOSE_PREFIX="${JOB_BASE_NAME:-test}" shopt -s […]

如何在Jenkins多分支pipe道中拖拉docker图像并旋转容器?

我正在编写一个Jenkinsfile来创build多分支pipe道和Docker / Dockerpipe道插件的构build,以便在Jenkins中启动Docker容器。 我有一个图像,我想用来build立docker集装箱。 我需要从一个特定的url中提取这个图片: docker.abc.com ,运行容器,然后在容器中完成Jenkins的所有东西。 我目前收到以下错误: Jenkins does not seem to be running inside a container 我的代码看起来像这样: node { try { // set working directory dir(working directory here){ stage(main){ checkout scm docker.image("docker.abc.com/def:latest").inside{ // do Jenkins stuff } } } } catch { // catch error and send notification } }