Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Fix jenkins script.
Browse files Browse the repository at this point in the history
When building Jenkins environment make sure that we fetch submodules
before running pip install. Also drop test database on every run.
  • Loading branch information
glogiotatidis committed Nov 12, 2012
1 parent 82aba47 commit 0f967b9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions bin/jenkins.sh
Expand Up @@ -14,6 +14,13 @@ echo "Starting build on executor $EXECUTOR_NUMBER..."
# Make sure there's no old pyc files around.
find . -name '*.pyc' -exec rm {} \;

git submodule sync
git submodule update --init --recursive

if [ ! -d "$WORKSPACE/vendor" ]; then
echo "No /vendor... crap."
exit 1
fi

if [ ! -d "$VENV" ]; then
echo "Making virtualenv..."
Expand All @@ -23,14 +30,6 @@ source $VENV/bin/activate
pip install -r requirements/tests-compiled.txt
pip install -r requirements/compiled.txt

git submodule sync
git submodule update --init --recursive

if [ ! -d "$WORKSPACE/vendor" ]; then
echo "No /vendor... crap."
exit 1
fi

cat > settings/local.py <<SETTINGS
import logging
from settings import *
Expand Down Expand Up @@ -87,11 +86,13 @@ ES_HOSTS = ['127.0.0.1:9200']
ES_INDEXES = dict(default='test_${JOB_NAME}')
SETTINGS

echo "Database name: ${JOB_NAME}"
echo "Dropping Test database"
echo "DROP DATABASE test_${JOB_NAME};"|mysql -u $DB_USER -h $DB_HOST

echo "Creating database if we need it..."
echo "CREATE DATABASE IF NOT EXISTS ${JOB_NAME}"|mysql -u $DB_USER -h $DB_HOST

echo "Database name: ${JOB_NAME}"

echo "Updating product details."

python manage.py update_product_details
Expand Down

0 comments on commit 0f967b9

Please sign in to comment.