Skip to content
Snippets Groups Projects
Commit 989474bb authored by FAZELI SHAHROUDI Sepehr (INTERN)'s avatar FAZELI SHAHROUDI Sepehr (INTERN)
Browse files

Update: improve GitLab CI script with enhanced quoting and error handling for wiki deployment

parent bb08cefa
No related branches found
No related tags found
1 merge request!4Draft: Review Branch with all changes from main against empty
Pipeline #53377 failed
......@@ -11,11 +11,11 @@ build_pdf:
image: texlive/texlive:latest
script:
- mkdir -p output
- pdflatex -interaction=nonstopmode -output-directory=output ${Name}.tex
- pdflatex -interaction=nonstopmode -output-directory=output ${Name}.tex
- pdflatex -interaction=nonstopmode -output-directory=output "${Name}.tex"
- pdflatex -interaction=nonstopmode -output-directory=output "${Name}.tex"
artifacts:
paths:
- output/${Name}.pdf
- "output/${Name}.pdf"
convert_md:
stage: convert
......@@ -26,7 +26,7 @@ convert_md:
- mkdir -p output_md
- echo "Listing all .tex files:"
- find . -name "*.tex"
- |
- >
for texfile in $(find . -name "*.tex"); do
if [[ "$(basename "$texfile")" == "${Name}.tex" ]]; then
continue
......@@ -79,16 +79,19 @@ deploy_to_wiki:
- git config --global user.name "$GITLAB_USER"
- git config --global user.email "$GITLAB_EMAIL"
script:
- echo "Cloning the wiki repository"
- git clone https://$GITLAB_USER:$GITLAB_TOKEN@mygit.th-deg.de/${CI_PROJECT_PATH}.wiki.git wiki
- echo "Copying Markdown files to wiki"
- echo 'Cloning the wiki repository'
- git clone "https://$GITLAB_USER:$GITLAB_TOKEN@mygit.th-deg.de/${CI_PROJECT_PATH}.wiki.git" wiki
- echo 'Copying Markdown files to wiki'
- cp -r output_md/* wiki/
- cd wiki
- echo "Current directory: $(pwd)"
- echo "Listing files in wiki directory"
- echo 'Current directory: $(pwd)'
- echo 'Listing files in wiki directory'
- ls -la
- git add .
- git commit -m "Update Wiki with Thesis - $(date)"
- |
if ! git commit -m 'Update Wiki with Thesis - $(date)'; then
echo "No changes to commit."
fi
- git push
only:
- main
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment