diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..d41bc952ce7519d91f276cd26fd0399a6368b186 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +image: registry.gitlab.com/othermo/fedora-build:latest + +before_script: + - git config --global user.email "info@othermo.de" + - git config --global user.name "Othermo CI" + - podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + +build-master: + script: + - podman pull $CI_REGISTRY_IMAGE:latest || true + - podman build --layers=false --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG --tag $CI_REGISTRY_IMAGE:latest . + - podman push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + - podman push $CI_REGISTRY_IMAGE:latest + only: + # this build script would conflict with other branches + - master + tags: + - aarch64 + +build: + script: + - podman pull $CI_REGISTRY_IMAGE:latest || true + - podman build --layers=false --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . + - podman push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + except: + # this build script would conflict with other branches + - master + tags: + - aarch64 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b604668f538bac474b26fcbd31f44a858d5d2250 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM docker.io/library/fedora:31 + +COPY pi-mqtt-gpio/ /var/srv/pi-mqtt-gpio/ + +WORKDIR /var/srv/pi-mqtt-gpio + +RUN dnf install -y libgpiod libgpiod-devel libgpiod-c++ python3-libgpiod python3-pip && \ + pip install -r /var/srv/pi-mqtt-gpio/requirements.txt && \ + dnf remove -y python3-pip && \ + dnf clean all + +CMD [ "/usr/bin/python3", "-m", "pi_mqtt_gpio.server", "config.yml" ] \ No newline at end of file diff --git a/README.md b/README.md index 583da46a0d525cf722f80e7a87c97db4f8941138..ea684a6645b03705f8a391ab5e94a16ba1285dd6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # mqtt-gpio-container -Containerized version of the mqtt-gpio project. \ No newline at end of file +Containerized version of the mqtt-gpio project.