From 11ec0c517b29b40949911c8b31ee770232a0f98c Mon Sep 17 00:00:00 2001 From: Markus Weigelt Date: Thu, 21 Nov 2024 15:49:25 +0100 Subject: [PATCH] Fix codacy yaml --- .github/scripts/test-image.sh | 2 +- Docker/README.md | 68 ++++++++++++++++++----------------- Docker/docker-compose.yml | 1 + 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.github/scripts/test-image.sh b/.github/scripts/test-image.sh index a572da97..24aa9686 100644 --- a/.github/scripts/test-image.sh +++ b/.github/scripts/test-image.sh @@ -12,7 +12,7 @@ sleep 60 # testing the container HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" localhost); -if [ $HTTP_CODE -ne 200 ]; then +if [ "$HTTP_CODE" -ne 200 ]; then echo "Expected HTTP status code to be 200, but got $HTTP_CODE" exit 1 fi diff --git a/Docker/README.md b/Docker/README.md index f4228c90..cd331768 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -1,9 +1,9 @@ # DFG-Viewer Docker - * [Prerequisites](#prerequisites) - * [Usage](#usage) - * [Development](#development) - * [Further information](#further-information) +* [Prerequisites](#prerequisites) +* [Usage](#usage) +* [Development](#development) +* [Further information](#further-information) ## Prerequisites @@ -22,7 +22,7 @@ Copy the environment file `.env.example` inside the directory and rename it to ` *It is recommended to adjust the password of the TYPO3 admin user `APP_T3_PASSWORD`, the database password `DB_PASSWORD` in general, especially in an productive environment.* Download images and start all service containers -``` +```bash docker compose up -d ``` @@ -33,12 +33,12 @@ The DFG Viewer instance can then be accessed under `localhost`. *When running `docker compose up` all services e.g. DFG-Viewer (APP) and database (DB) in our `docker-compose.yml` will be started and each as separate Docker container. * Stops all service containers -``` +```bash docker compose stop ``` Stops and remove all service containers -``` +```bash docker compose down ``` @@ -46,13 +46,13 @@ docker compose down To build the image, a `build` folder with a subfolder `extension` must be added. -``` +```bash mkdir -p build/extensions ``` Then, the three extension repositories, [DFG Viewer](https://github.com/slub/dfg-viewer), [Kitodo.Presentation](https://github.com/kitodo/kitodo-presentation), [SLUB Digital Collections](https://github.com/slub/slub_digitalcollections), must be cloned into this folder. -``` +```bash git clone https://github.com/slub/dfg-viewer build/extensions git clone https://github.com/kitodo/kitodo-presentation build/extensions git clone https://github.com/slub/slub_digitalcollections build/extensions @@ -62,7 +62,7 @@ Adjust the `composer.json` files of the checkouts as follows. `composer.json` of the [DFG Viewer](https://github.com/slub/dfg-viewer) checkout `build/extensions/dfg-viewer`: -``` +```json ... "require": { ... @@ -75,7 +75,7 @@ Adjust the `composer.json` files of the checkouts as follows. `composer.json` of the [SLUB Digital Collections](https://github.com/slub/slub_digitalcollections) checkout `build/extensions/slub_digitalcollections`: -``` +```json ... "require": { ... @@ -89,7 +89,9 @@ Build the image. *Ensure that the `.env` file has been created. It is recommended to adjust the password of the TYPO3 admin user `APP_T3_PASSWORD`, the database password `DB_PASSWORD` in general and the `APP_IMAGE` name for building custom images in `.env` file.* -`docker compose build dfg-viewer-app` +```bash +docker compose build dfg-viewer-app +``` ## Further information @@ -101,42 +103,42 @@ Once all containers have been started (see [Usage](#usage)), you can continue as 1. Login into `dfg-viewer-app-1` container as root user. -`` -docker exec -u root -it dfg-viewer-app-1 bash -`` + ```bash + docker exec -u root -it dfg-viewer-app-1 bash + ``` 2. Install unzip command line tool. -`` -apt-get update && apt-get install unzip -`` + ```bash + apt-get update && apt-get install unzip + ``` 3. Download the current state of main branch of repository [3D viewer integrations for DFG-Viewer](https://github.com/slub/dlf-3d-viewers) as zip file -`` -wget "https://github.com/slub/dlf-3d-viewers/archive/refs/heads/main.zip" -O /tmp/dlf-3d-viewers.zip -`` + ```bash + wget "https://github.com/slub/dlf-3d-viewers/archive/refs/heads/main.zip" -O /tmp/dlf-3d-viewers.zip + ``` 4. Navigate to `fileadmin` folder, unzip the zip file, rename unzipped folder to `dlf_3d_viewers` and remove zip file -``` -cd /var/www/html/dfg-viewer/public/fileadmin + ```bash + cd /var/www/html/dfg-viewer/public/fileadmin -unzip /tmp/dlf-3d-viewers.zip + unzip /tmp/dlf-3d-viewers.zip -mv dlf-3d-viewers-main dlf_3d_viewers + mv dlf-3d-viewers-main dlf_3d_viewers -rm /tmp/dlf-3d-viewers.zip -``` + rm /tmp/dlf-3d-viewers.zip + ``` 5. Download libraries and frameworks for each viewer integration -`` -sh dlf_3d_viewers/install.sh -`` + ```bash + sh dlf_3d_viewers/install.sh + ``` 6. Change owner of integration folder, subfolder and files -`` -chown -R www-data:www-data dlf_3d_viewers -`` + ```bash + chown -R www-data:www-data dlf_3d_viewers + ``` diff --git a/Docker/docker-compose.yml b/Docker/docker-compose.yml index 4567857c..c3917dcd 100644 --- a/Docker/docker-compose.yml +++ b/Docker/docker-compose.yml @@ -1,6 +1,7 @@ services: app: image: ${APP_IMAGE} + pull_policy: always build: context: build environment: