Skip to content
Extraits de code Groupes Projets
  • Jamesie Pic's avatar
    d6108022
    Project modernization · d6108022
    Jamesie Pic a rédigé
    - continuous integration with travis,
    - continuous deployment with openshift,
    - add update_score cron,
    - sentry for exception tracking,
    - continuous documentation build with rtfd,
    - configuration made 12factor-ish,
    - make use of new django-representatives version for database
      optimization.
    d6108022
    Historique
    Project modernization
    Jamesie Pic a rédigé
    - continuous integration with travis,
    - continuous deployment with openshift,
    - add update_score cron,
    - sentry for exception tracking,
    - continuous documentation build with rtfd,
    - configuration made 12factor-ish,
    - make use of new django-representatives version for database
      optimization.
deploy 1,37 Kio
#!/bin/bash
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again.  This script gets executed directly, so it could be python, php,
# ruby, etc.
set -xe

source ${OPENSHIFT_HOMEDIR}app-root/runtime/dependencies/python/virtenv/bin/activate

cat ${OPENSHIFT_REPO_DIR}requirements.txt

pip install -U pip

pip install -r ${OPENSHIFT_REPO_DIR}requirements.txt

# We don't have sentry yet
# python ${OPENSHIFT_REPO_DIR}manage.py raven test

python ${OPENSHIFT_REPO_DIR}manage.py migrate --noinput

pushd ${OPENSHIFT_DATA_DIR}
if ! [ -d node ]; then
    wget https://nodejs.org/dist/v4.2.2/node-v4.2.2-linux-x64.tar.gz
    tar xvzf node-v4.2.2-linux-x64.tar.gz
    ln -sfn node-v4.2.2-linux-x64 node
fi
popd

pushd ${OPENSHIFT_REPO_DIR}
if [ -f ${OPENSHIFT_DATA_DIR}sentry ]; then
    pip install raven
    ./manage.py raven test
else
    echo ${OPENSHIFT_DATA_DIR}sentry does not exist, not setting up raven.
fi

PATH="${OPENSHIFT_DATA_DIR}node/bin:$PATH"
HOME=$OPENSHIFT_DATA_DIR
CI=true
npm install bower
npm install
node_modules/.bin/bower install
node_modules/gulp/bin/gulp.js less
mkdir -p wsgi
./manage.py collectstatic --noinput
popd

mkdir -p ${OPENSHIFT_DATA_DIR}media
mkdir -p ${OPENSHIFT_REPO_DIR}wsgi/static/media
ln -sf ${OPENSHIFT_DATA_DIR}media ${OPENSHIFT_REPO_DIR}wsgi/static/media