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

Comments

@Librazy
Copy link

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
Contributor

Boolean values need to be handled in Releases options.

@Librazy
Copy link
Author

Librazy commented Apr 15, 2017

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

@BanzaiMan
Copy link
Contributor

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

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

@mjackson
Copy link

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 commented Mar 8, 2018

Following that issue. Same problem here.

@BanzaiMan
Copy link
Contributor

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
Copy link
Author

Librazy commented Mar 20, 2018

It works !

@Librazy Librazy closed this as completed Mar 20, 2018
@BanzaiMan
Copy link
Contributor

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
Development

No branches or pull requests

5 participants