[英]How can I create a dot file in the workspace from the jenkins job
I have a jenkins job that amongst other things I want to dynamically create a .foo
and a .bar
file in my jenkins workspace home directory as the job is running. 我有一个jenkins作业,除其他外,我想在作业运行时在jenkins工作区主目录中动态创建
.foo
和.bar
文件。
How can I do that with bash as a part of the job? 如何将bash作为工作的一部分来做到这一点?
The job will run after a Docker container has been created with the Docker Plugin. 该作业将在使用Docker插件创建Docker容器后运行。
So the order of precedence I want is : 所以我想要的优先顺序是:
Job starts: 工作开始:
How can I achieve this? 我该如何实现?
One simple solution would be to associate your Jenkins job with a source controlled repository URL, which already include the files with the right content. 一种简单的解决方案是将您的Jenkins作业与源代码控制的存储库URL相关联,该URL已包含具有正确内容的文件。
Each job execution would create a workspace populated with that repo content, and launch your docker container. 每次作业执行都会创建一个工作区,其中填充了该回购内容,然后启动docker容器。
If not, you would need to add a script step, like this one in Groovy . 如果没有,则需要添加一个脚本步骤,例如Groovy中的这一步。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.