-
Improvement
-
Resolution: Duplicate
-
Major
-
None
Given the following code
lock('checkout') { stage('checkout') { checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout'], [$class: 'ScmName', name: 'super']], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${superRepo}"]]]) def repos = readFile('.gitslave') def reposLines = repos.readLines() for (line in reposLines) { def repoInfo = line.split(' ') def repoUrl = repoInfo[0] def repoPath = repoInfo[1] def curatedRepoUrl = repoUrl.substring(4, repoUrl.length()-1) def curatedRepoPath = repoPath.substring(1, repoPath.length()-1) checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: curatedRepoPath], [$class: 'CleanCheckout'], [$class: 'ScmName', name: curatedRepoPath]], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${curatedRepoUrl}"]]]) } } }
We use $class: 'ScmName', name: curatedRepoPath].
That is reflected in the SCM list, but not in Pipeline Step. See attached screenshots.
Would be great if that value was used in the SCM pipeline step.
- duplicates
-
JENKINS-37324 We would like a more meaningful description of a step
-
- Closed
-
[JENKINS-39709] Use SCM extension [$class: 'ScmName'] in Pipeline step
Description |
Original:
The `sh` step adds a "Shell Script" step in the Pipeline. However, there could be multiple such steps including steps from various plugins (e.g., Docker), which makes it hard to distinguish the steps. We should perhaps add an optional parameter to sh to specify a name or alias which would then appear in the pipeline steps. e.g., the following can be the step for npm which would show as "Shell script: npm" in the pipeline view. {code:java} sh cmd:"npm install", name: "npm" {code} |
New:
Given the following code {code:groovy} lock('checkout') { stage('checkout') { checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout'], [$class: 'ScmName', name: 'super']], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${superRepo}"]]]) def repos = readFile('.gitslave') def reposLines = repos.readLines() for (line in reposLines) { def repoInfo = line.split(' ') def repoUrl = repoInfo[0] def repoPath = repoInfo[1] def curatedRepoUrl = repoUrl.substring(4, repoUrl.length()-1) def curatedRepoPath = repoPath.substring(1, repoPath.length()-1) checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: curatedRepoPath], [$class: 'CleanCheckout'], [$class: 'ScmName', name: curatedRepoPath]], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${curatedRepoUrl}"]]]) } } } {code} We use $class: 'ScmName', name: curatedRepoPath] |
Description |
Original:
Given the following code {code:groovy} lock('checkout') { stage('checkout') { checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout'], [$class: 'ScmName', name: 'super']], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${superRepo}"]]]) def repos = readFile('.gitslave') def reposLines = repos.readLines() for (line in reposLines) { def repoInfo = line.split(' ') def repoUrl = repoInfo[0] def repoPath = repoInfo[1] def curatedRepoUrl = repoUrl.substring(4, repoUrl.length()-1) def curatedRepoPath = repoPath.substring(1, repoPath.length()-1) checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: curatedRepoPath], [$class: 'CleanCheckout'], [$class: 'ScmName', name: curatedRepoPath]], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${curatedRepoUrl}"]]]) } } } {code} We use $class: 'ScmName', name: curatedRepoPath] |
New:
Given the following code {code:groovy} lock('checkout') { stage('checkout') { checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanCheckout'], [$class: 'ScmName', name: 'super']], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${superRepo}"]]]) def repos = readFile('.gitslave') def reposLines = repos.readLines() for (line in reposLines) { def repoInfo = line.split(' ') def repoUrl = repoInfo[0] def repoPath = repoInfo[1] def curatedRepoUrl = repoUrl.substring(4, repoUrl.length()-1) def curatedRepoPath = repoPath.substring(1, repoPath.length()-1) checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: curatedRepoPath], [$class: 'CleanCheckout'], [$class: 'ScmName', name: curatedRepoPath]], submoduleCfg: [], userRemoteConfigs: [[url: "${gitBaseUrl}/${curatedRepoUrl}"]]]) } } } {code} We use {{$class: 'ScmName', name: curatedRepoPath]}}. That is reflected in the SCM list, but not in Pipeline Step. See attached screenshots. Would be great if that value was used in the SCM pipeline step. |
Attachment | New: scm.png [ 34823 ] |
Attachment | Original: scm.png [ 34823 ] |
Attachment | New: scm.png [ 34824 ] |
Attachment | New: scm2.png [ 34825 ] |
Component/s | New: blueocean-plugin [ 21481 ] |
Link |
New:
This issue duplicates |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |