Я пытаюсь написать свой первый конвейерный скрипт, моя идея заключается в следующем.
У меня есть основная ветвь, две мои команды создадут две ветви для выполнения своих проектов из основной. После их фиксации в двух отдельных ветках будет запущена работа по слиянию этих двух ветвей с основной после запуска сборки.
Это мой конвейерный скрипт, который я запустил, я еще не закончил:
pipeline {
agent any
stages {
stage ('Initialize') {
steps {
checkout changelog: true,
poll: true,
scm: [
$class: 'GitSCM',
branches: [[name: 'origin/master'], [name: 'origin/branch1'], [name: 'origin/branch2']],
doGenerateSubmoduleConfigurations: false,
extensions: [
[
$class: 'PreBuildMerge',
options: [fastForwardMode: 'NO_FF',
mergeRemote: 'https://github.com/-----/jenkins.git',
mergeStrategy: 'org.jenkinsci.plugins.gitclient.MergeCommand.Strategy',
mergeTarget: 'master']
]
],
submoduleCfg: [],
userRemoteConfigs: [
[
credentialsId: '----------------',
name: 'origin',
url: 'https://github.com/------/jenkins.git'
]
]
]
}
}
stage ('Build') {
steps {
bat(/mvn clean package/)
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}
}
}
Это вывод:
Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in C:\Program Files (x86)\Jenkins\workspace\shared-pipeline
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Initialize)
[Pipeline] checkout
git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git.exe config remote.origin.url https://github.com/------/jenkins.git # timeout=10
Fetching upstream changes from https://github.com/------/jenkins.git
git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
git.exe fetch --tags --progress https://github.com/------/jenkins.git +refs/heads/*:refs/remotes/origin/*
Seen branch in repository origin/branch1
Seen branch in repository origin/branch2
Seen branch in repository origin/master
Seen 3 remote branches
git.exe show-ref --tags -d # timeout=10
Merging Revision d466248662265f20ba50d752a6ca455314c (origin/branch1) to https://github.com/-----/jenkins.git/master, UserMergeOptions{mergeRemote='https://github.com/------/jenkins.git', mergeTarget='master', mergeStrategy='org.jenkinsci.plugins.gitclient.MergeCommand.Strategy', fastForwardMode='--no-ff'}
git.exe rev-parse "https://github.com/-------/jenkins.git/master^{commit}" # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
Stage 'Build' skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
hudson.plugins.git.GitException: Command "git.exe rev-parse "https://github.com/--------/jenkins.git/master^{commit}"" returned status code 128:
stdout: https://github.com/--------/jenkins.git/master^{commit}
stderr: fatal: Invalid object name 'https'.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:794)
at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:66)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1068)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1161)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:290)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Finished: FAILURE
Заранее благодарю за ответ.