gpt4 book ai didi

jenkins - 运行Jenkins管道时如何修复 'script returned exit code 1'

转载 作者:行者123 更新时间:2023-12-04 13:15:32 42 4
gpt4 key购买 nike

我正在使用 Jenkins Blue Ocean 定义一个管道。

我正在尝试做一个简单的 python pep8 编码约定,但是如果我进入 shell 并直接键入命令,它运行良好。

但是同样的命令在管道中执行的时候,执行了,但是最后
显示“脚本返回退出代码 1”。
由于这个错误代码,它不会进入下一步。

有解决方法吗?

using credential github
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/YunTaeIl/jenkins_retest.git # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
Fetching without tags
Fetching upstream changes from https://github.com/YunTaeIl/jenkins_retest.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials GitHub Access Token
> git fetch --no-tags --progress -- https://github.com/YunTaeIl/jenkins_retest.git +refs/heads/master:refs/remotes/origin/master # timeout=10
Checking out Revision fe49ddf379732305a7a50f014ab4b25f9382c913 (master)
> git config core.sparsecheckout # timeout=10
> git checkout -f fe49ddf379732305a7a50f014ab4b25f9382c913 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master fe49ddf379732305a7a50f014ab4b25f9382c913 # timeout=10
Commit message: "Added Jenkinsfile"
> git rev-list --no-walk bc12a035337857b29a4399f05d1d4442a2f0d04f # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
+ ls
Jenkinsfile
README.md
jenkins-retest
+ python3.7 --version
Python 3.7.3
+ python3.7 -m flake8 jenkins-retest
jenkins-retest/N801_py3.py:3:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:6:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:9:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:12:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:15:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:18:1: E302 expected 2 blank lines, found 0
jenkins-retest/N801_py3.py:24:1: E303 too many blank lines (4)
jenkins-retest/N801_py3.py:24:11: E999 SyntaxError: invalid syntax
jenkins-retest/python_testfile.py:1:1: E999 SyntaxError: invalid syntax
jenkins-retest/python_testfile.py:1:2: E228 missing whitespace around modulo operator
jenkins-retest/python_testfile.py:3:1: E402 module level import not at top of file
jenkins-retest/python_testfile.py:3:20: W291 trailing whitespace
jenkins-retest/python_testfile.py:5:1: E302 expected 2 blank lines, found 1
jenkins-retest/python_testfile.py:8:1: E305 expected 2 blank lines after class or function definition, found 0
jenkins-retest/python_testfile.py:11:33: W291 trailing whitespace
jenkins-retest/python_testfile.py:12:1: E402 module level import not at top of file
jenkins-retest/python_testfile.py:12:19: W291 trailing whitespace
jenkins-retest/python_testfile.py:14:4: E714 test for object identity should be 'is not'
jenkins-retest/python_testfile.py:17:16: W291 trailing whitespace
jenkins-retest/python_testfile.py:18:80: E501 line too long (95 > 79 characters)
script returned exit code 1

最佳答案

我很惊讶,比我想象的更多的人正在寻找这个问题。
使用 set +e如果您打算忽略作为 shell 脚本运行的代码的错误代码 exit 1。

关于jenkins - 运行Jenkins管道时如何修复 'script returned exit code 1',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60943751/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com