Skip to content
Snippets Groups Projects
Commit 25bdba92 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Update CI to explicitly test doc building

Improve setup script (add prod and CI parameters)
Improve calling of setup script in CI configuration
Add doc generation action to CI configuration
parent 94bde9bf
No related branches found
No related tags found
1 merge request!179Code quality improvements
...@@ -18,8 +18,7 @@ before_script: ...@@ -18,8 +18,7 @@ before_script:
- python -V # Print out python version for debugging - python -V # Print out python version for debugging
- apt-get -qq update - apt-get -qq update
- apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-mysql-client default-libmysqlclient-dev - apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-mysql-client default-libmysqlclient-dev
- export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci - ./Utils/setup.sh --ci
- ./Utils/setup.sh --prod
- mkdir -p public/badges public/lint - mkdir -p public/badges public/lint
- echo undefined > public/badges/$CI_JOB_NAME.score - echo undefined > public/badges/$CI_JOB_NAME.score
- source venv/bin/activate - source venv/bin/activate
...@@ -70,6 +69,16 @@ lint: ...@@ -70,6 +69,16 @@ lint:
codequality: codeclimate.json codequality: codeclimate.json
when: always when: always
doc:
stage: test
script:
- cd docs
- make html
- cd ..
artifacts:
paths:
- docs/_build/html
pages: pages:
stage: deploy stage: deploy
image: alpine:latest image: alpine:latest
......
...@@ -15,6 +15,14 @@ source venv/bin/activate ...@@ -15,6 +15,14 @@ source venv/bin/activate
pip install --upgrade setuptools pip wheel pip install --upgrade setuptools pip wheel
pip install -r requirements.txt pip install -r requirements.txt
# set environment variable when we want to update in production
if [ "$1" = "--prod" ]; then
export DJANGO_SETTINGS_MODULE=AKPlanning.settings_production
fi
if [ "$1" = "--ci" ]; then
export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci
fi
# Setup database # Setup database
python manage.py migrate python manage.py migrate
...@@ -26,9 +34,12 @@ python manage.py compilemessages -l de_DE ...@@ -26,9 +34,12 @@ python manage.py compilemessages -l de_DE
# Credentials are entered interactively on CLI # Credentials are entered interactively on CLI
python manage.py createsuperuser python manage.py createsuperuser
# Generate documentation # Generate documentation (but not for CI use)
cd docs if [ -n "$1" = "--ci" ]; then
make html cd docs
cd .. make html
cd ..
fi
deactivate deactivate
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