Closed willis7 closed 9 years ago
@willis7 the original idea for this DSL was to use your second approach, only one consideration is that, if you set defaultDomain = null
then it will use the first one (this is not enforced or guaranteed but as today it does).
I would use the last approach, but also I acknowledge the DSL can be improved to be used with CI.
@juancavallotti I tried your suggestion, but I get the following error:
:deploy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':deploy'.
> Multiple cloudhub domains found but none selected as default: [${project.name}-sbx, ${project.name}-dev, ${project.name}-sys, ${project.name}-uat]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.693 secs
Where ${project.name}
is hidden for security here.
Whilst this is not desirable, the following does work and lets me progress:
defaultDomain = System.env.CLOUDHUB_TARGET
I can inject this for each CI job for now.
@willis7 the following is working for me:
cloudhub.domains {
chdev username: '', password: ''
chdevProd username: '', password: ''
defaultDomain = project.hasProperty('domain') ? project.domain : null
}
And then I use the following command line
gradle deploy -Pdomain=chdevProd
I can see the output:
:build UP-TO-DATE
:deploy
Uploading file issue57.zip to URL: https://cloudhub.io/api/applications/chdevProd/deploy
Thanks for having a look. I followed your lead and it passed. I'm surprised you needed to use project
in the project.domain
I thought this was implied.
Sorry for causing you so many headaches - if its any consolation, myself and our development team love the plugin!
No problem at all, I'm glad to help and I'm glad to hear that kind of feedback.
In my Jenkins pipeline I need to change
defaultDomain
on a per job basis, so that I target different stages in the SDLC. So for dev I may usemule-gradle-sample-project-dev
, but for production I may want to usemule-gradle-sample-project
.I have tried 2 methods to achieve this, but neither works. First, I tried passing in:
gradlew deploy -x test -Pcloudhub.domains.defaultDomain=mule-gradle-sample-project-dev
Then I tried the following in the code:
gradlew deploy -x test -PdefaultDomain=mule-gradle-sample-project-dev
What is the preferred approach for this type of use case?