小编JPH*_*ett的帖子

轮询特定分支 Jenkins 的 SCM

我有一个有很多分支的 Github 项目。

Example

master
staging
feature-1
feature-2
Run Code Online (Sandbox Code Playgroud)

我有一个 Jenkins 作业,它启用了以下 cronjob 的“Poll SCM”选项(10 7,9,11,13,15,17,19 * * 1-5)

但是,当对 master 进行更改时,这项工作也将开始。

我希望 Jenkins 的工作只有在提交到暂存分支时才开始。

这是轮询日志的输出

Started on Nov 20, 2018 1:10:00 PM
no polling baseline in /var/jenkins_workspace/workspace/Staging-ALL-Deploy@libs/jenkins-pipeline-global-lib on 
Using strategy: Default
[poll] Last Built Revision: Revision efccc8e212470802d64537e0a5e710f9b5c063b6 (refs/remotes/origin/staging)
 > git --version # timeout=10
 > git ls-remote -h http://git.company.com/org/repo.git # timeout=10
Found 56 remote heads on http://git.company.com/org/repo.git
[poll] Latest remote head revision on refs/heads/staging is: efccc8e212470802d64537e0a5e710f9b5c063b6 - already built by 171 …
Run Code Online (Sandbox Code Playgroud)

git jenkins

5
推荐指数
1
解决办法
5737
查看次数

在字典中声明函数

def mainProgram(myDict):
    methodDict = {'add': addDB(myDict, params[1], params[2]),
                  'find': findDB(myDict, params[1]),
                  'del': removeDB(myDict, params[1], params[2]),
                  'clear': clearAll(myDict)}
    inpt = None
    while inpt != "End":
        inpt = input("-->")
        params = inpt.split()
        methodDict[params[0]]
Run Code Online (Sandbox Code Playgroud)

这是我的代码,当我尝试执行我得到的代码时,"在赋值之前引用了UnboundLocalError:局部变量'params'"

有可能做我在python中尝试做的事情吗?

python

2
推荐指数
1
解决办法
80
查看次数

标签 统计

git ×1

jenkins ×1

python ×1