есть ли другой способ отправить собранный проект в GitHub в конвейере Jenkins, а не с помощью агента SSH? - PullRequest
0 голосов
/ 20 октября 2018

Я использую конвейеры Jenkins для автоматизации проекта.Я успешно могу создать и опубликовать приложение, но когда я пытаюсь вставить встроенный проект в репозиторий GitHub с помощью ssh-agent, я получаю сообщение об ошибке, как показано ниже

[Pipeline] {(push to git) [Pipeline] sshagent [ssh-agent] Использование учетных данных OABLN709 $ [ssh-agent] Поиск реализации ssh-agent ... Не удалось найти ssh-agent: IOException: Невозможно запустить программу "ssh-agent": CreateProcess error = 2, Система не может найти указанный файл Проверьте, установлен ли ssh-agent и находится ли в PATH [ssh-agent] FATAL: Не удалось найти подходящего поставщика ssh-agent [ssh-agent] Диагностический отчет [Pipeline] // sshagent [Pipeline]} [Pipeline] // stage [Pipeline]} [Pipeline] // withEnv [Pipeline]} [Pipeline] // узел [Pipeline] Конец конвейера java.lang.RuntimeException: [ssh-agent] Не удалось найти подходящий sshагентв com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.initRemoteAgent (SSHAgentStepExecution.java:175) в com.cloudbees.jenkins.plugins.sshagent.SSHAgentStepExecution.start (SSHAgentSj.jp.jp.jp).cps.DSL.invokeStep (DSL.java:270) в org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod (DSL.java:180) в org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod (.java: 122) в sun.reflect.GeneratedMethodAccessor2538.invoke (неизвестный источник) в sun.reflect.DelegatingMethodAccessorImpl.invoke (неизвестный источник) в java.lang.reflect.Method.invoke (неизвестный источник) в org.codeyusov.grovereflection.CachedMethod.invoke (CachedMethod.java:93) в groovy.lang.MetaMethod.doMethodInvoke (MetaMethod.java:325) в groovy.lang.MetaClassImpl.invokeMethod (MetaClassImptomp.jmpl.jpg).(MetaClassImpl.java:1022) в org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call (PogoMetaClassSite.java:42) в org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall (CallSiteArray.java:48) в org.codehaus.groovy.runtime.callsite.AbstractCallSite.call (AbstractCallSite.java:113) в org.kohsuke.groovy.sandbox.impallChecker(Checker.java:157) в org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall (GroovyInterceptor.java:23) в org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMetavaInteror (5)org.kohsuke.groovy.sandbox.impl.Checker $ 1.call (Checker.java:155) в org.kohsuke.groovy.sandbox.impl.Checker.checkedCall (Checker.java:159) в org.kohsuke.groovy.sandbox.impl.Checker.checkedCall (Checker.java:129) в com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall (SandboxInvoker.java:17) в WorkflowScript.run (WorkflowScript: 59) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute (баночка: файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/орг / jenkinsci / плагины / пипeline / modeldefinition / ModelInterpreter.groovy: 133) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage (jar: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / plugins / pipeline-model-,Definition / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 660) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContext:файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 402)в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode (jar: file: / C: / Program% 20Files% 20 (x86) / Jenkins / плагины / конвейерная модель-определение / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 400) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executeSingleStage (jar: файл: / C: / Program 20F)20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:659) в org.jenci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (баночка: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / плагин / трубопровод-модель четкость / WEB-INF / Библиотека / трубопровод-модель четкость.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 279) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock (jar: файл: / C: / Program% 20Files% 20 (x)/ Дженкинс / плагин / трубопроводы режимl-definition / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 547) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.toolsBlock (баночка: файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition / ModelInterpreter.groovy: 546) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (jar: file: / C: / Program% 20Files% 20 (x86) / Jenkins / плагины / конвейерная модель-определение / /WEB-INF / lib / pipe-model-definition.jar! /Org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 269) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock: jar:/C:/Program%20Files%20(x86)/Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 446) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withEnvBlock (баночка: Файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci / plugins / pipeline / modeldefinition / ModelInterpreter.groovy: 445) по адресу org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (jar: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / plugins /pipe-model-definition / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 268) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock (баночка: файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/трубопровод / определение модели / ModelInterpreter.groovy: 484) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.withCredentialsBlock (jar: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / plugins / pipeline-model-определение / WEB-INF / Библиотека / трубопровод режимl-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 483) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (jar: файл: / C: / Program %FF)20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:267) в org.jenci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (баночка: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / плагин / трубопровод-модель четкость / WEB-INF / Библиотека / трубопровод-модель четкость.баночка /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 299)в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent (jar: file: / C: / Program% 20Files% 20 (x86) / Jenkins / плагины / определение модели конвейера / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 585) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent (jar: файл: / C: / Program%20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:584) в org.jenkins.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (баночка: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / плагин / трубопровод-модель четкость / WEB-INF / Библиотека / трубопровод-модель четкость.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 296) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput (jar: файл: / C: / Program% 20Files% 20 (x86)/ Jenkins / плагины / трубопровод-модель-definition / WEB-INF / lib / pipeline-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 363) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.stageInput (jar:файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 362) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (jar: file: / C: / Program% 20Files% 20 (x86) / Jenkins / plugins / pipe-model-definition-description / WEB-INF / lib / pipeline-model-definition.jar! /Org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 265) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers (jar: file: / C): / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:612) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inWrappers (баночка: Файл: / C: / Program% 20Files% 20 (x86) /Jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci / plugins / pipeline / modeldefinition / ModelInterpreter.groovy: 611) в org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.evaluateStage (jar: файл: / C: / Program% 20Files% 20 (x86) / Jenkins / plugins /определение модели конвейера / WEB-INF / lib / pipe-model-definition.jar! /org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy: 250) при cps.transform (собственный метод) в com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall (ContinuationGroup.java:57) в com.cloudbees.groovy.cps.impl.FunctionCallBlock $ ContinuationImpl.dispatchOrArg (FunctionCall109.jpg)) в com.cloudbees.groovy.cps.impl.FunctionCallBlock $ ContinuationImpl.fixArg (FunctionCallBlock.java:82) в sun.reflect.GeneratedMethodAccessor1072.invoke (неизвестный источник) в sun.reflect.DelegatingMethodAccessorImplt java.lang.reflect.Method.invoke (Неизвестный источник) в com.cloudbees.groovy.cps.impl.ContinuationPtr $ ContinuationImpl.receive (ContinuationPtr.java:72) в com.cloudbees.groovy.cps.impl.ClosureBlock.eval (ClosureBlock.java:46) на com.cloudbees.groovy.cps.Next.step (Next.java:83) на com.cloudbees.groovy.cps.Continuable $ 1.call (Continuable.java:174) на ком.cloudbees.groovy.cps.Continuable $ 1.call (Continuable.java:163) в org.codehaus.groovy.runtime.GroovyCategorySupport $ ThreadCategoryInfo.use (GroovyCategorySupport.java:129) в org.codehausyateg.Sovy.GovovSuoryGuory(GroovyCategorySupport.java:268) на com.cloudbees.groovy.cps.Continuable.run0 (Continuable.java:163)в org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access $ 101 (SandboxContinuable.java:34) в org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda $ run0 $ 0 (SandboxContinuable.java: at_j59).plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox (GroovySandbox.java:108) в org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0 (SandboxContinuable.java:58) в org.jp..CpsThread.runNextChunk (CpsThread.java:182) в org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run (CpsThreadGroup.java:332) в org.jenkinsci.plugins.workflow.cps.CpsThreadGroup (CpsThreadGroup. Group).Java: 83) в org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call (CpsThreadGroup.java:244) в org.jenkinsci.plugins.workflow.cps.CpsThreadGroup $ 2.call (CpsThreadGroup.java:232) в или.jenkinsci.plugins.workflow.cps.CpsVmExecutorService $ 2.call (CpsVmExecutorService.java:64) в java.util.concurrent.FutureTask.run (неизвестный источник) в hudson.remoting.SingleLaneExecutorСлужба $ 1.run (SingleLaneExecutorService.java:131) в jenkins.util.ContextResettingExecutorService $ 1.run (ContextResettingExecutorService.java:28) в jenkins.security.ImpersonatingExecutorService $ 1.run (ImpersonatingExecutorStil.jer) jj.ИсполнителейНеизвестный источник) на java.lang.Thread.run (Неизвестный источник) Завершено: FAILURE

Сценарий Jenkins для конвейера - это сценарий кода, который я использовал для конвейера jenkins:

stage('gitpush') {
steps{
sshagent (credentials: ['mygithubcredentialsID']) {
        sh("git clone https://github.com/mygithub/repository.git")
    }

    sshagent (credentials: ['mygithubcredentialsID']) {

        sh("(git add ranger-policies/policies.json)")
        sh("(git commit -m 'daily backup of ranger-policies/policies.json')")
        sh('(git push git@github.com:mygithub/repository.git)')
    }

}
}
}

Iперепробовал все возможные способы решения этой проблемы, но все они не сработали на моем компьютере с Windows 10.Поэтому я пытаюсь другим способом поместить встроенный проект в репозиторий GITHUB, не используя плагин агента SSH.Есть ли другой способ сделать эту задачу?Спасибо

...