From bda7401943b7aed0039fb46697f478895bc33b2d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 7 Jun 2021 17:21:41 +0200 Subject: [PATCH] Add a legacy test config Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 22 +++++++++++++++++++--- docker/production/Dockerfile | 2 +- docker/tests/Dockerfile | 2 +- docker/tests/Dockerfile-legacy | 28 ++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 docker/tests/Dockerfile-legacy diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b386e9a8..8d30fde87 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,7 @@ lint-elixir: - exit $EXITVALUE lint-front: - image: node:14 + image: node:16 stage: check before_script: - export EXITVALUE=0 @@ -73,7 +73,7 @@ lint-front: build-frontend: stage: build-js - image: node:14 + image: node:16 before_script: - apt update - apt install -y --no-install-recommends python build-essential webp imagemagick gifsicle jpegoptim optipng pngquant @@ -100,10 +100,26 @@ deps: needs: - install +exunit-1.11: + stage: test + image: tcitworld/mobilizon-ci:legacy + services: + - name: mdillon/postgis:11 + alias: postgres + variables: + MIX_ENV: test + before_script: + - mix deps.get + - mix ecto.create + - mix ecto.migrate + script: + - mix coveralls + allow_failure: true + exunit: stage: test services: - - name: mdillon/postgis:11 + - name: mdillon/postgis:13 alias: postgres variables: MIX_ENV: test diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 1f9155a4c..3aaa41b18 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -8,7 +8,7 @@ RUN yarn install \ && yarn run build # Then, build the application binary -FROM elixir:1.11-alpine AS builder +FROM elixir:1.12-alpine AS builder RUN apk add --no-cache build-base git cmake diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index 73f0d6c8c..3a6673b1a 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -1,7 +1,7 @@ FROM elixir:latest LABEL maintainer="Thomas Citharel " -ENV REFRESHED_AT=2021-05-19 +ENV REFRESHED_AT=2021-06-07 RUN apt-get update -yq && apt-get install -yq build-essential inotify-tools postgresql-client git curl gnupg xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 cmake exiftool RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && apt-get install nodejs -yq RUN npm install -g yarn wait-on diff --git a/docker/tests/Dockerfile-legacy b/docker/tests/Dockerfile-legacy new file mode 100644 index 000000000..a90806409 --- /dev/null +++ b/docker/tests/Dockerfile-legacy @@ -0,0 +1,28 @@ +# We build Elixir manually to have the oldest acceptable version of OTP +FROM erlang:21 +LABEL maintainer="Thomas Citharel " + +# elixir expects utf8. +ENV ELIXIR_VERSION="v1.11.4" \ + LANG=C.UTF-8 + +RUN set -xe \ + && ELIXIR_DOWNLOAD_URL="https://github.com/elixir-lang/elixir/archive/${ELIXIR_VERSION}.tar.gz" \ + && ELIXIR_DOWNLOAD_SHA256="85c7118a0db6007507313db5bddf370216d9394ed7911fe80f21e2fbf7f54d29" \ + && curl -fSL -o elixir-src.tar.gz $ELIXIR_DOWNLOAD_URL \ + && echo "$ELIXIR_DOWNLOAD_SHA256 elixir-src.tar.gz" | sha256sum -c - \ + && mkdir -p /usr/local/src/elixir \ + && tar -xzC /usr/local/src/elixir --strip-components=1 -f elixir-src.tar.gz \ + && rm elixir-src.tar.gz \ + && cd /usr/local/src/elixir \ + && make install clean + +CMD ["iex"] + +ENV REFRESHED_AT=2021-06-07 +RUN apt-get update -yq && apt-get install -yq build-essential inotify-tools postgresql-client git curl gnupg xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 cmake exiftool +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash && apt-get install nodejs -yq +RUN npm install -g yarn wait-on +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN mix local.hex --force && mix local.rebar --force +RUN curl https://dbip.mirror.framasoft.org/files/dbip-city-lite-latest.mmdb --output GeoLite2-City.mmdb -s && mkdir -p /usr/share/GeoIP && mv GeoLite2-City.mmdb /usr/share/GeoIP/