bmuschko / gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Apache License 2.0
258 stars 63 forks source link

cargoRedeployRemote to Tomcat8 works but fails to update version number #168

Closed foriegnbody closed 5 years ago

foriegnbody commented 6 years ago

If I manually deploy a file "TPCC##1.1.0.war" it shows up in tomcat as expected as context of tpcc and a version of 1.1.0.

However that doesn't see to be the case using cargoRedeployRemote. It deploys, just the version is left as "None specified"

Here's the cargo snippet:

version '##' + passedVersion //cargo config cargo { containerId = 'tomcat8x' port = 80

deployable {
    file = file("$buildDir/libs/TPCC" + project.version + ".war")
    context = 'tpcc'
}

Any thoughts?

bmuschko commented 6 years ago

The issue you seeing is very likely a problem with the Cargo library. I have a couple of comments about your code and the approach.

I'd use the full path to the WAR archive when assigning the value. That will always give you the right path without having to manually construct it (assuming you don't do any other customizations).

deployable {
    file = war.archivePath
}

In Java, a filename usually separates the name of the artifact from the version with a dash character. It's likely that ## cannot be recognized by Cargo. I'd use tpcc-1.1.0.war instead. If you can't resolve the issue by changing the artifact name then I'd ask on the Cargo mailing list.

bmuschko commented 5 years ago

I am going to close this issue as the conversation stopped after my suggestion.