从GIT存储库中查看特定目录
我想从Jenkins Pipeline中的GIT存储库中查看一个特定的文件夹(例如:10.0-rc-3)。
我在git reto中的结构以下结构: https://gitlab.xxx.org/titan /testing/test-project/
10.0-rc-1
10.0-rc-2
10.0-rc-3
我尝试了以下代码,但这无效,
stage(checkout specific folder){
scm:[
userRemoteConfigs:[
[
credintialsId: 'MySecretId',
url: 'https://gitlab.xxx.org/Titan/Testing/Test-project.git'
name: env.gitlabTargetNamespace
]
]
]
sh "git archive --remote='https://gitlab.xxx.org/Titan/Testing/Test-project/' 'master' '10.0-RC-3'
}
我会遇到错误”。
I want to check out a specific folder (as per below, e.g.: 10.0-RC-3) from a GIT repo in jenkins pipeline.
I have below structure in GIT repo : https://gitlab.xxx.org/Titan/Testing/Test-project/
10.0-RC-1
10.0-RC-2
10.0-RC-3
I tried with below code, but that didn't work
stage(checkout specific folder){
scm:[
userRemoteConfigs:[
[
credintialsId: 'MySecretId',
url: 'https://gitlab.xxx.org/Titan/Testing/Test-project.git'
name: env.gitlabTargetNamespace
]
]
]
sh "git archive --remote='https://gitlab.xxx.org/Titan/Testing/Test-project/' 'master' '10.0-RC-3'
}
i getting error as "fatal:operation not supported by protocol".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要使用SSH URL代替Git Archive与GitLab存储库一起使用。参见此线程作为一个例证。
但是您也可以考虑 api调用
You might need to use an SSH URL instead for git archive to work with GitLab repositories. See this thread as an illustration.
But you could also consider an API call