-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.89 KB
/
dotcli-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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"