summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-12 12:27:15 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-12 12:27:15 +0200
commit393b8f766f04a2dbf484691b84d2546a5e30221e (patch)
treea95ffceeea9573272188bd6f260edcf2a70f95f2
parent2ec785911afd4fdbb26f626c989b04e3d2793248 (diff)
downloadIshtar-393b8f766f04a2dbf484691b84d2546a5e30221e.tar.bz2
Ishtar-393b8f766f04a2dbf484691b84d2546a5e30221e.zip
CI: add configuration file and adapt Makefile and settings
-rw-r--r--.gitlab-ci.yml19
-rw-r--r--Makefile.example3
-rw-r--r--example_project/settings.py16
3 files changed, 34 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000..efda3bde2
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,19 @@
+before_script:
+ - apt-get update
+ - apt-get install -q -y python-pip libpq-dev python-dev libjpeg-dev zlib1g-dev libxml2-dev libxslt1-dev libgeos-dev
+ - pip install -q -r requirements.txt
+ - cp Makefile.example Makefile
+ - echo "LOGFILE = '/tmp/ishtar.log'" > example_project/local_settings.py
+
+variables:
+ POSTGRES_DB: ishtar
+ POSTGRES_USER: ishtar
+ POSTGRES_PASSWORD: "ishtar"
+
+services:
+ - mdillon/postgis:9.1
+
+master:
+ script: "make test_gitlab"
+ only:
+ - master
diff --git a/Makefile.example b/Makefile.example
index 32bf03f9a..586055e90 100644
--- a/Makefile.example
+++ b/Makefile.example
@@ -47,6 +47,9 @@ update: clean syncdb compilemessages collectstatic
test: clean
cd $(project); $(PYTHON) manage.py test $(apps)
+test_gitlab: clean
+ cd $(project); $(PYTHON) manage.py test $(apps)
+
pep8:
pep8 --filename=*.py --ignore=W --exclude="manage.py,settings.py,migrations" --statistics --repeat .
diff --git a/example_project/settings.py b/example_project/settings.py
index 18a715577..6d984f6e6 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -40,6 +40,18 @@ LOGIN_REDIRECT_URL = "/" + URL_PATH
AUTH_PROFILE_MODULE = 'ishtar_common.IshtarUser'
ACCOUNT_ACTIVATION_DAYS = 7
+# change this in local_settings
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.contrib.gis.db.backends.postgis',
+ 'NAME': 'ishtar',
+ 'USER': 'ishtar',
+ 'PASSWORD': 'ishtar',
+ 'HOST': 'postgis',
+ 'PORT': '5432',
+ }
+}
+
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
@@ -259,10 +271,6 @@ if DEBUG_TOOLBAR:
)
DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False}
-import sys
-if 'test' in sys.argv or 'test_coverage' in sys.argv:
- DATABASES['default']['engine'] = 'sqlite3'
-
if SQL_DEBUG:
LOGGING['loggers']['django.db.backends'] = {