English 中文(简体)
jenkins处理意外情况
原标题:jenkins handles condition unexpectedly
  • 时间:2024-03-14 02:43:42
  •  标签:
  • jenkins

我在jenkins书上有一些条件指挥,没有给我预期的产出,因此,我打破了这些要求:

echo "PY38_RELEASE: ${env.PY38_RELEASE}"
echo "TAG_NAME: ${env.TAG_NAME}"
echo "TAG_NAME: ${env.TAG_NAME != null}"
echo "condition: ${env.PY38_RELEASE || env.TAG_NAME}"
echo "condition: ${env.PY38_RELEASE || env.TAG_NAME != null}"

然后,我观察产出。

[2024-03-14T02:18:14.115Z] PY38_RELEASE: false
[2024-03-14T02:18:14.125Z] TAG_NAME: null
[2024-03-14T02:18:14.135Z] TAG_NAME: false
[2024-03-14T02:18:14.145Z] condition: true
[2024-03-14T02:18:14.155Z] condition: true

I don t get it when the env.PY38_RELEASE is false and env.TAG_NAME != null is false, however their OR is true. Where did I get it wrong?

问题回答

我认为,正在进行的工作是,<代码>env.PY38_RELEASE的价值是string<>em> > > > code,而不是“boolean Valuefalse

我建议用你的文字撰写:

def real_py38_release = env.PY38_RELEASE && (env.PY38_RELEASE !=  false )

然后在你的条件下使用<代码>real_py38_release。 页: 1





相关问题
Reuse agent without needing to declare it multiple times

I m trying to define a agent in a jenkinsfile once, but use it in multiple stages without needing to fully declare it for each stage. As can be seen, I am using a stage to figure out which docker ...

在Jenkins Templating引擎实施版本

我们正计划利用JTE(Jenkins Templating的发动机)在我们org建造管道。 有许多管道将使用这一模板。 可能的话,模板的任何改动都会中断......

Hudson gitorious plugin?

Has anyone integrated a local copy of gitorious with Hudson? Specifically, linking the sha1 on Hudson web page back to the gitorious web page.

Problem with Hudson-JIRA-Perforce integration

I m looking at using the Hudson JIRA plugin to post a JIRA comment on each build. The SCM I m using is perforce which is already linked to the JIRA tasks using perforce jobs. I can see that the JIRA ...

Two Hudson Masters on the same Windows Server

I want to setup two Hudson Masters on the same Hardware. This will make administering Hudson easier, since both servers are used by two different (and independent) teams. So far I tried to install ...

Using Hudson and build steps with multiple git repositories

I m trying out Hudson to replace our current Buildbot setup. I installed the git plugin. Our current setup is like: ssh://server:/repo/test_framework.git ssh://server:/repo/project_a.git Now, to ...