Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing step output naming and run command args order. #26718

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tools/dotcms-cli/action/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Create workspace if not exists
id: dot-workspace
run: |
run: |
if [ ${{ env.DOT_CREATE_WORKSPACE }} = true ]; then
echo "Creating workspace ::: "
chmod +x ./.github/workflows/scripts/workspace.sh
Expand Down Expand Up @@ -102,6 +102,7 @@ jobs:
PUSH_OPTIONS["removeFolders"] = os.getenv("DOT_CLI_REMOVE_FOLDERS")
PUSH_OPTIONS["removeLanguages"] = os.getenv("DOT_CLI_REMOVE_LANGUAGES")
PUSH_OPTIONS["removeSites"] = os.getenv("DOT_CLI_REMOVE_SITES")
PUSH_OPTIONS["errors"] = os.getenv("DOT_CLI_ERRORS")

COMMAND_PUSH_OPTS = "";

Expand All @@ -110,8 +111,8 @@ jobs:
if value.lower() == "true":
COMMAND_PUSH_OPTS=f"{COMMAND_PUSH_OPTS} --{key}"
elif value.lower() != "false":
COMMAND_PUSH_OPTS=f"{COMMAND_PUSH_OPTS} --{key}={value}"

COMMAND_PUSH_OPTS=f"{COMMAND_PUSH_OPTS} --{key} {value}"
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f 'COMMAND_PUSH_OPTS={COMMAND_PUSH_OPTS}', file=f)

Expand All @@ -124,11 +125,11 @@ jobs:
chmod +x ./.github/workflows/scripts/run-push.sh
source ./.github/workflows/scripts/run-push.sh
install_cli "${{env.DOT_CLI_JAR_DOWNLOAD_URL}}" "${{env.DOT_FORCE_DOWNLOAD}}" "${{env.DOT_API_URL}}"
run_cli_push "${{github.workspace}}${{env.DOT_REPO_BASE_PATH}}" "${{ steps.options.outputs.COMMAND_PUSH_OPTS }}" "${{ secrets.DOT_TOKEN }}"
run_cli_push "${{github.workspace}}${{env.DOT_REPO_BASE_PATH}}" "${{ secrets.DOT_TOKEN }}" "${{ steps.options.outputs.command_opts }}"
echo "exit-code=$exit_code" >> "$GITHUB_OUTPUT"
print_log
if [ $exit_code -ne 0 ]; then
echo "Error running dotCMS CLI"
exit 1
fi
shell: bash
shell: bash
12 changes: 6 additions & 6 deletions tools/dotcms-cli/action/.github/workflows/scripts/run-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ print_log(){

_run_cli_push(){
workspace_path=$1
push_opts=$2
token=$3
token=$2
push_opts=$3

#These environment vars are expected by the start-up script
export JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
Expand All @@ -96,7 +96,7 @@ _run_cli_push(){
export JAVA_APP_NAME="dotcms-cli"
# Log file
export QUARKUS_LOG_FILE_PATH="$DOT_CLI_HOME"dotcms-cli.log
bash /tmp/dot-cli/run-java.sh "push" "$workspace_path" "$push_opts" "--token" "$token" "--errors"
bash /tmp/dot-cli/run-java.sh push "$workspace_path" --token="$token" $push_opts
export exit_code=$?
echo $exit_code
}
Expand All @@ -114,8 +114,8 @@ install_cli(){

run_cli_push(){
workspace_path=$1
opts=$2
token=$3
return_code=$(_run_cli_push "$workspace_path" "$opts" "$token")
token=$2
push_opts=$3
return_code=$(_run_cli_push "$workspace_path" "$token" "$push_opts")
echo "$return_code"
}