AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 840084
Accepted
Ashish Karpe
Ashish Karpe
Asked: 2017-03-24 00:30:26 +0800 CST2017-03-24 00:30:26 +0800 CST 2017-03-24 00:30:26 +0800 CST

詹金斯构建错误:没有这样的文件或目录

  • 772

我的问题:当我使用 jenkins 构建时,我收到没有这样的文件的错误。但是那个文件是存在的。

jenkins@ip-172-31-22-20:~/jobs$ ls -lthr /var/lib/jenkins/jobs/github-commit-status-api/builds/43/build.xml
-rw-r--r-- 1 jenkins jenkins 2.5K Mar 23 08:13 /var/lib/jenkins/jobs/github-commit-status-api/builds/43/build.xml
jenkins@ip-172-31-22-20:~/jobs$

我的错误:

 cat: /var/lib/jenkins/jobs/github-commit-status-api/builds/43/build.xml: No such file or directory

我来自 Jenkins 仪表板的构建后操作:

postsuccess()
{
  cat <<EOF
{  
    "state": "success",
    "target_url": "https://github.com/HSarode-Compumatrice/money-1",
    "description": "The build succeeded!",
    "context": "continuous-integration/jenkins"
}
EOF
}
postfailure()
{
  cat <<EOF
{  
    "state": "failure",
    "target_url": "https://github.com/HSarode-Compumatrice/money-1",
    "description": "Build Failure!",
    "context": "continuous-integration/jenkins"
}
EOF
}







echo "$BUILD_NUMBER"
BUILD_STATUS=`sudo cat /var/lib/jenkins/jobs/github-commit-status-api/builds/$BUILD_NUMBER/build.xml | grep -oP '(?<=<result>).*?(?=</result>)'`
echo $BUILD_STATUS 

if [ "$BUILD_STATUS" = "SUCCESS" ]
then
`curl -X POST -H "Authorization: Basic f69a042ad72594792950fecc8ca4539d2fff7b75" -H "Content-Type: application/json" 
-d  "$(postsuccess)" "https://api.github.com/repos/HSarode-Compumatrice/money-1/statuses/$GIT_COMMIT"` 
else
#`curl -X POST -H "Authorization: Basic f69a042ad72594792950fecc8ca4539d2fff7b75" -H "Content-Type: application/json" 
#-d  "$(postfailure)" "https://api.github.com/repos/HSarode-Compumatrice/money-1/statuses/$GIT_COMMIT"` 
echo "In Failed"
fi

詹金斯控制台输出:

Started by user Harshal Sarode
[EnvInject] - Loading node environment variables.
Building on master in workspace /var/lib/jenkins/workspace/github-commit-status-api
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/HSarode-Compumatrice/money-1.git # timeout=10
Fetching upstream changes from https://github.com/HSarode-Compumatrice/money-1.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > git fetch --tags --progress https://github.com/HSarode-Compumatrice/money-1.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision b159d0e0d0f71f3d1e399c877705c9d698cd9e14 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f b159d0e0d0f71f3d1e399c877705c9d698cd9e14
 > git rev-list b159d0e0d0f71f3d1e399c877705c9d698cd9e14 # timeout=10
[github-commit-status-api] $ /bin/bash -xe /tmp/jenkins5873807540526862643.sh
+ echo 'Before Building!!'
Before Building!!
[PostBuildScript] - Execution post build scripts.
[github-commit-status-api] $ /bin/bash -xe /tmp/jenkins982148387285704643.sh
+ echo 43
43
++ sudo cat /var/lib/jenkins/jobs/github-commit-status-api/builds/43/build.xml
++ grep -oP '(?<=<result>).*?(?=</result>)'
cat: /var/lib/jenkins/jobs/github-commit-status-api/builds/43/build.xml: No such file or directory
+ BUILD_STATUS=
Build step 'Execute a set of scripts' changed build result to FAILURE
Build step 'Execute a set of scripts' marked build as failure
Finished: FAILURE
jenkins
  • 1 1 个回答
  • 12167 Views

1 个回答

  • Voted
  1. Best Answer
    Jacob
    2017-04-18T15:24:00+08:002017-04-18T15:24:00+08:00

    /var/lib/jenkins/jobs/github-commit-status-api/builds/<build number>如果您在构建过程中进入该文件夹,您会看到该文件夹build.xml​​不存在,并且在构建完成之前不会存在。

    • 1

相关问题

  • 允许非 root 用户重新启动服务

  • Jenkins Slave 在构建期间离线

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve