prefect bitbucket
v0.2.2
笔记
该项目的积极发展已在PrectectHQ/县内移动。该代码可以在此处找到,并在此处找到文档。请打开针对Precthq/perfect而不是此存储库的问题。
与Bitbucket存储库一起工作的良好集成。
需要安装Python 3.7+。
我们建议使用Python虚拟环境经理,例如Pipenv,Conda或Virtualenv。
这些任务旨在与Prefect 2.0合作。有关如何使用县的更多信息,请参阅县长文档。
使用pip
安装prefect-bitbucket
:
PIP安装豪宅
然后,注册以查看Prefect Cloud上的块:
秘密块寄存器-M prect_bitbucket
注意,要使用块上的load
方法,您必须已经拥有通过代码保存或通过UI保存的块文档。
从prect import import flow from prect_bitbucket.credentials import bitbucketcredentials@flowdef use_stored_bitbucket_creds_flows_flow():bitbucket_credentials_block = bitbucketcredentials.load(blockedeccredentialssss.loke)
来自prect import flow frow from prect_bitbucket.credentials导入bitbucketcredentials@flowdef create_new_bitbucket_creds_flows_flow():bitbucket_credentials_block = bitbucketcredentials(bitbucketCredentials)
从prect_bitbucket导入bitbucketrepositorypublic_repo =“ https://bitbucket.org/my-workspace/my-repositority.git"#您的县长工作区(在blocks选项卡)public_bitbucket_block.save(“ my-bitbucket-block”)
从prect_bitbucket导入bitbucketrepositorypublic_repo =“ https://bitbucket.org/my-workspace/my-workspace/my-repositority.git"#创建一个public bitbucket repository bitbucketrebucketrepository bitbucketrepositor blockbranch_bitblanch_bitbucket_block_block_block_block_block_block = bitbucketrepos = bitbucketrepos =主“ repository = public_repo)#将bitbucketrepository块保存到您的prect workspace(在“块”选项卡中)
从prect_bitbucket导入bitbucketcredentials,bitbucketrepository#for a private repo,我们需要凭据才能访问itbitbucket_credentials_block = bitbucketCredentials(bitbucketcredentials)(token = token =“ my-token”,my-token' “块”选项卡)bitbucket_credentials_block.save(name =“ my-bitbucket-credentials-block”)#创建一个私人bitbucket存储库BitbucketRebcository blockprivate_repo =“ bitbucketrepository(repository = private_repo,bitbucket_credentials = bitbucket_credentials_block)#将bitbucketrepository块保存到prefect workspace(在blocks tabs tabs tab)中
从prect_bitbucket导入bitbucketcredentials,bitbucketrepository#加载preexisting bitbucketcredentials blockbitbucketcredentials.loads.loads.loads.loads.loads.loads.loads.loads存储库。
!!!!信息“ Bitbucket服务器和Bitbucket Cloud之间的差异”
For Bitbucket Cloud, only set the `token` to authenticate. For Bitbucket Server, set both the `token` and the `username`.
如果您在使用prefect-bitbucket
时遇到任何错误,请随时在Prectect-Bitbucket存储库中打开问题。
如果您在使用prefect-bitbucket
时有任何疑问或问题,则可以在Prefect演讲论坛或Perfect Slack社区中找到帮助。
随时可以观看prefect-bitbucket
以获取更新!
如果您想安装一个版本的prefect-bitbucket
进行开发,请克隆存储库,并使用pip
执行可编辑的安装:
git克隆https://github.com/prefecthq/prefect-bitbucket.gitcd prectect-bitbucket/ pip install -e“。