Jenkins:如何在唯一目录中运行构建 [英] Jenkins: how to run builds in unique directories
问题描述
我是第一次配置Jenkins,到目前为止一直是它的用户.
I am configuring Jenkins for the first time, have been a user of it until now.
我阅读了文档,了解了从属中的"$ WORKSPACE"是什么意思.
I read the documentation and understand what "$WORKSPACE" means on the slave.
我有一个误解,默认情况下,默认上的作业在工作区目录中每个作业的唯一目录中运行.似乎并非如此.
I had a misconception that by default the jobs on Jenkins Slave run in a unique directory per job inside the workspace directory. This doesnt seem to be the case.
如何为每个作业运行分配唯一目录? 作业完成后,詹金斯会自动清理该作业运行目录吗?
How do I assign a unique directory per job run? Will Jenkins automatically cleanup this job run directory after its done?
推荐答案
默认情况下,jenkins从$WORKSPACE/JOB Name
运行;这里在节点配置中定义了WORKSPACE.可以通过在作业配置下选择Advance Project options
-> Use custom workspace
来更改此设置.
By default jenkins runs from $WORKSPACE/JOB Name
; here WORKSPACE is defined in the node configuration. This could be changed by choosing Advance Project options
-> Use custom workspace
under your job configuration.
关于清理:如果要清理每个新作业,请在作业配置下选择Build Environment
-> Delete workspace before build starts
.
Regarding cleanup: Choose Build Environment
-> Delete workspace before build starts
under jobs configuration if you like to cleanup for each new job.
这篇关于Jenkins:如何在唯一目录中运行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!