Jenkins pipeline 中 checkout 代码

pipeline 中 具有checkout 功能的脚本命令如下

  git branch: "master", url: "https://gitee.com/liuboliu/******.git"

完整的脚本命令如下

pipeline {
    agent any
    stages {
        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 路径下

猜你喜欢

转载自blog.csdn.net/LIUXIAOXIAOBO/article/details/131254223
今日推荐