Jenkins pipeline 中 checkout 代码
pipeline 中 具有checkout 功能的脚本命令如下
git branch: "master", url: "https://gitee.com/liuboliu/******.git"
完整的脚本命令如下
pipeline {agent anystages {stage('checkout') {steps {git branch: "master", url: "https://gitee.com/liuboliu/*****.git"}}}
}
执行过之后查看log如下
根据提示,workspace 路径下已经有了项目文件
产看文件路径如下

由此可见
steps {
git branch: “master”, url: “https://gitee.com/liuboliu/*****.git”
} 这句命令会将远端仓库的代码checkout 到jenkins的workspace 路径下
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
