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

Glassfish/Payara : deployment order #209

Open
morayKevin opened this issue Apr 26, 2023 · 5 comments
Open

Glassfish/Payara : deployment order #209

morayKevin opened this issue Apr 26, 2023 · 5 comments

Comments

@morayKevin
Copy link

Hi,

We use Jenkins to do deferred deployment of our applications on our production servers.

For this we use Gradle with the Cargo plugin (2.8.0)

It works very well but the deployment order is then reset to 100. This is highly problematic for some applications where this value is important.

my cargo task is

task deployOnGlassfish(type: CargoDeployRemote, dependsOn: validateBranch) {
  description = "Deploys WAR to Glassfish ."  // description of task
  containerId = 'glassfish5x'
  timeout = Duration.ofMinutes(2)
  hostname = "$fedris_test"
  protocol = 'https'
  port = 4848
  username = userLogin // username of tomcat
  password = userPassword  // password of the tomcat

  deployables = [
      new Deployable(files: files("""${rootProject.projectDir}\\build/libs/${applicationName}.war"""), context: """${glassfishApplicationName}""")
  ]
}

after contacting Payara support :

We reviewed the situation with the Cargo plugin, and the problem is that the Gradle version (the one you were using during the discussion on this ticket) is not supported by Codehaus directly, a third party developing the plugin independently. With the Maven version of the plugin we managed to get the deployment order working properly, but sadly we cannot do anything about the Gradle version. You will probably have to raise an issue on their Github page if you require the bug to be fixed.

So is it possible to do something about this?

THANKS

@bmuschko
Copy link
Owner

I doubt that the Payara meant to say "Gradle version". Gradle itself does not know anything about interacting with a Cargo. They likely meant the Cargo library version. Try to set the latest Cargo library version, as described here.

@morayKevin
Copy link
Author

Using the instructions in the documentation of the plugin, I was not able to find a way to specify the deployment order and make it persist.
Meanwhile, the Maven plugin for Cargo (Codehaus Cargo - Maven 3 Plugin) offers a way to specify a deployment order using the element in cargo.xml, by using the order attribute,

@bmuschko
Copy link
Owner

Can you give me a concrete example on how this achieved in the Maven plugin (optimally in XML)? I don't see anything about in the link you sent me.

@morayKevin
Copy link
Author

Here is an example configuration on how to configure the deployment order using the Maven plugin:

<plugin> 
    <groupId>org.codehaus.cargo</groupId> 
    <artifactId>cargo-maven3-plugin</artifactId> 
    <version>1.10.6</version> 
    <configuration> 
      <container> 
        <containerId>payara</containerId> 
        <artifactInstaller> 
          <groupId>fish.payara.distributions</groupId> 
          <artifactId>payara</artifactId> 
          <version>5.2022.5</version> 
        </artifactInstaller> 
      </container> 
    <configuration> 
      <deployables> 
        <deployable> 
          <grroupId>${project.groupId}</groupId> 
          <artifactId>${project.artifactId}</artifactId> 
          <type>war</type> 
          <order>1</order> 
        </deployable> 
        <deployable> 
          <groupId>${project.groupId}</groupId> 
          <artifactId>MavenCargoTest2</artifactId> 
          <type>war</type> 
          <order>2</order> 
        </deployable> 
      </deployables> 
      <home>C:\payara-server\_WORKDIR\5.48.1\payara5\glassfish\domains\</home> 
      <properties> 
        <cargo.hostname>localhost</cargo.hostname> 
        <cargo.servlet.port>8080</cargo.servlet.port> 
        <cargo.glassfish.admin.port>4848</cargo.glassfish.admin.port> 
        <cargo.remote.username>admin</cargo.remote.username> 
        <cargo.remote.password>adminadmin</cargo.remote.password> 
        <cargo.glassfish.deploy.arg.remoteUpload>--upload=true</cargo.glassfish.deploy.arg.remoteUpload> 
      </properties> 
    </configuration> 
  </configuration>
   
  <!-- provides JSR88 client API to deploy on Payara --> 
  <dependencies> 
    <dependency> 
      <groupId>org.glassfish.main.deployment</groupId> 
      <artifactId>deployment-client</artifactId> 
      <version>5.0</version> 
    </dependency> 
  </dependencies> 
</plugin>

I hope this helps!

@bmuschko
Copy link
Owner

bmuschko commented May 2, 2023

Thanks. The plugin uses the Cargo Ant tasks. I don't see anything in their documentation that would let you define a deployment order. You may want to ask on their mailing list.

Alternatively, you could probably set up individual CargoDeployRemote tasks, each of which deploys a single file. To produce the desired order, chain those task together with dependsOn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants