Skip to content
Snippets Groups Projects
Commit eed38af3 authored by Kay Effenberger's avatar Kay Effenberger
Browse files

FIX(gitlab-ci)

parent 11b9f748
No related branches found
No related tags found
1 merge request!7FEAT(multi-arch): add support for multi arch
Pipeline #2719 passed
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
image: docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_TLS_CERTDIR: ""
stages:
- test
......@@ -33,6 +35,7 @@ run_test_cases:
junit: report.xml
check_coverage:
image: python:3.9
stage: test
needs: ["run_test_cases"]
before_script:
......@@ -48,6 +51,7 @@ check_coverage:
path: coverage.xml
check_style:
image: python:3.9
stage: test
needs: ["run_test_cases"]
before_script:
......@@ -59,29 +63,28 @@ check_style:
docker-push:
# Use the docker image with buildx support for multi arch.
image: jonoh/docker-buildx-qemu
image: jdrouet/docker-with-buildx:20.10.21-0.9.1
stage: release
variables:
# the name of the image without version
AURA_IMAGE_NAME: "autoradio/engine-recorder"
services:
- docker:dind
- docker:20.10.21-dind
before_script:
# default repo is docker.io (aka docker hub)
- docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
- docker buildx create --driver docker-container --use
- docker buildx inspect --bootstrap
- docker buildx create --use
script:
# Important: Ensures execution of other binary formats is enabled in the kernel
- update-binfmts --enable
# every commit on main branch should build image as unstable
# else it is from a tag (enforced by gitlab-ci rules)
# hint: tags are references independent of branches
- |
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
then docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable --push.
else docker buildx build --platform linux/arm/v6,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG --push.
then docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME:unstable .
else docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
fi
- docker push "$AURA_IMAGE_NAME" --all-tags
rules:
# - *release-rules
- if: $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
......
......@@ -3,20 +3,22 @@ FROM python:3.9-slim
LABEL maintainer="Loxbie <ole@freirad.at>"
# System Dependencies
RUN apt-get update && apt-get -y install \
apt-utils \
alsa-utils \
build-essential \
ffmpeg \
rsync
rsync \
libffi-dev \
libssl-dev \
cargo \
pkg-config
RUN pip install poetry
# Setup Engine-Recorder
RUN mkdir -p /srv
WORKDIR /srv
RUN mkdir -p /srv/src
RUN mkdir -p /srv/config
RUN mkdir -p /srv/log
......@@ -24,16 +26,17 @@ RUN mkdir -p /var/audio/recordings/block
COPY poetry.lock /srv
COPY pyproject.toml /srv
RUN poetry install --without dev --no-interaction
COPY src /srv/src
COPY config/for-docker.yaml /srv/config/engine-recorder.yaml
COPY README.md /srv
COPY Makefile /srv
WORKDIR /srv
# RUN curl -sSL https://install.python-poetry.org | python3 -
# RUN export PATH="/root/.local/bin:$PATH"
RUN poetry install --without dev --no-interaction
# for Alsa when running docker run engine-recorder https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment