Skip to content
Snippets Groups Projects
Select Git revision
  • e00f7fa5078335ab5db91969f816e68be52deca6
  • main default protected
  • feature/export-filtering
  • feature/clear-schedule-button
  • fix/responsive-cols-in-polls
  • feature/preference-polling-form
  • feature/json-export-via-rest-framework
  • feature/json-schedule-import-tests
  • fix/add-room-import-only-once
  • ak-import
  • renovate/django-simple-history-3.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-5.x
  • renovate/mysqlclient-2.x
14 results

setup.sh

Blame
  • Forked from KIF / AKPlanning
    320 commits behind the upstream repository.
    Benjamin Hättasch's avatar
    Benjamin Hättasch authored
    Improve setup script (add prod and CI parameters)
    Improve calling of setup script in CI configuration
    Add doc generation action to CI configuration
    25bdba92
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    setup.sh 1014 B
    #!/usr/bin/env bash
    # Setup AKPlanning
    # execute as Utils/setup.sh
    
    # abort on error, print executed commands
    set -ex
    
    # remove old virtualenv
    rm -rf venv/
    
    # Setup Python Environment
    # Requires: Virtualenv, appropriate Python installation
    virtualenv venv -p python3.9
    source venv/bin/activate
    pip install --upgrade setuptools pip wheel
    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
    python manage.py migrate
    
    # Prepare static files and translations
    python manage.py collectstatic --noinput
    python manage.py compilemessages -l de_DE
    
    # Create superuser
    # Credentials are entered interactively on CLI
    python manage.py createsuperuser
    
    # Generate documentation (but not for CI use)
    if [ -n "$1" = "--ci" ]; then
        cd docs
        make html
        cd ..
    fi
    
    
    deactivate