bitbucket - Bitbucket API 更新管道变量
问题描述
我无法成功更新存储库变量,也不确定它为什么不起作用。
我已经能够通过 API 获取所有必要的 ID,并发出以下 curl 请求:
curl -X PUT "https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pipelines_config/variables/{variable_uuid}" -H 'Content-Type: application/json' -d '{"value":"{value}","key":"{name}"}'
从这里我得到:
{"type": "error", "error": {"message": "Resource not found"}}
有没有人知道我已经尝试改变我能想到的一切但没有运气
解决方案
- curl -v -X PUT "https://api.bitbucket.org/2.0/repositories/$ORG_OR_WORKSPACE/$REPO/pipelines_config/variables/\{$HASH_VARIABLE\}" -H "Content-Type:application/json" -d "{\"key\":\"$VARIABLE_NAME\", \"value\":\"$VARIABLE_VALUE\" }" --user $PIPELINE_APP_PASS
实际的哈希需要用括号括{}
起来\
尝试从终端运行命令以确保您可以更新变量。您可能想要创建一个具有访问权限的用户应用程序密码,应该是username:password
推荐阅读
- vba - 如何在 VBA 中显示用户窗体的图形编辑器视图(关闭后)?
- java - 在 configServer 中添加过滤器
- regex - 如何使用验证器验证 asp 页面以验证文本框以允许 2 种不同长度的输入?
- java - JFrame颜色变化
- ruby-on-rails - 从 Mounted Gems 运行 Rspecs
- angular - Angular - TypeError:无法读取未定义的属性“jobTitle”
- javascript - 使用 javascript 检测可变字体支持
- python - 为什么在 JsonResponse 中使用非字典对象不好?
- go - 与 goroutine 混淆
- git - 多个开发人员如何在同一个功能(分支)上工作?