-bash: ./deploy.sh: /bin/bash^M: bad interpreter: No such file or directory

文章目录

场景

jenkins 发布失败, 报错ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [126]], 这说明远程服务器的deploy.sh执行失败, 首先检查权限,没有发现问题,然后手动执行一遍又报错"-bash: ./deploy.sh: /bin/bash^M: bad interpreter: No such file or directory", 这个意味着脚本是windows回车符结尾

txt 复制代码
[JENKINS] Archiving /home/vagrant/.jenkins/workspace/jenkinsDemo/target/jenkinsDemo-1.0-SNAPSHOT.jar to com.carsonlius/jenkinsDemo/1.0-SNAPSHOT/jenkinsDemo-1.0-SNAPSHOT.jar
channel stopped
SSH: Connecting from host [ubuntu-xenial]
SSH: Connecting with configuration [107.173.111.224 自己] ...
SSH: EXEC: completed after 604 ms
SSH: Disconnecting configuration [107.173.111.224 自己] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [126]]
Build step 'Send build artifacts over SSH' changed build result to UNSTABLE

解决

sed -i -e 's/\r$//' deploy.sh

相关推荐
pursue.dreams4 小时前
Ubuntu安装Jenkins完整教程
linux·ubuntu·jenkins
城南花开时4 小时前
CICD工具,Jenkins or Tekton or Arbess一文全面对比评测
jenkins·tekton
非典型代码4 小时前
Jenkins发不出邮件
运维·servlet·jenkins
佐杰9 小时前
Jenkins安装部署
运维·servlet·jenkins
傻啦嘿哟11 小时前
实战:用Elasticsearch构建爬虫数据搜索引擎
运维·jenkins
顾安r16 小时前
11.5 脚本 本地网站收藏(解封归来)
linux·服务器·c语言·python·bash
佐杰16 小时前
Jenkins是什么
运维·jenkins
一周困⁸天.1 天前
Elasticsearch+Logstash+Filebeat+Kibana部署【7.1.1版本】
大数据·elk·elasticsearch·jenkins
xiaobangsky1 天前
Elasticsearch安装使用
elasticsearch·jenkins
i_am_a_div_日积月累_2 天前
jenkins打包报错
运维·rust·jenkins·jenkins打包报错