8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00

Add optional build stage

This commit is contained in:
chapeau 2024-03-10 12:21:29 +01:00
parent 1014839328
commit 0fc6b5f966
2 changed files with 13 additions and 11 deletions

View file

@ -5,22 +5,24 @@ variables:
stages: stages:
- lint - lint
- build - build
- test
build: build:
image: docker:24.0.5 image: docker:24.0.5
services: services:
- docker:24.0.5-dind - docker:24.0.5-dind
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
stage: build stage: build
variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
SUPERUSER_LOGIN: admin
SUPERUSER_PASS: admin
SUPERUSER_EMAIL: admin@example.net
ENV: dev
script: script:
# - docker build -t re2o . --target=postgres - docker compose build
test:
image: docker:24.0.5
services:
- docker:24.0.5-dind
stage: test
script:
- docker compose -f docker-compose-dev.yml run --env RUN_TESTS=yes re2o - docker compose -f docker-compose-dev.yml run --env RUN_TESTS=yes re2o
lint: lint:

View file

@ -5,8 +5,8 @@ WORKDIR /code
RUN apt-get update && apt-get install -y --no-install-recommends gettext-base gettext libpq-dev RUN apt-get update && apt-get install -y --no-install-recommends gettext-base gettext libpq-dev
COPY . /code/ COPY . /code/
RUN poetry install --extras "postgresql" RUN poetry install --extras "postgresql"
RUN ENV=dev DATABASE_URL='' poetry run python manage.py collectstatic --noinput ENV POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres SUPERUSER_LOGIN=admin SUPERUSER_PASS=admin SUPERUSER_EMAIL=admin@example.net ENV=dev
RUN poetry run python manage.py compilemessages RUN poetry run python manage.py collectstatic --noinput
FROM nginx FROM nginx
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf