-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### Proposed Changes * A new job is included in the dotCLI GitHub Actions workflow example that calculates the latest available version of the dotcli runner. This ensures we always point to the most recent version of the jar without hardcoding any particular version. ### Additional Info Related to #30276 (Automate CLI Version Update for Agile Releases).
- Loading branch information
Showing
1 changed file
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,33 @@ name: dotCMS sync | |
on: [push] | ||
|
||
jobs: | ||
|
||
dotcli-runner: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
url: ${{ steps.dotcli-runner.outputs.url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install xmllint | ||
run: sudo apt-get update && sudo apt-get install -y libxml2-utils | ||
|
||
- name: Get dotCLI runner | ||
id: dotcli-runner | ||
run: | | ||
echo "::group::Get dotCLI runner" | ||
curl -o maven-metadata.xml "https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/dotcms-cli/maven-metadata.xml" | ||
LATEST_VERSION=$(xmllint --xpath "string(//versioning/latest)" maven-metadata.xml) | ||
URL="https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/dotcms-cli/${LATEST_VERSION}/dotcms-cli-${LATEST_VERSION}-runner.jar" | ||
|
||
echo "::notice::DOTCLI RUNNER: $URL" | ||
echo "url=$URL" >> "$GITHUB_OUTPUT" | ||
echo "::endgroup::" | ||
|
||
sync-with-dotcms: | ||
needs: dotcli-runner | ||
runs-on: ubuntu-latest | ||
env: | ||
# Global environment expected by dotCMS CLI | ||
|
@@ -15,15 +41,12 @@ jobs: | |
# This is how we instruct the cli to create the workspace if it does not exist | ||
DOT_CREATE_WORKSPACE: ${{ vars.DOT_CREATE_WORKSPACE || 'true' }} | ||
# This is the CLI version to use, but we can always override this value | ||
DOT_CLI_JAR_DOWNLOAD_URL: ${{ vars.DOT_CLI_JAR_DOWNLOAD_URL || 'https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/dotcms-cli/24.10.02/dotcms-cli-24.10.02-runner.jar' }} | ||
DOT_CLI_JAR_DOWNLOAD_URL: ${{ vars.DOT_CLI_JAR_DOWNLOAD_URL || needs.dotcli-runner.outputs.url }} | ||
# In case we want to force the download of the CLI jar | ||
DOT_FORCE_DOWNLOAD: ${{ vars.DOT_FORCE_DOWNLOAD || 'false' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
id: checkout | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Load .env file | ||
uses: aarcangeli/[email protected] | ||
|