dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
857 stars 467 forks source link

CLI - deployed cli jar getting corrupted #28917

Closed spbolton closed 2 months ago

spbolton commented 4 months ago

In cli-release-process.yml we have a step to download all the artifacts from the 3 separate builds. The native builds include their unique naming based upon the architecture, but each of the 3 builds creates its own dotcms-cli-{version}-runner.jar. The configuration of actions/download-artifact will download the artifacts to the same folder and it seems this is causing corruption of the file in the destination.

We should not use the merge-multiple feature here and have it create separate folders for each set of build artifacts, jreleaser and other code can then pick a specific artifact for or use dotcms-cli-{version}-runner.jar can just pick the default linux build or a glob pattern to find what is needed from with the subfolders for the native files.

wget https://github.com/dotCMS/core/releases/download/dotcms-cli-24.06.17/dotcms-cli-24.06.17.jar
java -jar dotcms-cli-24.06.17.jar
Error: Invalid or corrupt jarfile dotcms-cli-24.06.17.jar
- name: 'Download all build artifacts'
        uses: actions/download-artifact@v4
        with:
          path: ${{ github.workspace }}/artifacts
          pattern: artifacts-*
          merge-multiple: true

This may have been failing since we changed to use v4 version of actions/download-artifact

Note: we currently have no automated testing of the final deployed artifacts that would pick this up. One way to rectify this would be to deploy artifacts in the initial build to a non-public repo used in the build and test against these artifacts, promoting them when approved.

fabrizzio-dotCMS commented 3 months ago

The runner jar can be downloaded and executed if grabbed from artifactory https://repo.dotcms.com/ui/native/libs-release-local/com/dotcms/dotcms-cli/24.07.05/ However, the jar isn't available on github https://github.com/dotCMS/core/releases/tag/dotcms-cli-24.07.05 therefore the ticket still needs work

fabrizzio-dotCMS commented 2 months ago

I can confirm that the latest release generated herehttps://github.com/dotCMS/core/releases/tag/dotcms-cli-24.07.19 now has a functional jar dotcms-cli-24.07.19-runner.jar

bryanboza commented 2 months ago

Fixed, tested on trunk // latest CLI