使用Travis CI构建Python分发并上传到Jfrog Artifactory

发布于 2025-01-27 19:55:02 字数 91 浏览 4 评论 0原文

我想使用Travis CI来构建和发布给文物的分布。是否有人有示例配置可以共享这样的事情?我试图将这些碎片放在一起,但是我是Travis的新手,很难看到幕后发生的事情。

I would like to use Travis CI to build and publish distributions to Artifactory. Does anyone have an example configuration that does anything like this they could share? I'm trying to put the pieces together, but I'm new to Travis and it's hard to see what goes on behind the scenes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ゞ记忆︶ㄣ 2025-02-03 19:55:02

您应该能够与 jfrog cli 是针对此类用例制作的。

您将必须下载并将其作为Travis构建步骤的一部分进行配置。

安装

curl -fL https://install-cli.jfrog.io | sh

配置(假设您具有所需的环境变量集)

jfrog rt config --url ${RT_URL} --user ${RT_USER} --apikey ${RT_API_KEY}

现在您只需运行构建并将结果上传(请参阅文档以获取完整详细信息)

jfrog rt u ...

You should be able to get that working with the JFrog CLI, which is made for exactly such use cases.

You will have to download and configure it as part of your travis build steps.

Install

curl -fL https://install-cli.jfrog.io | sh

Configure (assume you have the needed environment variables set)

jfrog rt config --url ${RT_URL} --user ${RT_USER} --apikey ${RT_API_KEY}

Now you just run your build and upload the results with (see docs for full details)

jfrog rt u ...
围归者 2025-02-03 19:55:02

如果这对其他任何人都有帮助,我将根据@eldad asis的答案发布工作的.travis.yml配置的相关部分。 (由于某种原因,我无法获得上传要正确地使用config> config'd正确,因此请评论并在下面进行替换)

script:
- virtualenv buildwheel
- . buildwheel/bin/activate
- python setup.py sdist
- curl -fL https://install-cli.jfrog.io | sh
# - jf config add <my_server> --artifactory-url ${RT_URL} --user ${RT_USER} --access-token ${RT_API_KEY}
# - jf rt upload --server-id <my_server> --flat=true dist/\* <my_repository>/
- jf rt upload --url ${RT_URL} --user ${RT_USER} --access-token ${RT_API_KEY} --flat=true dist/\* <my_repository>/
- deactivate

再次感谢Eldad呢

In case it's of help to anyone else, I'm posting the pertinent section of my working .travis.yml config based on @Eldad Asis's answer. (For some reason, I couldn't get upload to use the system I'd config'd correctly, so that is commented out and replaced below)

script:
- virtualenv buildwheel
- . buildwheel/bin/activate
- python setup.py sdist
- curl -fL https://install-cli.jfrog.io | sh
# - jf config add <my_server> --artifactory-url ${RT_URL} --user ${RT_USER} --access-token ${RT_API_KEY}
# - jf rt upload --server-id <my_server> --flat=true dist/\* <my_repository>/
- jf rt upload --url ${RT_URL} --user ${RT_USER} --access-token ${RT_API_KEY} --flat=true dist/\* <my_repository>/
- deactivate

Thanks again, Eldad!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文