【发布时间】:2018-12-10 22:26:35
【问题描述】:
我有这个用于 git checkout 阶段,它工作正常
checkout([$class: 'GitSCM',
branches: [[name: "*/master" ]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'LocalBranch', localBranch: "**"]],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: env.GIT_CREDS, url: env.GIT_REPO]]
])
我正在尝试配置 jenkins 作业(使用 jenkins 管道)以使用 sshagent 在远程服务器上执行 git pull 我需要使用管道中定义的 GIT_CREDS 用于远程服务器上的 git pull 需要类似的东西:
sh "ssh ubuntu@$Ip 'git pull'"
使用 GIT_CREDS 和 GIT_REPO 环境变量
有人可以帮我解决这个问题
【问题讨论】:
标签: git jenkins jenkins-pipeline ssh-agent