From 4f8610f3ce9bb29c3ce7d22379eab32fe8045a99 Mon Sep 17 00:00:00 2001 From: suchitra Date: Tue, 23 Apr 2024 16:53:53 +0100 Subject: [PATCH 1/2] modified batch script to sent json files to s3 before zipping --- build_robohelp_gh.bat | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index 768ee9446..19f9418f3 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -1,4 +1,5 @@ @echo off +setlocal enabledelayedexpansion rem experimental build if "%WORKSPACE%" == "" set WORKSPACE=%GITHUB_WORKSPACE% if "%BUILD_NUMBER%" == "" set BUILD_NUMBER=999 @@ -89,5 +90,28 @@ type "%basedir%SupportFiles\layout_fix_append.css" >> "%DESTDIR%\RoboHelp\templa @REM rem ************************************************** ZIP up the output pushd %DESTDIR%\RoboHelp + +rem Use git command to get symbolic ref for remote origin/HEAD +for /f "delims=" %%A in ('git symbolic-ref refs/remotes/origin/HEAD 2^>nul') do ( + set "symbolic_ref=%%A" +) +rem If symbolic_ref variable is set (i.e., command was successful) + if /I "!branch_name!"=="develop" ( + echo Branch is develop - Choose BETA + aws s3 cp helpdocs_keywords.json s3://manual-json-files/Beta/helpdocs_keywords.json + aws s3 cp helpdocs_tags.json s3://manual-json-files/Beta/helpdocs_tags.json + ) else if /I "!branch_name!"=="main-lts" ( + echo Branch is main-lts - Choose LTS + aws s3 cp helpdocs_keywords.json s3://manual-json-files/LTS/helpdocs_keywords.json + aws s3 cp helpdocs_tags.json s3://manual-json-files/LTS/helpdocs_tags.json + ) else ( + echo Branch is not develop or main-lts - Choose GREEN + aws s3 cp helpdocs_keywords.json s3://manual-json-files/Green/helpdocs_keywords.json + aws s3 cp helpdocs_tags.json s3://manual-json-files/Green/helpdocs_tags.json + ) +) else ( + echo Error: Unable to retrieve symbolic ref for remote origin/HEAD +) + 7z a YoYoStudioRoboHelp.zip . -r popd From 2f82a55ba7365036616a1ddab742f77cdbb630f9 Mon Sep 17 00:00:00 2001 From: suchitra Date: Tue, 23 Apr 2024 16:55:25 +0100 Subject: [PATCH 2/2] Revert "modified batch script to sent json files to s3 before zipping" This reverts commit 4f8610f3ce9bb29c3ce7d22379eab32fe8045a99. --- build_robohelp_gh.bat | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/build_robohelp_gh.bat b/build_robohelp_gh.bat index 19f9418f3..768ee9446 100644 --- a/build_robohelp_gh.bat +++ b/build_robohelp_gh.bat @@ -1,5 +1,4 @@ @echo off -setlocal enabledelayedexpansion rem experimental build if "%WORKSPACE%" == "" set WORKSPACE=%GITHUB_WORKSPACE% if "%BUILD_NUMBER%" == "" set BUILD_NUMBER=999 @@ -90,28 +89,5 @@ type "%basedir%SupportFiles\layout_fix_append.css" >> "%DESTDIR%\RoboHelp\templa @REM rem ************************************************** ZIP up the output pushd %DESTDIR%\RoboHelp - -rem Use git command to get symbolic ref for remote origin/HEAD -for /f "delims=" %%A in ('git symbolic-ref refs/remotes/origin/HEAD 2^>nul') do ( - set "symbolic_ref=%%A" -) -rem If symbolic_ref variable is set (i.e., command was successful) - if /I "!branch_name!"=="develop" ( - echo Branch is develop - Choose BETA - aws s3 cp helpdocs_keywords.json s3://manual-json-files/Beta/helpdocs_keywords.json - aws s3 cp helpdocs_tags.json s3://manual-json-files/Beta/helpdocs_tags.json - ) else if /I "!branch_name!"=="main-lts" ( - echo Branch is main-lts - Choose LTS - aws s3 cp helpdocs_keywords.json s3://manual-json-files/LTS/helpdocs_keywords.json - aws s3 cp helpdocs_tags.json s3://manual-json-files/LTS/helpdocs_tags.json - ) else ( - echo Branch is not develop or main-lts - Choose GREEN - aws s3 cp helpdocs_keywords.json s3://manual-json-files/Green/helpdocs_keywords.json - aws s3 cp helpdocs_tags.json s3://manual-json-files/Green/helpdocs_tags.json - ) -) else ( - echo Error: Unable to retrieve symbolic ref for remote origin/HEAD -) - 7z a YoYoStudioRoboHelp.zip . -r popd