传递自定义变量以通过API流动
我正在在Android应用程序上设置一个比特。我拥有与流有关的所有设置,问题是我有一个需要参数的自定义Python Builder。我的构建流是通过API触发的,API正常工作 - 唯一缺少的是将该参数传递给构建脚本。
我目前拥有的内容:
我添加了一个环境变量;命名 param
我的JSON主体,触发构建
{ “ hook_info”:{ “ type”:“ bitrise” },, “ build_params”:{ “分支”:“主人”, “ workflow_id”:“ test_args_script”, “ commit_message”:“从邮递员触发”, “环境”:[ { “ mapped_to”:“ param”, “ value”:“ 123456”, “ is_expand”:true } 这是给出的 } }
- 我的JSON主体,它触发了Bitrise流的
我有一个脚本步骤,该步骤实际上是称为Python脚本,如下所示: Python Builder.py $ param
期望:
我的期望是将传递给脚本的值与API有效载荷(123456)中的值相同。
如果有人最近从事类似的事情,或者你们都可以指出我可以帮助我实现上述文件的文档,我将非常感谢!
I am setting up a Bitrise on an Android app. I have everything set that is related to the flow, the thing is that I have a custom python builder which requires a parameter. My build-flow is triggered through API, which is working as expected - the only thing missing is passing that parameter to the build script.
What I have currently:
I have added an env-variable; named PARAM
My JSON body, that triggers the build
{ "hook_info":{ "type":"bitrise" }, "build_params":{ "branch":"master", "workflow_id":"test_args_script", "commit_message":"Triggered from postman", "environments":[ { "mapped_to":"PARAM", "value":"123456", "is_expand":true } ] } }
On the Bitrise flow I have a script step which is actually calling the python script as follows: python builder.py $PARAM
EXPECTATIONS:
My expectations are that the value that will be passed to the script will be the same as the one in the API payload (123456).
If anyone has recently worked on something similar, or if any of you guys can point me out to documentation that will help me to achieve the above I will be really thankful!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我实际上找到了道路。我目的的问题是,我已经命名了一个环境变量,与从API传递的一个变量相同。将名称更改为另一个名称后,我能够获取参数并将其传递给构建脚本。如果有人需要更多信息,请大声喊叫,我可以将有效载荷与流设置一起发布。
I actually found the way. The problem on my end was that I had an env-variable already named the same as the one variable that has been passed from the API. After changing the name to a different one, I was able to get the parameter and pass it to the build script. If anyone needs more info, give me a shout and I can post the payload along with the flow settings.