diff --git a/env/OPENSHIFT_CELERY_BROKER_TRANS.erb b/env/OPENSHIFT_CELERY_BROKER_TRANS.erb new file mode 100644 index 0000000..97ee1da --- /dev/null +++ b/env/OPENSHIFT_CELERY_BROKER_TRANS.erb @@ -0,0 +1 @@ +mongodb diff --git a/env/OPENSHIFT_CELERY_BROKER_URL.erb b/env/OPENSHIFT_CELERY_BROKER_URL.erb new file mode 100644 index 0000000..b1ae0ea --- /dev/null +++ b/env/OPENSHIFT_CELERY_BROKER_URL.erb @@ -0,0 +1,2 @@ +<%= ENV['OPENSHIFT_MONGODB_DB_URL'] %> + diff --git a/env/OPENSHIFT_CELERY_RESULT_BACKEND.erb b/env/OPENSHIFT_CELERY_RESULT_BACKEND.erb new file mode 100644 index 0000000..33ab847 --- /dev/null +++ b/env/OPENSHIFT_CELERY_RESULT_BACKEND.erb @@ -0,0 +1 @@ +<%= ENV['OPENSHIFT_MONGODB_DB_URL'] %> diff --git a/template.git/.openshift/action_hooks/build b/template.git/.openshift/action_hooks/build new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/template.git/.openshift/action_hooks/build @@ -0,0 +1 @@ + diff --git a/template.git/.openshift/action_hooks/deploy b/template.git/.openshift/action_hooks/deploy new file mode 100755 index 0000000..3875983 --- /dev/null +++ b/template.git/.openshift/action_hooks/deploy @@ -0,0 +1,6 @@ +#!/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. + diff --git a/template.git/.openshift/action_hooks/post-deploy b/template.git/.openshift/action_hooks/post-deploy new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/template.git/.openshift/action_hooks/post-deploy @@ -0,0 +1 @@ + diff --git a/template.git/.openshift/action_hooks/post_deploy b/template.git/.openshift/action_hooks/post_deploy new file mode 100755 index 0000000..d38c5da --- /dev/null +++ b/template.git/.openshift/action_hooks/post_deploy @@ -0,0 +1,4 @@ +#!/bin/bash + +source $OPENSHIFT_HOMEDIR/python/virtenv/bin/activate +export PYTHONPATH=`echo $OPENSHIFT_REPO_DIR`:$PYTHONPATH diff --git a/template.git/.openshift/action_hooks/pre-build b/template.git/.openshift/action_hooks/pre-build new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/template.git/.openshift/action_hooks/pre-build @@ -0,0 +1 @@ + diff --git a/template.git/celerytks/__init__.py b/template.git/celerytks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/template.git/celerytks/tasks.py b/template.git/celerytks/tasks.py new file mode 100644 index 0000000..2041943 --- /dev/null +++ b/template.git/celerytks/tasks.py @@ -0,0 +1,13 @@ +import celery +app = celery.Celery() + +@app.task +def addtest(x, y): + return x + y + +@app.task +def run_spiders(name, **kwargs): + """ + @param name: spider name + """ + pass