如何部署到travis文件模式的github? [英] How to deploy to github with file pattern on travis?
问题描述
我创建了一个简单的Travis配置,它打包一个应用程序并尝试将存档文件部署到github。
问题是,我希望版本号是文件名的一部分,所以我需要为文件名使用模式。
配置目前是:
<$ c $ b $部署:
提供者:发布
文件:build / distributions / worktrail-app-hub-sync * .zip
on:
repo:worktrail / worktrail- app-hub-sync
tags:true
all_branches:true
但它失败:/home/travis/.rvm/gems/ruby-1.9.3-p547/gems/octokit-3.3.1/lib/octokit/client/releases.rb:86:in`初始化:没有这样的文件或目录 - build / distributions / worktrail-app-hub-sync * .zip(Errno :: ENOENT) - 但该文件当然存在:build / distributions / worktrail-app-hub-sync-0.0.1.zip
运行示例: https://travis-ci.org/worktrail/worktrail-app-hub-sync/builds/35704111
travis.yml: https://github.com/wo rktrail / worktrail-app-hub-sync / blob / 0.0.1 / .travis.yml
这是由travis部署支持还是有这个用例的解决方法是什么?
如果启用 file_glob
选项。这是我如何将一个构建 .deb
文件部署到GitHub发布:
before_deploy:
- 出口RELEASE_PKG_FILE = $(LS * .deb文件)
- 回声 部署$ RELEASE_PKG_FILE到GitHub上发布
部署:
供应商:发行
API_KEY :
安全:YOUR_ENCRYPTED_API_KEY
file_glob:真正的
档: $ {RELEASE_PKG_FILE}
上:
标签:真
使用伪文件名执行 travis setup releases
并修改 .travis.yml
之后。
I have created a simple travis configuration which packages an app and tries to deploy the archive file to github. The problem is, I would like to have the version number part of the file name, so i require to use a pattern for the filename. I simply can't get it to work.
Configuration is currently:
deploy:
provider: releases
file: "build/distributions/worktrail-app-hub-sync*.zip"
on:
repo: worktrail/worktrail-app-hub-sync
tags: true
all_branches: true
But it fails with: "/home/travis/.rvm/gems/ruby-1.9.3-p547/gems/octokit-3.3.1/lib/octokit/client/releases.rb:86:in `initialize': No such file or directory - build/distributions/worktrail-app-hub-sync*.zip (Errno::ENOENT)" - but the file is certainly there: build/distributions/worktrail-app-hub-sync-0.0.1.zip
Example run: https://travis-ci.org/worktrail/worktrail-app-hub-sync/builds/35704111 travis.yml: https://github.com/worktrail/worktrail-app-hub-sync/blob/0.0.1/.travis.yml
Is this supported by travis deployment, or is there any workaround for this use case?
Wildcards are supported by now if you enable the file_glob
option. This is how I deploy a build .deb
file to GitHub releases:
before_deploy:
- export RELEASE_PKG_FILE=$(ls *.deb)
- echo "deploying $RELEASE_PKG_FILE to GitHub releases"
deploy:
provider: releases
api_key:
secure: YOUR_ENCRYPTED_API_KEY
file_glob: true
file: "${RELEASE_PKG_FILE}"
on:
tags: true
Setting up is easy by executing travis setup releases
with a dummy filename and modifying .travis.yml
afterwards.
这篇关于如何部署到travis文件模式的github?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!