Loading generateChangemarks/.gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -91,10 +91,10 @@ pages: TAG_NAME: "upgrade" before_script: - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_on_pages%2Esh/raw?ref=master" >> publish_on_pages.sh curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_on_pages%2Esh/raw?ref=addDiffCR" >> publish_on_pages.sh - chmod +x publish_on_pages.sh - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/updateIndex%2Epy/raw?ref=master" >> updateIndex.py curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/updateIndex%2Epy/raw?ref=addDiffCR" >> updateIndex.py - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/index%2Ehtml/raw?ref=master" >> index.html - | Loading publish_on_pages.sh +22 −7 Original line number Diff line number Diff line Loading @@ -23,26 +23,41 @@ fi set -e echo "------ Get the previous GitLab Pages content --------" # Move all folders except the "baselines" folder if baselines folder exists if [ -d "public/baselines" ]; then echo "Baselines already moved to baselines/"; else mkdir -p "public/baselines" for folder in public/*; do if [ -d "$folder" ] && [ "$(basename "$folder")" != "baselines" ]; then mv "$folder" "public/baselines/" echo "Moved $(basename "$folder") to public/baselines" fi done # Move index.html with new location mv "public/index.html" "public/baselines/" fi echo "------ Add/update content --------" if [ $4 == 'upgrade' ]; then echo 'Upgrading index.html...' docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 -u "$7_$4" "$4/$7_$4.docx" "$5" elif [ $6 == 'true' ]; then echo 'Removing all web pages content...' rm -r public/*; mkdir -p "public/$4" echo 'Removing all baselines ...' rm -r public/baselines/*; mkdir -p "public/baselines/$4" ls public/ cp -r -f "$7_$4.docx" public/$4 cp -r -f "$7_$4.docx" public/baselines/$4 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 "$7_$4" "$4/$7_$4.docx" "$5" elif [ $6 == 'false' ]; then mkdir -p "public/$4" mkdir -p "public/baselines/$4" ls public/ cp -r -f "$7_$4.docx" public/$4 cp -r -f "$7_$4.docx" public/baselines/$4 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 "$7_$4" "$4/$7_$4.docx" "$5" else echo 'Removing entry for ' $6 rm -r -f public/$6 rm -r -f public/baselines/$6 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 -re "$7_$4" "$4/$7_$4.docx" "$5" fi Loading updateIndex.py +6 −10 Original line number Diff line number Diff line Loading @@ -12,12 +12,12 @@ import argparse, os def upgradeIndex(args: argparse.Namespace) -> None: # Check if index.htm exists if not os.path.exists('public/index.html'): if not os.path.exists('public/baselines/index.html'): print("'index.html' does not exist yet, Upgrade is not needed") exit() else: # Read the source HTML file with open('public/index.html', 'r', encoding='utf-8') as source_file: with open('public/baselines/index.html', 'r', encoding='utf-8') as source_file: source_html = source_file.read() # Read the destination HTML file Loading Loading @@ -46,26 +46,22 @@ def upgradeIndex(args: argparse.Namespace) -> None: exit(1) # Save the updated destination HTML with open('public/index.html', 'w', encoding='utf-8') as dest_updated_file: with open('public/baselines/index.html', 'w', encoding='utf-8') as dest_updated_file: dest_updated_file.write(str(dest_soup)) # Read index HTML with open('public/index.html', 'r', encoding='utf-8') as file: html_content = file.read() print("Index.html upgraded") def updateIndex(args:argparse.Namespace) -> None: # Check if index.htm exists if not os.path.exists('public/index.html'): if not os.path.exists('public/baselines/index.html'): print("'index.html' does not exist yet, using template") with open(args.indexTemplate, 'r', encoding='utf-8') as file: html_content = file.read() else: # Read index HTML with open('public/index.html', 'r', encoding='utf-8') as file: with open('public/baselines/index.html', 'r', encoding='utf-8') as file: html_content = file.read() # Analyze index content with BeautifulSoup Loading Loading @@ -97,7 +93,7 @@ def updateIndex(args:argparse.Namespace) -> None: document_list.append(li) # Save the updated index.html file with open('public/index.html', 'w', encoding='utf-8') as file: with open('public/baselines/index.html', 'w', encoding='utf-8') as file: file.write(str(soup)) print("Index.html updated") Loading Loading
generateChangemarks/.gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -91,10 +91,10 @@ pages: TAG_NAME: "upgrade" before_script: - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_on_pages%2Esh/raw?ref=master" >> publish_on_pages.sh curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/publish_on_pages%2Esh/raw?ref=addDiffCR" >> publish_on_pages.sh - chmod +x publish_on_pages.sh - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/updateIndex%2Epy/raw?ref=master" >> updateIndex.py curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/updateIndex%2Epy/raw?ref=addDiffCR" >> updateIndex.py - | curl "${CI_API_V4_URL}/projects/$TOOLS_SCRIPTS_PROJECT_ID/repository/files/index%2Ehtml/raw?ref=master" >> index.html - | Loading
publish_on_pages.sh +22 −7 Original line number Diff line number Diff line Loading @@ -23,26 +23,41 @@ fi set -e echo "------ Get the previous GitLab Pages content --------" # Move all folders except the "baselines" folder if baselines folder exists if [ -d "public/baselines" ]; then echo "Baselines already moved to baselines/"; else mkdir -p "public/baselines" for folder in public/*; do if [ -d "$folder" ] && [ "$(basename "$folder")" != "baselines" ]; then mv "$folder" "public/baselines/" echo "Moved $(basename "$folder") to public/baselines" fi done # Move index.html with new location mv "public/index.html" "public/baselines/" fi echo "------ Add/update content --------" if [ $4 == 'upgrade' ]; then echo 'Upgrading index.html...' docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 -u "$7_$4" "$4/$7_$4.docx" "$5" elif [ $6 == 'true' ]; then echo 'Removing all web pages content...' rm -r public/*; mkdir -p "public/$4" echo 'Removing all baselines ...' rm -r public/baselines/*; mkdir -p "public/baselines/$4" ls public/ cp -r -f "$7_$4.docx" public/$4 cp -r -f "$7_$4.docx" public/baselines/$4 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 "$7_$4" "$4/$7_$4.docx" "$5" elif [ $6 == 'false' ]; then mkdir -p "public/$4" mkdir -p "public/baselines/$4" ls public/ cp -r -f "$7_$4.docx" public/$4 cp -r -f "$7_$4.docx" public/baselines/$4 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 "$7_$4" "$4/$7_$4.docx" "$5" else echo 'Removing entry for ' $6 rm -r -f public/$6 rm -r -f public/baselines/$6 docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 -re "$7_$4" "$4/$7_$4.docx" "$5" fi Loading
updateIndex.py +6 −10 Original line number Diff line number Diff line Loading @@ -12,12 +12,12 @@ import argparse, os def upgradeIndex(args: argparse.Namespace) -> None: # Check if index.htm exists if not os.path.exists('public/index.html'): if not os.path.exists('public/baselines/index.html'): print("'index.html' does not exist yet, Upgrade is not needed") exit() else: # Read the source HTML file with open('public/index.html', 'r', encoding='utf-8') as source_file: with open('public/baselines/index.html', 'r', encoding='utf-8') as source_file: source_html = source_file.read() # Read the destination HTML file Loading Loading @@ -46,26 +46,22 @@ def upgradeIndex(args: argparse.Namespace) -> None: exit(1) # Save the updated destination HTML with open('public/index.html', 'w', encoding='utf-8') as dest_updated_file: with open('public/baselines/index.html', 'w', encoding='utf-8') as dest_updated_file: dest_updated_file.write(str(dest_soup)) # Read index HTML with open('public/index.html', 'r', encoding='utf-8') as file: html_content = file.read() print("Index.html upgraded") def updateIndex(args:argparse.Namespace) -> None: # Check if index.htm exists if not os.path.exists('public/index.html'): if not os.path.exists('public/baselines/index.html'): print("'index.html' does not exist yet, using template") with open(args.indexTemplate, 'r', encoding='utf-8') as file: html_content = file.read() else: # Read index HTML with open('public/index.html', 'r', encoding='utf-8') as file: with open('public/baselines/index.html', 'r', encoding='utf-8') as file: html_content = file.read() # Analyze index content with BeautifulSoup Loading Loading @@ -97,7 +93,7 @@ def updateIndex(args:argparse.Namespace) -> None: document_list.append(li) # Save the updated index.html file with open('public/index.html', 'w', encoding='utf-8') as file: with open('public/baselines/index.html', 'w', encoding='utf-8') as file: file.write(str(soup)) print("Index.html updated") Loading