Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy to github with file pattern on travis?

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?

like image 307
Herbert Poul Avatar asked Sep 19 '14 08:09

Herbert Poul


People also ask

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.

Is Travis CI Com free?

You most certainly can! And you get 1 month for free – 12 months for the price of 11! Simply select the annual option when signing up for a subscription, or go to travis-ci.com if you wish to switch your current plan to annual.


2 Answers

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.

like image 148
Jakob Avatar answered Oct 03 '22 05:10

Jakob


deploy:   file_glob: true   file: "build/distributions/worktrail-app-hub-sync*.zip" 

example

like image 41
user2673683 Avatar answered Oct 03 '22 07:10

user2673683