Jenkins 有没有办法将文件从 git repo 保存到本地文件夹?

Jenkins 有没有办法将文件从 git repo 保存到本地文件夹?

我有一个包含 php 文件的 git 存储库,Jenkins 在 Ubuntu 18.04 中运行,并在其上运行 Apache Web 服务器。我只想让 Jenkins 定期从我的存储库中获取 php 文件并将它们保存到 home/var/www/html。我已经设置好了一切,存储库也已连接并经过身份验证 - 我只是不知道如何让 Jenkins 将文件从我的存储库保存到指定的本地文件夹。

答案1

git archive --remote=ssh://[email protected]/myrepo.git master | tar -x

另请参见堆栈溢出上的相同问题:https://stackoverflow.com/questions/13750182/git-how-to-archive-from-remote-repository-directly

相关内容