Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload even if list of branches is empty #2438

Conversation

ericfont
Copy link
Contributor

@ericfont ericfont commented Mar 9, 2016

I would like my personal travis to upload all my personal branches to my personal bintray.
If travis environment variable $APPIMAGE_UPLOAD_BRANCHES isn't defined, then "./build/travis/job2_AppImage/build.sh" will have the same default behavior as if did not even use the parameter "--upload-branches".

@ericfont
Copy link
Contributor Author

ericfont commented Mar 9, 2016

I'm realizing that the travis builds won't be uploaded to bintray if there is no bintray package already created with that branch name...see very end of this build log:

https://travis-ci.org/ericfont/MuseScore/jobs/114816133

I'm going to see if there is a way I can have travis tell bintray to automatically create the package if it doesn't exist...

I'm sorry for all the edits...let me verify this

@ericfont
Copy link
Contributor Author

ericfont commented Mar 9, 2016

I found what I need in the bintray API, under section "Create Package":

POST /packages/:subject/:repo

standby...let me verify this & update PR.

@ericfont
Copy link
Contributor Author

ericfont commented Mar 9, 2016

hmm...apparenltly bintray.sh already tries to make package here:

https://github.com/musescore/MuseScore/blob/master/build/travis/job2_AppImage/bintray.sh#L213-L224

let me investigae why it doesn't...

And I'm considering maybe using the wildcard "*" for APPIMAGE_UPLOAD_BRANCHES to indicate upload all branches...

@ericfont
Copy link
Contributor Author

ericfont commented Mar 9, 2016

oh I see {"message":"forbidden"} is response. The reason is becuase bintray.sh sets variable BINTRAY_REPO_OWNER="musescore". I think the solution is to use environment varialbe, just like

BINTRAY_USER=$BINTRAY_USER # env
BINTRAY_API_KEY=$BINTRAY_API_KEY # env
does

@ericfont
Copy link
Contributor Author

regarding the BINTRAY_REPO_OWNER, I submitted a seperate PR #2440, which is a separate issue from this PR, so you can consider this two PR's independently.

@lasconic
Copy link
Contributor

I think I prefer the wildcard since it gives the ability to have none, a list of branches, or all branches. While hardcoding empty to all doesn't give none as an option.

@ericfont
Copy link
Contributor Author

OK. Unfortunately my bash skills are poor. I actually had trouble evaluating wildcard... I'm about to go to sleep now...if you know how to do that go ahead now, if not I'll try to implement wildcard tomorrow.

@lasconic
Copy link
Contributor

No hurry. Have a good night!

@shoogle
Copy link
Contributor

shoogle commented Mar 10, 2016

@ericfont doesn't the else cover it for you?

Call build.sh like this:

./build.sh # this uploads on every branch
./build.sh --upload-branches # this uploads on no branches
./build.sh --upload-branches master 2.0.3 # this uploads only on "master" and "2.0.3"

Edit: it probably makes sense to have a wildcard in light of this commit. That way you can set $APPIMAGE_UPLOAD_BRANCHES="wildcard" inside the Travis environment rather than patching .travis.yml every time you build. Maybe use "ALL" rather than "*" as the wildcard to avoid problems if someone tries to run it on the shell.

@ericfont
Copy link
Contributor Author

that else doesn't cover it. Becuse I wanted a way to control the build script using ONLY environment variables. Since the "--upload-brances" is hardcoded into code, then user would have to modify the .travis.yml, which I don't want.

I am thinking "ALL" will be the best, as I discovered exactly that issue you describe where "*" was resolving to all files in current directory :)

@lasconic
Copy link
Contributor

ALL is fine for me.

@lasconic lasconic added the work in progress not finished work or not addressed review label Mar 10, 2016
@ericfont ericfont force-pushed the 101361-upload-even-if-list-of-branches-empty branch 2 times, most recently from bbb3ee3 to bfd8c52 Compare March 10, 2016 07:38
I would like my personal travis to upload all my personal branches to my personal bintray.
To accomplish this, if the Travis environment variable $APPIMAGE_UPLOAD_BRANCHES is set to the specific string "ALL", then the command "./build/travis/job2_AppImage/build.sh --upload-branches $APPIMAGE_UPLOAD_BRANCHES" will upload all branches.  But, if user leaves the $APPIMAGE_UPLOAD_BRANCHES undefined, then that command won't upload any branches.
@ericfont ericfont force-pushed the 101361-upload-even-if-list-of-branches-empty branch from bfd8c52 to 60d1c6f Compare March 10, 2016 07:41
@ericfont
Copy link
Contributor Author

ok...I've recommited, such that "--upload-branches ALL" will upload all branches. Here is new commit title "allow Travis to upload ALL branches to bintray" and new commit message:

I would like my personal travis to upload all my personal branches to my personal bintray.
To accomplish this, if the Travis environment variable $APPIMAGE_UPLOAD_BRANCHES is set to the specific string "ALL", then the command "./build/travis/job2_AppImage/build.sh --upload-branches $APPIMAGE_UPLOAD_BRANCHES" will upload all branches.  But, if user leaves the $APPIMAGE_UPLOAD_BRANCHES undefined, then that command won't upload any branches.

I tested those bash lines in a little test bash script on my terminal, and behaves as I've described.

lasconic added a commit that referenced this pull request Mar 12, 2016
…branches-empty

upload even if list of branches is empty
@lasconic lasconic merged commit 446e80d into musescore:master Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in progress not finished work or not addressed review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants