我遇到了一种奇怪的行为,我今天用Jenkins Pipeline进行了第一次尝试,并尝试使用作业内部实际管道区域中提供的样本来运行一个简单的管道。
node {
def mvnHome
stage('Preparation') { // for display purposes
// Get some code from a GitHub repository
git 'https://github.com/jglick/simple-maven-project-with-tests.git
我正在尝试从Jenkins节点将ssh远程放到远程linux机器中。我在Jenkins节点中创建了公钥和私钥,并将公钥复制到远程计算机中的authorized_keys。但我不能远程进入远程机器。请检查下面的日志。
/home/us-jenkins/jenkins/workspace/engineering/dex/college-dex@tmp/durable-9222db0d/script.sh: line 8: warning: here-document at line 2 delimited by end-of-file (wanted `EOF')
+ ssh -vvv *
github密钥存储在Jenkins中。现在我有一个Jenkins作业,它使用withCredentials插件来获取私钥,如下所示:
withCredentials([sshUserPrivateKey(credentialsId: "my-cred-id", keyFileVariable: 'key')]) {
//auth to git here then do some commands for example:
sh 'git commmit -am "hello my commit message'
我的管道一直工作到今天都很好。Jenkins动态地启动了一个从属容器(docker cloud),我所有的步骤都是从这个容器运行的。错误如下,我只是想知道为什么jenkins会在工作空间目录中创建一个临时目录。
[Pipeline] sh
[xxx_root_proj] Running shell script
+ cd ./xxx_root_proj
/home/jenkins/workspace/xxx_root_proj@tmp/durable-b532c37c/script.sh: 3: cd: can't cd to ./xxx_root_proj
[Pipeline] }