Commit 0bc8954b authored by Michal Čihař's avatar Michal Čihař

Merge pull request #708 from dtschan/openshift

Openshift
parents 363cc8de a955ff83
......@@ -19,14 +19,12 @@
#
# Don't let OpenShift install weblate and its dependencies directly as this leads to timeouts during gear creation and deploys
export OPENSHIFT_PYTHON_REQUIREMENTS_PATH=no_such_file
if [ -e $OPENSHIFT_REPO_DIR/setup.py ]; then
mv $OPENSHIFT_REPO_DIR/setup.py $OPENSHIFT_REPO_DIR/setup_weblate.py
fi
if [ -e $OPENSHIFT_REPO_DIR/requirements.txt ]; then
mv $OPENSHIFT_REPO_DIR/requirements.txt $OPENSHIFT_REPO_DIR/requirements-mandatory.txt
fi
# Show install/update page, will be replaced with app by install.sh
# Link sources below $OPENSHIFT_REPO_DIR must be relative or they will be invalid after restore/clone operations
mkdir -p $OPENSHIFT_REPO_DIR/wsgi
......
......@@ -51,20 +51,20 @@ source $OPENSHIFT_HOMEDIR/python/virtenv/bin/activate
cd ${OPENSHIFT_REPO_DIR}
sh "python ${OPENSHIFT_REPO_DIR}/setup_weblate.py develop"
# Pin Django version to 1.7 to avoid surprises when 1.8 comes out.
sed -e 's/Django[<>=]\+.*/Django>1.7,<1.8/' $OPENSHIFT_REPO_DIR/requirements-mandatory.txt >/tmp/requirements.txt
# Pin Django version to 1.8 to avoid surprises when 1.9 comes out.
sed -e 's/Django[<>=]\+.*/Django>=1.8,<1.9/' $OPENSHIFT_REPO_DIR/requirements.txt >/tmp/requirements.txt
sh "pip install -r /tmp/requirements.txt"
sh "pip install -U -r /tmp/requirements.txt"
# Install optional dependencies without failing if some can't be installed.
while read line; do
if [[ $line != -r* ]]; then
if [[ $line != -r* ]] && [[ $line != \#* ]]; then
sh "pip install $line" || true
fi
done < $OPENSHIFT_REPO_DIR/requirements-optional.txt
sh "python ${OPENSHIFT_REPO_DIR}/setup_weblate.py develop"
if [ ! -s $OPENSHIFT_DATA_DIR/weblate.db ]; then
rm -f ${OPENSHIFT_DATA_DIR}/.credentials
fi
......@@ -100,7 +100,7 @@ sh "python ${OPENSHIFT_REPO_DIR}/openshift/manage.py collectstatic --noinput"
if [ ! -s $OPENSHIFT_DATA_DIR/.credentials ]; then
echo "Generating Weblate admin credentials and writing them to ${OPENSHIFT_DATA_DIR}/.credentials"
sh "python ${OPENSHIFT_REPO_DIR}/openshift/manage.py createadmin"
sh "python ${OPENSHIFT_REPO_DIR}/openshift/secure_db.py | tee ${OPENSHIFT_DATA_DIR}/.credentials"
DJANGO_SETTINGS_MODULE='weblate.settings_openshift' sh "python ${OPENSHIFT_REPO_DIR}/openshift/secure_db.py | tee ${OPENSHIFT_DATA_DIR}/.credentials"
fi
if find_script_dir; then
......
......@@ -19,8 +19,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from django.conf import settings
import os
import sqlite3
from openshift.openshiftlibs import make_secure_key, get_openshift_secret_token
......@@ -29,9 +27,6 @@ from django.contrib.auth.hashers import make_password
def secure_db():
# Use default Django settings
settings.configure()
new_pass = make_secure_key({
'hash': sha256(get_openshift_secret_token()).hexdigest(),
'original': '0' * 12,
......
-r requirements.txt
#pyuca
https://github.com/SmileyChris/pyuca/archive/master.zip
git+https://github.com/SmileyChris/pyuca@555292b
pyLibravatar
pydns
babel
......
......@@ -94,12 +94,13 @@ setup(
download_url='https://github.com/nijel/weblate',
author='Michal Čihař',
author_email='michal@cihar.com',
dependency_links=[
'git+https://github.com/SmileyChris/pyuca@555292b#egg=pyuca-1.0',
],
install_requires=REQUIRES,
extras_require={
'Mercurial': ['Mercurial>=2.8'],
'Unicode': [
'https://github.com/SmileyChris/pyuca/archive/master.zip'
],
'Unicode': ['pyuca==1.0'],
'Avatars': ['pyLibravatar', 'pydns'],
'Android': ['babel'],
},
......
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