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:
parent
1014839328
commit
0fc6b5f966
2 changed files with 13 additions and 11 deletions
|
@ -5,22 +5,24 @@ variables:
|
|||
stages:
|
||||
- lint
|
||||
- build
|
||||
- test
|
||||
|
||||
build:
|
||||
image: docker:24.0.5
|
||||
services:
|
||||
- docker:24.0.5-dind
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "dev"'
|
||||
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:
|
||||
# - 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
|
||||
|
||||
lint:
|
||||
|
|
|
@ -5,8 +5,8 @@ WORKDIR /code
|
|||
RUN apt-get update && apt-get install -y --no-install-recommends gettext-base gettext libpq-dev
|
||||
COPY . /code/
|
||||
RUN poetry install --extras "postgresql"
|
||||
RUN ENV=dev DATABASE_URL='' poetry run python manage.py collectstatic --noinput
|
||||
RUN poetry run python manage.py compilemessages
|
||||
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 collectstatic --noinput
|
||||
|
||||
FROM nginx
|
||||
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
|
Loading…
Reference in a new issue