From 68e25739d0a9c9de3f746aa7645a7680cb26c6dc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 12 Aug 2016 12:27:15 +0200 Subject: CI: add configuration file and adapt Makefile and settings --- Makefile.example | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile.example') 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 . -- cgit v1.2.3 From 53380d7862040c5155afc6ba2f444fda20558e62 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 14:05:10 +0200 Subject: CI: debug hosts --- Makefile.example | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index 586055e90..cbcbbf069 100644 --- a/Makefile.example +++ b/Makefile.example @@ -48,6 +48,7 @@ test: clean cd $(project); $(PYTHON) manage.py test $(apps) test_gitlab: clean + cat /etc/hosts; cd $(project); $(PYTHON) manage.py test $(apps) pep8: -- cgit v1.2.3 From b808edb71c5848d318c104f91aa6bb9efdd3a1d4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 14:21:33 +0200 Subject: CI: specific conf for CI - fix DB host --- .gitlab-ci.yml | 2 +- Makefile.example | 1 - example_project/local_settings.py.gitlab-ci | 12 ++++++++++++ example_project/settings.py | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 example_project/local_settings.py.gitlab-ci (limited to 'Makefile.example') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efda3bde2..12757184c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ before_script: - 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 + - cp example_project/local_settings.py.gitlab-ci example_project/local_settings.py variables: POSTGRES_DB: ishtar diff --git a/Makefile.example b/Makefile.example index cbcbbf069..586055e90 100644 --- a/Makefile.example +++ b/Makefile.example @@ -48,7 +48,6 @@ test: clean cd $(project); $(PYTHON) manage.py test $(apps) test_gitlab: clean - cat /etc/hosts; cd $(project); $(PYTHON) manage.py test $(apps) pep8: diff --git a/example_project/local_settings.py.gitlab-ci b/example_project/local_settings.py.gitlab-ci new file mode 100644 index 000000000..6c7e5fbba --- /dev/null +++ b/example_project/local_settings.py.gitlab-ci @@ -0,0 +1,12 @@ +DATABASES = { + 'default': { + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'NAME': 'ishtar', + 'USER': 'ishtar', + 'PASSWORD': 'ishtar', + 'HOST': 'mdillon-postgis', + 'PORT': '5432', + } +} + +LOGFILE = '/tmp/ishtar.log' diff --git a/example_project/settings.py b/example_project/settings.py index 6d984f6e6..9982d624f 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -47,7 +47,7 @@ DATABASES = { 'NAME': 'ishtar', 'USER': 'ishtar', 'PASSWORD': 'ishtar', - 'HOST': 'postgis', + 'HOST': '127.0.0.1', 'PORT': '5432', } } -- cgit v1.2.3 From ed407a3c96bc50e16e17e1223ccd24c450e7fd95 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 15:09:18 +0200 Subject: CI: force migrations before test --- Makefile.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index 586055e90..759c5f833 100644 --- a/Makefile.example +++ b/Makefile.example @@ -47,7 +47,7 @@ update: clean syncdb compilemessages collectstatic test: clean cd $(project); $(PYTHON) manage.py test $(apps) -test_gitlab: clean +test_gitlab: syncdb cd $(project); $(PYTHON) manage.py test $(apps) pep8: -- cgit v1.2.3 From 9bc70425c2385efe265cf90d04090cab43959328 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 20:40:25 +0200 Subject: CI: fix migration order --- Makefile.example | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index 759c5f833..a6a4d523d 100644 --- a/Makefile.example +++ b/Makefile.example @@ -47,7 +47,13 @@ update: clean syncdb compilemessages collectstatic test: clean cd $(project); $(PYTHON) manage.py test $(apps) -test_gitlab: syncdb +test_gitlab: clean + # test migrations + cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null + # only necessary on master + cd $(project); $(PYTHON) ./manage.py migrate ishtar_common 2> /dev/null > /dev/null + cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations 2> /dev/null > /dev/null + cd $(project); $(PYTHON) ./manage.py migrate 2> /dev/null > /dev/null cd $(project); $(PYTHON) manage.py test $(apps) pep8: -- cgit v1.2.3 From 70297fc0fc07eba7e06ebee6d64b2570f279185f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 20:45:42 +0200 Subject: CI: remove debug instructions --- Makefile.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index a6a4d523d..e1f0141bb 100644 --- a/Makefile.example +++ b/Makefile.example @@ -51,9 +51,9 @@ test_gitlab: clean # test migrations cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null # only necessary on master - cd $(project); $(PYTHON) ./manage.py migrate ishtar_common 2> /dev/null > /dev/null - cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations 2> /dev/null > /dev/null - cd $(project); $(PYTHON) ./manage.py migrate 2> /dev/null > /dev/null + cd $(project); $(PYTHON) ./manage.py migrate ishtar_common + cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations + cd $(project); $(PYTHON) ./manage.py migrate cd $(project); $(PYTHON) manage.py test $(apps) pep8: -- cgit v1.2.3 From 8a7cbfc2489c0419e2c8177d17765dbd17496fbd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 20:51:55 +0200 Subject: CI: fix migration order --- Makefile.example | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index e1f0141bb..b64200749 100644 --- a/Makefile.example +++ b/Makefile.example @@ -52,6 +52,7 @@ test_gitlab: clean cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null # only necessary on master cd $(project); $(PYTHON) ./manage.py migrate ishtar_common + cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 0051 cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations cd $(project); $(PYTHON) ./manage.py migrate cd $(project); $(PYTHON) manage.py test $(apps) -- cgit v1.2.3 From 65154db012da293f1270aa849d38a94b7ea9b71d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 20:57:38 +0200 Subject: CI: fix migration number for arcahaeological files --- Makefile.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index b64200749..d099fdeed 100644 --- a/Makefile.example +++ b/Makefile.example @@ -52,7 +52,7 @@ test_gitlab: clean cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null # only necessary on master cd $(project); $(PYTHON) ./manage.py migrate ishtar_common - cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 0051 + cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 0013 cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations cd $(project); $(PYTHON) ./manage.py migrate cd $(project); $(PYTHON) manage.py test $(apps) -- cgit v1.2.3 From 50a4d552ef860b187c12a7a0701bf7848047ce27 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 17 Aug 2016 21:06:52 +0200 Subject: CI: refix migrate --- Makefile.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index d099fdeed..0cf4216e8 100644 --- a/Makefile.example +++ b/Makefile.example @@ -53,7 +53,8 @@ test_gitlab: clean # only necessary on master cd $(project); $(PYTHON) ./manage.py migrate ishtar_common cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 0013 - cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations + cd $(project); $(PYTHON) ./manage.py migrate archaeological_operations 0040 + cd $(project); $(PYTHON) ./manage.py migrate archaeological_files cd $(project); $(PYTHON) ./manage.py migrate cd $(project); $(PYTHON) manage.py test $(apps) -- cgit v1.2.3 From 5fad1212c642841218fc797009bdebc678ea81fd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 18 Aug 2016 11:34:27 +0200 Subject: CI: see syncdb output --- Makefile.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index 0cf4216e8..4febeea65 100644 --- a/Makefile.example +++ b/Makefile.example @@ -49,7 +49,7 @@ test: clean test_gitlab: clean # test migrations - cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null + cd $(project); $(PYTHON) ./manage.py syncdb --noinput # only necessary on master cd $(project); $(PYTHON) ./manage.py migrate ishtar_common cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 0013 -- cgit v1.2.3