#TESTING-DOTCLI Update. #1
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
name: dotCMS sync | |
on: [push] | |
jobs: | |
dotcms-cli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get dotCLI latest version | |
id: dotcli-latest-runner | |
run: | | |
curl -o "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" | |