2017-08-26 23 views

答えて

1

最高です。

stage('Stage Checkout') { 
     checkout([ 
      $class       : 'GitSCM', 
      branches       : scm.branches, 
      doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, 
      extensions      : [] + [ 
       $class  : 'LocalBranch' 
      ], 
      userRemoteConfigs    : scm.userRemoteConfigs, 
     ]) 
    } 

    //do git stuff 

    stage('Push Version Back to Git') { 
     withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'jenkins', usernameVariable: 'GIT_AUTHOR_NAME', passwordVariable: 'GIT_PASSWORD']]) { 
      sh 'echo ${GIT_AUTHOR_NAME} pushing ' 
      sh 'git config --global user.email "[email protected]"' 
      sh 'git config --global user.name "Jenkins"' 
      sh 'git config --global push.default simple' 
      sh('git push https://${GIT_AUTHOR_NAME}:${GIT_PASSWORD}@github.com/a/a.git') 
     } 
    } 
関連する問題