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

Cannot use environment variable to set deploy.prerelease in .travis.yml #613

Closed
Librazy opened this issue Apr 15, 2017 · 9 comments
Closed

Cannot use environment variable to set deploy.prerelease in .travis.yml #613

Librazy opened this issue Apr 15, 2017 · 9 comments

Comments

@Librazy
Copy link

@Librazy Librazy commented Apr 15, 2017

I tried to automate my github prerelease/release deploy. I wish I could ship a release when my commit message start with some magic chars. So I wrote some bash script in before_deploy to set up a environment variable GHTHUB_DEPLOY_PRERELEASE, and set deploy.prerelease to

  prerelease: $GHTHUB_DEPLOY_PRERELEASE

everything works fine when preparing deploy.
But it says

For 'properties/prerelease', "false" is not a boolean. // See: https://developer.github.com/v3

when deploying application.

full log:
https://travis-ci.org/Librazy/TooltipFilter/builds/222308618

.travis.yml:
https://github.com/Librazy/TooltipFilter/blob/d767b946acd87a701e886c9d282032558e001917/.travis.yml

……Seems that environment variables are always strings?

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Apr 15, 2017

Boolean values need to be handled in Releases options.

@Librazy
Copy link
Author

@Librazy Librazy commented Apr 15, 2017

Any workaround now?
Can I call dpl directly then pass --prerelease=$GHTHUB_DEPLOY_PRERELEASE to it?

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Apr 15, 2017

Arguments need to be processed by dpl into booleans, so that the GitHub API payload has correct data type (false vs "false").

@tovrstra
Copy link

@tovrstra tovrstra commented Aug 28, 2017

I'm hitting the same issue. Is there a workaround?

@mjackson
Copy link

@mjackson mjackson commented Feb 1, 2018

One workaround would be to use deploy.on.condition to just skip the whole deploy. You need to duplicate all the other deploy config for each case, but since prerelease is a boolean there will only be 2.

I'm doing it here.

@XaF
Copy link

@XaF XaF commented Mar 8, 2018

Following that issue. Same problem here.

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Mar 19, 2018

Hello there. I've pushed a potential fix for this issue. Please test and report the results. Thank you.

provider: releases
edge:
  branch: releases-booleanize# rest

(If you have multiple deployment providers, please adjust the definition accordingly.)

Librazy added a commit to Librazy/TooltipFilter that referenced this issue Mar 20, 2018
@Librazy
Copy link
Author

@Librazy Librazy commented Mar 20, 2018

It works !

@Librazy Librazy closed this Mar 20, 2018
@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Mar 20, 2018

1.9.2 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.