Commit 0048494f authored by Christian Rohlfing's avatar Christian Rohlfing
Browse files

Merge branch 'master' into ad_iss8

parents 49e0a27c a270e80b
Pipeline #456453 failed with stage
in 1 minute and 48 seconds
......@@ -11,9 +11,6 @@ variables:
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_HOST: tcp://docker:2376 # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
build:
stage: build
script:
......@@ -25,6 +22,8 @@ build:
- docker push ${CI_REGISTRY_IMAGE}:latest
only:
- master
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
test:
stage: test
......@@ -34,3 +33,19 @@ test:
artifacts:
paths:
- out/
test-coverage:
image:
name: ${CI_REGISTRY_IMAGE}:latest
entrypoint: [""]
stage: test
script:
- pip3 install pytest pytest-cov
- cd /app
- python3 -m pytest --cov=./ tests
- python3 -m coverage xml -o reports/coverage.xml
artifacts:
paths:
- reports/coverage.xml
reports:
cobertura: reports/coverage.xml
......@@ -14,6 +14,7 @@ RUN apt-get update \
wget \
libmagickwand-dev \
ghostscript \
libzbar0 \
python3-pip \
python3-setuptools \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
......@@ -34,11 +35,11 @@ RUN useradd -m friendlyscanner
USER friendlyscanner
# Copy all files
COPY . /app
COPY --chown=friendlyscanner . /app
WORKDIR /app
# Entrypoint is python
ENTRYPOINT ["python3"]
# Standard command is batch.py
CMD ["./batch.py", "--help"]
\ No newline at end of file
CMD ["./batch.py", "--help"]
......@@ -16,8 +16,8 @@ If you want to use only a subset (or one) of the scripts, you can find it [here]
Exemplary outputs can be downloaded:
* [moodle_feedbacks.zip](https://git.rwth-aachen.de/IENT/exam-scan/-/jobs/artifacts/master/raw/out/moodle_feedbacks.zip?job=test): The zip-Archive to be uploaded to Moodle containing the watermarked and encrypted PDFs for each student.
* [passwords.csv](https://git.rwth-aachen.de/IENT/exam-scan/-/jobs/artifacts/master/raw/out/passwords.csv?job=test): CSV file containing passwords for each PDF.
* [moodle_feedbacks.zip](https://git.rwth-aachen.de/rwthmoodle/exam-scan/-/jobs/artifacts/master/raw/out/moodle_feedbacks.zip?job=test): The zip-Archive to be uploaded to Moodle containing the watermarked and encrypted PDFs for each student.
* [passwords.csv](https://git.rwth-aachen.de/rwthmoodle/exam-scan/-/jobs/artifacts/master/raw/out/passwords.csv?job=test): CSV file containing passwords for each PDF.
## Instructions
......@@ -72,10 +72,17 @@ Exemplary outputs can be downloaded:
### Docker
If you are an experienced user familiar with Docker, you can use the provided `Dockerfile` to easily run the scripts.
Either use the already built image
```bash
docker run --name='examscan' --rm -v $(pwd):$(pwd) -w $(pwd) registry.git.rwth-aachen.de/rwthmoodle/exam-scan:master batch.py --help
```
or build the Dockerfile yourself locally
```bash
docker build -t examscan:latest .
docker run --name examscan --rm -v $(pwd):$(pwd) -w $(pwd) examscan:latest
docker run --name examscan --rm -v $(pwd):$(pwd) -w $(pwd) examscan:latest batch.py --help
```
## Scripts and how to run them
......
......@@ -2,4 +2,5 @@ Wand==0.6.5
Pillow==8.1.0
PyPDF2==1.26.0
pwgen==0.8.2.post0
pikepdf==2.5.0
\ No newline at end of file
pikepdf==2.5.0
pyzbar==0.1.8
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment