Skip to content

#TESTING-DOTCLI Update. +2 #3

#TESTING-DOTCLI Update. +2

#TESTING-DOTCLI Update. +2 #3

Workflow file for this run

name: dotCMS sync
on: [push]
jobs:
dotcms-cli:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Instalar xmllint
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
- name: Get dotCLI latest version
id: dotcli-latest-runner
run: |
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)
echo "The dotCMS CLI latest version is $LATEST_VERSION"
echo URL="https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/dotcms-cli/${LATEST_VERSION}/dotcms-cli-${LATEST_VERSION}-runner.jar"
echo "url=$URL" >> "$GITHUB_OUTPUT"
sync-with-dotcms:
needs: dotcms-cli
runs-on: ubuntu-latest
env:
# Global environment expected by dotCMS CLI
# This is how we instruct the cli the target server
DOT_API_URL: ${{ vars.DOT_API_URL }}
# This is how we instruct the cli the target folder in the repo
# By default it must be the root of the repo this allows setting up a different folder on top of the root
DOT_REPO_BASE_PATH: ${{ vars.DOT_REPO_BASE_PATH }}
# 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 || needs.dotcli-latest-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: Print context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"