-
Notifications
You must be signed in to change notification settings - Fork 197
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
Feature Request: support default environment variables/project properties #309
Comments
I don't think this is a particularly good thing to have, as not everyone has env as And some people might perhaps use GitHub Actions to automate their process of uploading things (or a CI server for that). Tl;dr There are many variables to look for and just one specific use-case isn't really that big of a reason to implement something... My opinion tho. |
I don't really get any of your points.
Looking for an env variable if no setting was found can't do any harm though, so it doesn't change anything for people not defining this variable. However it allows people who do use environment variables (e.g. for CI setup) to not have to configure this explicitly. Convention over configuration is one of Gradle's principles.
In the first draft of my issue, I actually mentioned using gradle properties and then fall back to env variables if those are not found. That being said, sensitive information like the API key cannot and should not be placed in the project's
How does that relate to the issue? I'm specifically speaking of simplifying the necessary Gradle config to enable CI/CD.
Well the point of having a Bintray Gradle plugin in the first place is to avoid copy pasting deployment code, so I find it reasonable to expect not to have to copy paste stuff from one project to another. Only project-specific things should appear in the build file, the rest should be in plugins. I return the question, though: what is so bad about adding these defaults? Also, what about all the other defaults, not even relying on env variables ? |
I feel like I'm always writing the same
bintray { }
closure over and over in many projects because they follow the same pattern.Some values can have pretty reasonable defaults taken from the existing project configuration:
pkg.name
defaulting to the project's namepkg.desc
defaulting to the project's descriptionpkg.version.name
defaulting to the project's versionpkg.version.desc
defaulting to the project's descriptionAlso, everything that is not project-specific could (should?) be taken from the environment (either in gradle properties or environment variables). Environment variables are usually easier to use than gradle properties when configuring a CI/CD pipeline (they usually also have mechanisms to hide variables that contain secrets like API keys).
This is why I believe this plugin could define standard environment variables for some configuration values, which would enable smaller build files (and make people align on common names):
user
could fallback to the env variableBINTRAY_USER
(possibly also allow a Gradle property)key
could fallback to the env variableBINTRAY_KEY
pkg.repo
could fallback to the env variableBINTRAY_REPOSITORY
Maybe I'm unaware that some of them actually already exist. If so, it would be nice to indicate it in the doc.
The text was updated successfully, but these errors were encountered: