【发布时间】:2018-10-25 13:54:30
【问题描述】:
您好,我最近说过学习管道,谁能帮我编写用于选择参数化分支签出的管道,如果我签出 master 分支,则部署到某个 S3 位置,否则如果 dev 分支到某个其他位置。我试过了,但在这里失败了,谁能帮帮我。pipeline {
agent any
parameters {
choice(
name: 'BRANCH',
choices: 'Development\nrelease/release_QA\nmaster',
description: 'Selct the branch to deploy to repective Airflow')
}
stages {
stage('checkout code') {
steps {
git(url: 'https://bitbucket.nike.com/scm/something.git', branch: '${params.BRANCH}', credentialsId: '4db2-aec4-7d5e86c4ff4b', changelog: true)
sh 'ls -al'
}
}
}
}
我收到以下错误,
+refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/${params.BRANCH}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/${params.BRANCH}^{commit} # timeout=10
> git rev-parse origin/${params.BRANCH}^{commit} # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE
还请帮助我如何编写 if branch then stages.......
【问题讨论】: