代码之家  ›  专栏  ›  技术社区  ›  user6348718

使用jenkins管道的Git拉动远程服务器

  •  3
  • user6348718  · 技术社区  · 6 年前

    checkout([$class: 'GitSCM',
         branches: [[name: "*/master" ]],
         doGenerateSubmoduleConfigurations: false,
         extensions: [[$class: 'LocalBranch', localBranch: "**"]],
         submoduleCfg: [],
         userRemoteConfigs: [[credentialsId: env.GIT_CREDS, url: env.GIT_REPO]]
             ])
    

    我正在尝试配置一个jenkins作业(使用jenkins管道)来执行 在远程服务器上使用 斯哈根 我需要用 GIT_信用证 需要类似于:

    sh "ssh ubuntu@$Ip 'git pull'" 
    

    使用 吉特回购

    有人能帮我吗

    1 回复  |  直到 6 年前
        1
  •  0
  •   rohit thomas    6 年前

    git(
        url: 'git@git.com:YourGitRepo.git',
        credentialsId: '5ef933f28-bdb2-0563-bfc7-b460490262735', // found here http://jenkinsURL:8080/credentials/
        branch: 'master'
        )
    


    希望有帮助:)