Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用jenkins脚本化管道构建jar并推送到另一个github存储库?_Jenkins_Github_Jenkins Pipeline_Continuous Deployment - Fatal编程技术网

如何使用jenkins脚本化管道构建jar并推送到另一个github存储库?

如何使用jenkins脚本化管道构建jar并推送到另一个github存储库?,jenkins,github,jenkins-pipeline,continuous-deployment,Jenkins,Github,Jenkins Pipeline,Continuous Deployment,假设我有两个Github repository app.git,另一个是app_release.git。我想从app.git中提取代码,构建它并生成一个jar,然后将jar推送到app_release.git 我已经创建了一个脚本化的Jenkins管道,用于从GitHub的存储库中提取代码,构建它并从中创建一个jar。但无法将jar推送到其他存储库。那么,我有什么办法可以做到吗 节点('docker\u slave'){ sh(“git-config--global user.email'***

假设我有两个Github repository app.git,另一个是app_release.git。我想从app.git中提取代码,构建它并生成一个jar,然后将jar推送到app_release.git

我已经创建了一个脚本化的Jenkins管道,用于从GitHub的存储库中提取代码,构建它并从中创建一个jar。但无法将jar推送到其他存储库。那么,我有什么办法可以做到吗

节点('docker\u slave'){
sh(“git-config--global user.email'*****'”)
sh(“git-config--global user.name'*****'))
阶段(‘构建’){
签出([$class:'GitSCM',
分支:[[名称:'*/master']],
DoGenerateSubModuleConfiguration:false,
扩展:[],
子模块cfg:[],
userRemoteConfigs:[[
credentialsId:“github”,
网址:'https://github.com/******/app.git']
]])
sh(“mvn清洁包装”)
sh(“git add./target/*.jar”)
sh(“git提交-m‘测试api’”)
}
阶段('push_git'){
凭证件([
[$class:'UsernamePasswordMultiBinding',
credentialsId:“githubtest”,
usernameVariable:'GIT_USERNAME',
passwordVariable:'GIT_PASSWORD']]{
sh(“git推送https://'**':'**'@github.com/**/app_release.git”)
}
}    
}

生成的jar文件的大小是多少?jar大小大约为35-40mb@slashpaiI我认为这个大小对于github来说太大了。通常github的最大大小约为25MB