Repository: digitalfabrik/integreat-cms

Issue:
Move builds to Circle CI
As the app team moves from Jenkins to Circle CI and we currently have issues with Jenkins, we should get familiar with the new provider and investigate how we can move our config there.
Move builds to Circle CI
As the app team moves from Jenkins to Circle CI and we currently have issues with Jenkins, we should get familiar with the new provider and investigate how we can move our config there.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -5,57 +5,55 @@
 from setuptools import find_packages, setup
 
 setup(
-    name="integreat_cms",
-    version="0.0.13",
-    packages=find_packages("src"),
-    package_dir={'':'src'},
+    name='integreat_cms',
+    version='0.0.13',
+    packages=find_packages('src'),
+    package_dir={'': 'src'},
     include_package_data=True,
     scripts=['src/integreat-cms-cli'],
-    data_files= [("lib/integreat-{}".format(root), [os.path.join(root, f) for f in files])
-                 for root, dirs, files in os.walk('src/cms/templates/')] +
-                [("lib/integreat-{}".format(root), [os.path.join(root, f) for f in files])
-                 for root, dirs, files in os.walk('src/cms/static/')] +
-                [('usr/lib/systemd/system/', ['systemd/integreat-cms@.service'])],
+    data_files=[('lib/integreat-{}'.format(root), [os.path.join(root, f) for f in files])
+                for root, dirs, files in os.walk('src/cms/templates/')] +
+               [('lib/integreat-{}'.format(root), [os.path.join(root, f) for f in files])
+                for root, dirs, files in os.walk('src/cms/static/')] +
+               [('usr/lib/systemd/system/', ['systemd/integreat-cms@.service'])],
     install_requires=[
-        "beautifulsoup4",
-        "cffi",
-        "Django==2.2.10",
-        "django-filer",
-        "django-mptt",
-        "django-widget-tweaks",
-        "idna",
-        "lxml",
-        "psycopg2-binary",
-        "python-dateutil",
-        "requests",
-        "rules",
-        "six",
-        "webauthn",
+        'beautifulsoup4',
+        'cffi',
+        'Django~=2.2.10',
+        'django-filer',
+        'django-mptt',
+        'django-widget-tweaks',
+        'idna',
+        'lxml',
+        'psycopg2-binary',
+        'python-dateutil',
+        'requests',
+        'rules',
+        'six',
+        'webauthn',
     ],
     extras_require={
-        "dev": [
-            "django-compressor",
-            "django-compressor-toolkit",
-            "packaging",
-            "pylint",
-            "pylint-django",
-            "pylint_runner",
-            "sphinx",
-            "sphinxcontrib-django",
-            "sphinx_rtd_theme",
+        'dev': [
+            'django-compressor',
+            'django-compressor-toolkit',
+            'packaging',
+            'pylint',
+            'pylint-django',
+            'pylint_runner',
+            'sphinx',
+            'sphinxcontrib-django',
+            'sphinx_rtd_theme',
         ]
     },
-    author="Integreat App Project",
-    author_email="info@integreat-app.de",
-    description="Content Management System for the Integreat App",
-    license="GPL-2.0-or-later",
-    keywords="Django Integreat CMS",
-    url="http://github.com/Integreat/",
+    author='Integreat App Project',
+    author_email='info@integreat-app.de',
+    description='Content Management System for the Integreat App',
+    license='GPL-2.0-or-later',
+    keywords='Django Integreat CMS',
+    url='http://github.com/Integreat/',
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'Intended Audience :: Developers',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5',
-        'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
     ]
 )
diff --git a/src/backend/jenkins_settings.py b/src/backend/jenkins_settings.py
deleted file mode 100644
--- a/src/backend/jenkins_settings.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# pylint: disable=wildcard-import
-# pylint: disable=unused-wildcard-import
-from django.core.exceptions import ImproperlyConfigured
-
-from .settings import *
-
-
-def get_env_value(env_variable):
-    try:
-        return os.environ[env_variable]
-    except KeyError:
-        error_msg = 'Set the {} environment variable'.format(env_variable)
-        raise ImproperlyConfigured(error_msg)
-
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.postgresql_psycopg2',
-        'NAME': 'djangojenkins',
-        'USER': get_env_value('CMS_DJANGO_DATABASE_USER'),
-        'PASSWORD': get_env_value('CMS_DJANGO_DATABASE_PASSWORD'),
-        'HOST': 'localhost',
-        'PORT': '3333',
-        'TEST': {
-            'NAME': 'djangojenkins_test',
-        },
-    }
-}


Test patch:
diff --git a/dev-tools/test.sh b/dev-tools/test.sh
--- a/dev-tools/test.sh
+++ b/dev-tools/test.sh
@@ -2,8 +2,6 @@
 
 # TODO: make it possible to use without docker database
 
-source .venv/bin/activate
+cd $(dirname "$BASH_SOURCE")/..
 
-export DJANGO_SETTINGS_MODULE=backend.docker_settings
-
-integreat-cms test cms
\ No newline at end of file
+pipenv run integreat-cms-cli test cms --settings=backend.docker_settings