diff --git a/publish_on_pages.sh b/publish_on_pages.sh index f05dbe4ffa98947ce37ad9b4babb60c7b5358742..6bbd9ec39fb60429baf5877377e7e1ee49098a82 100644 --- a/publish_on_pages.sh +++ b/publish_on_pages.sh @@ -1,6 +1,6 @@ #!/bin/bash -DOCKER_IMAGE=python:3.9-slim-bullseye +DOCKER_IMAGE=logiqx/python-bs4:3.9-slim echo "\n------ Checking for docker image --------" docker pull "$DOCKER_IMAGE" @@ -22,10 +22,12 @@ else fi set -e +echo "------ Get the previous GitLab Pages content --------" + echo "------ Add/update content --------" if [ $4 == 'upgrade' ]; then echo 'Upgrading index.html...' - docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 -u "$7_$4" "$4/$7_$4.docx" "$5" + 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/*; @@ -33,11 +35,11 @@ elif [ $6 == 'false' ]; then mkdir -p "public/$4" ls public/ cp -r -f "$7_$4.docx" public/$4 - docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" /bin/bash -c 'pip install bs4; python3 $1 "$7_$4" "$4/$7_$4.docx" "$5"' + 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 - docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" pip install bs4 && python3 $1 -re "$7_$4" "$4/$7_$4.docx" "$5" + docker run --rm -v $(pwd):/tmp -w /tmp "$DOCKER_IMAGE" python3 $1 -re "$7_$4" "$4/$7_$4.docx" "$5" fi echo "------ Zip the content and publish the zip again ------"