make it easy for contributors to run tests on personal travis & build AppImages to personal bintray

• Mar 9, 2016 - 05:13

It would save development time (and personal computer resources) if could have the Travis and bintray infrastructure be easily utilized by MuseScore contributors when committing to personal fork.

Currently, .travis.yml is configured to send an email to musescore developers and irc channel whenever it builds. But if I want to modify the .travis.yml in my own fork's master and change that email address to my own (so other people don't get spammed), then unfortuntely it is not easy to make pull requests because my branches will then always have a modified .travis.yml. I tried things like git ignore, but those wouldn't work well, and when I asked lasconic about 7 months ago he said unfortuantely there is no "elegant" solution. But I'm hoping now that there is some solution. Maybe could the .travis.yml utilize an environment variable which provides the notification email address? (individual users can set environment variables in their personal travis).

To setup travis, my current workaround is:

  1. make a new branch
  2. enable the git->travis build hook in travis website settings (https://travis-ci.org/profile/username) by flicking the repo username/MuseScore on
  3. enable travis setting for "build pushes" (https://travis-ci.org/username/MuseScore/settings)
  4. remove the email address in .travis.yml, or if you want to be noticied when build completes, set to your own email
  5. add .travis.yml in a new commit
  6. finally push to trigger the build
  7. to prevent future commits from building, disable the "build pushes" setting

Unfortunately if wanted to make a pull request now, I would have to make a new branch that didn't include any changes to .travis.yml.

To automatically generate personal AppImages, here is what I needed to do in order to get my personal bintray setup to working with travis:

  1. goto https://bintray.com/profile/edit, click on API key
  2. generate a bintray API key and copy to clipboard
  3. add environment variable "BINTRAY_API_KEY" to Travis (https://travis-ci.org/username/MuseScore/settings) and paste that key
  4. set BINTRAY_USER to whatever your bintray user name is (should be same as github username if created travis & bintray accounts from github)
  5. in https://bintray.com/username settings for repository, create a new "generic" repository named "nightlies-linux" (although I might want to name this something different like "ericfont-commits-linux" but would need to change BINTRAY_REPO variable in build/travis/job2_AppImage/bintray.sh since is set to "nightlies-linux"
  6. in build/travis/job2_AppImage/bintray.sh need to set BINTRAY_REPO_OWNER="yourbintrayusername" and VCS_URL="https://github.com/yourgithubusername/MuseScore.git"
  7. in .travis.yml need to set .travis.yml need to remove the parameter --upload-branches so it always builds any of your branches

Am I missing something or did I include a superflous step? Can we make so easier to push Is there anything we can do to make this process easier for new initial setups?


Comments

In reply to by [DELETED] 5

I can confirm that my build now automatically runs *Travis*, and sends me email if my build fails, THANKS!

But I would additionally also like to automatically upload to bintray whenever I make a branch. The line 71:

./build/travis/job2_AppImage/build.sh --upload-branches $APPIMAGE_UPLOAD_BRANCHES

and similarly line 83 currently use the environment variable "$APPIMAGE_UPLOAD_BRANCHES" for list of branches ot upload.

I've submitted PR https://github.com/musescore/MuseScore/pull/2438 which will upload all branches if my personal travis environment variable "$APPIMAGE_UPLOAD_BRANCHES" is not defined. (maybe you have a preffered way to handle this...maybe instead have "all" be interpreted as upload all branches, e.g.:

[ "$2" == "all" ]

Do you still have an unanswered question? Please log in first to post your question.