git - 两个克隆的 git 存储库与一个 Jenkins 作业一起使用
问题描述
我的詹金斯工作必须从一个 repo 中获取一个 python 脚本,并通过 bash 脚本使用它来对抗另一个 repo,最好的方法是什么?
解决方案
不知道最好的方法,但这对我有用:
配置 Jenkins 管道以从主存储库中提取 Jenkinsfile 和源。
在 Jenkinsfile 中,根据需要拉取额外的 repos:
dir('{{ repo2 }}') {
git url: 'ssh://git@{{ githost }}/{{ project }}/{{ repo2 }}.git',
credentialsId: {{ credId }}
sh 'source venv/bin/activate && pip install .'
}
(当然,根据需要替换上面的 {{ tokens }}。)
理想情况下,我宁愿设置先决条件作业来构建每个辅助存储库并将其上传到 PyPI 存储库,并让这些要求在主存储库中“正常”得到满足。(练习留给读者。)
推荐阅读
- sql - 分组中的最大行数
- node.js - Babel 构建脚本没有将文件复制到文件夹
- c# - 在 C# 单元测试中,如何等效于 Java 的 Spy(而不是 Mock)来仅模拟类上的某些方法?
- ruby-on-rails - 如何使 ActionController::UnknownHttpMethod 错误静音?
- c# - 在 Asp.Net 的 DataList 中渲染大结果时出现错误
- r - 我不能在 R 中查看“ts”对象吗
- material-table - 自定义操作后使用远程数据时更新数据?
- c - rsize_t 定义在哪个标头中?
- python - 如何通过 tkinter 中的按钮传递参数
- node.js - 使用 Gmail API Node.js 客户端发送大型附件 (> 5 MB)