java.lang.NullPointerException:无法在空对象上调用方法minus()-Jenkins

时间:2020-08-23 02:38:07

标签: amazon-web-services amazon-ec2 jenkins-pipeline jenkins-plugins

嗨,我正在尝试使用jenkins管道在ec2实例中运行python应用。我使用publish over ssh插件来在ec2实例中运行命令,但出现错误。我在问题中发布带有错误图像的代码。任何帮助将不胜感激

pipeline {
  agent any
    
  tools {nodejs "node"}
    
  stages {
        
    stage('Git') {
      steps {
        git 'https://github.com/***/Jenkins-NodeJs'
      }
    }
     
    stage('Build') {
      steps {
        sh 'pwd'
        sh 'npm install'
        sh 'npm install express'
      }
    }      
     stage('Deployment') {
        steps {
            script {
                sshPublisher(publishers: [
                    sshPublisherDesc(
                        configName: "${env.ec2-user}",
                        transfers: [
                            sshTransfer(
                                sourceFiles: "/var/lib/jenkins/workspace/Nodejs-pipelines/app.js",
                                execCommand: "cd nodejs, cp -f app.js "
                            )
                        ],
                        usePromotionTimestamp: false,
                        useWorkspaceInPromotion: false,
                        verbose: false
                    )]
                )
            }
        }
    }       
  }
}

enter image description here

0 个答案:

没有答案