Question

I have a gradle tasks that deploys some stuff to bintray using curl.

For this to work it needs my bintray api key. I don't want to put that in my build script (or a property file) since all this stuff is hosted in plain sight at github.

Instead I made the task use a property named bintrayApikey which is to be provided when calling gradle. When I run it locally using

gradlew pushToBintray -DbintrayApikey=<my api key>

everything works as intended.

So the next step is to make this work from my Jenkins over at cloudbees. Since there doesn't seem to be a special place for putting system properties I just added them to the tasks, but this does not seem to work. In the console I can see it is accessing bintray all right, but then finishes with:

This resource requires authentication 

So how can I provide the property value in my jenkins job configuration?

Était-ce utile?

La solution

Use -Pmyprop instead of -Dmyprop.

The Gradle Jenkins Plugin accepts parameters with -P.

-D is for java parameters.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top