jenkins - script.sh:语法错误:“(”意外脚本返回退出代码 2
问题描述
尝试在 jenkins 中为 post 方法设置 body 参数,构建失败,因为错误意外“(”脚本返回错误状态 2。
以下是 jenkins 中的附加代码阶段:
script{
sh ("pip install semgrep")
semgrep_result = sh(script:"semgrep --config=p/r2c-ci src --json",
returnStdout:true).trim()
echo "semgrep_res $semgrep_result"
sh"""
curl -X POST \
-d "result":"$semgrep_result" \
-d "discovery_source":"SAST" \
-d "reponame":"v*****" \
'https://dev************/get_scan_data'
"""
}
它给出的错误为 [2021-09-08T0 2Z] /home/ / ace/pi-changes-for-tools-
integration@tmp/durabl */script.sh: 1: /home/j */***pi- changes-for-tools-integration@tmp/durable-/script.sh
:语法错误:“(”意外脚本返回退出代码
尝试修剪连同 sh 脚本仍然给出相同的错误
任何人都可以告诉什么是错的?
解决方案
推荐阅读
- java - 序列化与实现
- python - matplotlib(anaconda)更新问题
- python - 如何根据列表的长度将包含列表的字典分成相等的部分
- r - 在R中的多元回归中找到样条回归的系数
- r - 如何将字符串匹配映射到具有缺失值的二维数据集中的变量
- react-native - 如何使用状态动态更改 React Native 转换?
- linux - 使用 bash 和 grep -c 对密码子进行排序和计数
- scala - 如何让 Hibernate 忽略某个名称的属性?
- android - Collections.sort 的比较函数在 Kotlin 中需要一个 Int 类型的值
- python - Visual Studio Code Python 加载自己的模块