Commit 6c9556d8 authored by sebastien letort's avatar sebastien letort

New gitlab-ci, with 3 stages build, test and cleanning.

I assume the runner will have docker and docker-compose installed.
/!\ gitlab-runner has to be a sudoer, without asking for password. /!\

The build is only the call to ./bootstrap.
The tests are done with pylint3 (can fail) and the 'test' (for unit and functionnal tests).
And to terminate, cleanning is always done. This is required because otherwise bootstrap will try to erase previous data without being sudoer, and this will fail.

Also to reduce the creation of files created by "root", we do not generate python cache files for the controller.
parent d157e169
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
stages:
- build
- test
- cleanning
before_script:
- docker info
- docker-compose --version
- pwd
# ---------------------------
bootstrap:
tags:
- allgo
stage: build
script: "./bootstrap"
django_pylint:
stage: test
# only:
# - /django/
script:
- docker info
- apk update
- apk upgrade
- apk add python python-dev py-pip build-base bash openssl python3
- pip install docker-compose
- mkdir -p /data/dev
- rm -Rf /data/dev/*
- /bin/bash bootstrap dev-mysql dev-controller dev-ssh dev-django dev-nginx dev-smtpsink dev-registry
- echo $PYLINTHOME
- docker exec -i dev-django pylint3 --rcfile=.pylintrc allgo
allow_failure: true
#~ django_test:
#~ stage: test
#~ # only:
#~ # - /django/
#~ script:
#~ - docker exec -i dev-django python3 manage.py test
nettoyage:
stage: cleanning
when: always
script:
- sudo rm -rf data/*
......@@ -29,4 +29,7 @@ ENV ENV="" \
ALLGO_REDIS_HOST="{ENV}-redis" \
ALLGO_IMPORT_REGISTRY="cargo.irisa.fr:8003/allgo/prod/webapp"
# to prevent __pycache__generation, which is owned by root.
ENV PYTHONDONTWRITEBYTECODE 1
LABEL dk.migrate_always=1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment