diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1ac5c1..d7c0024 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,9 @@ image: docker:stable +stages: + - test + - build + services: - docker:dind @@ -9,6 +13,74 @@ variables: before_script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY +linting: + stage: test + image: hadolint/hadolint:latest-alpine + before_script: + - '' + script: + - hadolint --failure-threshold error Dockerfile.* + +test-debian: + stage: test + script: + - docker pull $IMAGE_BASE/debian || true + - docker build --cache-from $IMAGE_BASE/debian --tag $IMAGE_BASE/debian:$CI_COMMIT_SHA --tag $IMAGE_BASE/debian:latest -f Dockerfile.debian . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.debian + +test-ubuntu: + stage: test + script: + - docker pull $IMAGE_BASE/ubuntu || true + - docker build --cache-from $IMAGE_BASE/ubuntu --tag $IMAGE_BASE/ubuntu:$CI_COMMIT_SHA --tag $IMAGE_BASE/ubuntu:latest -f Dockerfile.ubuntu . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.ubuntu + +test-fedora: + stage: test + script: + - docker pull $IMAGE_BASE/fedora || true + - docker build --cache-from $IMAGE_BASE/fedora --tag $IMAGE_BASE/fedora:$CI_COMMIT_SHA --tag $IMAGE_BASE/fedora:latest -f Dockerfile.fedora . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.fedora + +test-arch: + stage: test + script: + - docker pull $IMAGE_BASE/arch || true + - docker build --cache-from $IMAGE_BASE/arch --tag $IMAGE_BASE/arch:$CI_COMMIT_SHA --tag $IMAGE_BASE/arch:latest -f Dockerfile.arch . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.arch + +test-angular: + stage: test + script: + - docker pull $IMAGE_BASE/angular || true + - docker build --cache-from $IMAGE_BASE/angular --tag $IMAGE_BASE/angular:$CI_COMMIT_SHA --tag $IMAGE_BASE/angular:latest -f Dockerfile.angular . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.angular + +test-documentation: + stage: test + script: + - docker pull $IMAGE_BASE/documentation || true + - docker build --cache-from $IMAGE_BASE/documentation --tag $IMAGE_BASE/documentation:$CI_COMMIT_SHA --tag $IMAGE_BASE/documentation:latest -f Dockerfile.documentation . + rules: + - if: $CI_COMMIT_BRANCH != "master" && $CI_PROJECT_PATH_SLUG != "openlp/runners" + changes: + - Dockerfile.documentation + build-debian: stage: build script: diff --git a/Dockerfile.arch b/Dockerfile.arch index ac69807..83d21a2 100644 --- a/Dockerfile.arch +++ b/Dockerfile.arch @@ -1,4 +1,4 @@ -FROM archlinux:base-20230514.0.150299 +FROM archlinux:base-20240101.0.204074 ENV LANG C.UTF-8 RUN pacman -Syyu --noconfirm git python qt5-multimedia qt5-svg qt5-webengine qt5-webchannel qt5-tools python-pyqt5 \ @@ -8,4 +8,4 @@ RUN pacman -Syyu --noconfirm git python qt5-multimedia qt5-svg qt5-webengine qt5 python-qtawesome python-opengl python-platformdirs python-zeroconf python-distro python-pyicu \ python-pytest-qt python-qrcode python-pymupdf python-flask python-flask-cors pyalpm \ python-pillow awk fakeroot flake8 mediainfo patch xorg-server-xvfb -RUN pip install python-vlc pysword +RUN pip install python-vlc pysword --break-system-packages diff --git a/Dockerfile.debian b/Dockerfile.debian index d5c2827..e92da23 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -10,7 +10,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive \ python3-flake8 python3-flask python3-flask-cors python3-distro flake8 mediainfo xvfb \ python3-pytestqt python3-paramiko twine python3-fitz python3-pyro4 python3-qrcode python3-icu \ python3-pyodbc -ADD fixpaths.py /usr/bin/fixpaths +COPY fixpaths.py /usr/bin/fixpaths RUN chmod a+x /usr/bin/fixpaths -ADD uploadversion.py /usr/bin/uploadversion +COPY uploadversion.py /usr/bin/uploadversion RUN chmod a+x /usr/bin/uploadversion