checkoutToSub目录不影响下游阶段 [英] checkoutToSubdirectory not affecting downstream stages

查看:245
本文介绍了checkoutToSub目录不影响下游阶段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Jenkins管道文档和构建控制台中找到了checkoutToSub目录看到输出显示Running in /home/ec2-user/workspace/projectDir/subDir,但是当第一个

I found checkoutToSubdirectory in the Jenkins pipeline docs and in the build console I am seeing output saying Running in /home/ec2-user/workspace/projectDir/subDir but then when the first

stage('install/fetch dependencies') {
  steps {

阻止它在常规工作空间projectDir中运行,而不是在subDir中运行.我还需要添加什么来确保我的stagessubDir中运行?

block it gets run in the normal workspace projectDir, not subDir. What else do I need to add to ensure my stages are run in the subDir?

推荐答案

checkoutToSub目录不会更改构建的工作空间.您可以通过在阶段开始时设置WORKSPACE环境来更改工作空间.在下面几行中更改工作区

The checkoutToSubdirectory don't change the workspace for the build. You can change your workspace by setting WORKSPACE environment at the starting of stages. Use below lines to change workspace

pipeline{
    agent { label 'master' }
    environment { 
    WORKSPACE="${WORKSPACE}/subdir" 
    }
    stages{}
}

这篇关于checkoutToSub目录不影响下游阶段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆