From 69a8b0c003c730883d35ddb46a4ba28425a346b6 Mon Sep 17 00:00:00 2001 From: Jens Kleineheismann Date: Thu, 23 Apr 2020 12:24:21 +0200 Subject: [PATCH 1/4] ADD: support for heinzelwerk CI/CD chain --- .buildbot/deploy/01-install.sh | 1 + .buildbot/deploy/02-setup.sh | 5 +++++ .buildbot/deploy/03-allowed_hosts.sh | 1 + .buildbot/deploy/10-collectstatic.sh | 1 + .buildbot/deploy/99-trigger_wsgi_reload.sh | 1 + .buildbot/dist/01-sdist.sh | 22 +++++++++++++++++++++ .buildbot/undist/01-unpack.sh | 23 ++++++++++++++++++++++ MANIFEST.in | 19 ++++++++++++++++++ 8 files changed, 73 insertions(+) create mode 100644 .buildbot/deploy/01-install.sh create mode 100644 .buildbot/deploy/02-setup.sh create mode 100644 .buildbot/deploy/03-allowed_hosts.sh create mode 100644 .buildbot/deploy/10-collectstatic.sh create mode 100644 .buildbot/deploy/99-trigger_wsgi_reload.sh create mode 100644 .buildbot/dist/01-sdist.sh create mode 100644 .buildbot/undist/01-unpack.sh diff --git a/.buildbot/deploy/01-install.sh b/.buildbot/deploy/01-install.sh new file mode 100644 index 0000000..8cbd569 --- /dev/null +++ b/.buildbot/deploy/01-install.sh @@ -0,0 +1 @@ +pip install -e . diff --git a/.buildbot/deploy/02-setup.sh b/.buildbot/deploy/02-setup.sh new file mode 100644 index 0000000..ffc32c2 --- /dev/null +++ b/.buildbot/deploy/02-setup.sh @@ -0,0 +1,5 @@ +django-dav-admin setup env/django +python env/django/manage.py enable_module dav_auth +python env/django/manage.py enable_module dav_events +python env/django/manage.py enable_module dav_registration +python env/django/manage.py enable_module dav_event_office diff --git a/.buildbot/deploy/03-allowed_hosts.sh b/.buildbot/deploy/03-allowed_hosts.sh new file mode 100644 index 0000000..c6ff185 --- /dev/null +++ b/.buildbot/deploy/03-allowed_hosts.sh @@ -0,0 +1 @@ +echo "ALLOWED_HOSTS = ['*']" >> env/django/main/settings.py diff --git a/.buildbot/deploy/10-collectstatic.sh b/.buildbot/deploy/10-collectstatic.sh new file mode 100644 index 0000000..125d422 --- /dev/null +++ b/.buildbot/deploy/10-collectstatic.sh @@ -0,0 +1 @@ +python manage.py collectstatic --no-input diff --git a/.buildbot/deploy/99-trigger_wsgi_reload.sh b/.buildbot/deploy/99-trigger_wsgi_reload.sh new file mode 100644 index 0000000..817be12 --- /dev/null +++ b/.buildbot/deploy/99-trigger_wsgi_reload.sh @@ -0,0 +1 @@ +touch conf/wsgi.py diff --git a/.buildbot/dist/01-sdist.sh b/.buildbot/dist/01-sdist.sh new file mode 100644 index 0000000..267c9eb --- /dev/null +++ b/.buildbot/dist/01-sdist.sh @@ -0,0 +1,22 @@ +if test -z "$DIST_FORMAT" ; then + DIST_FORMAT="gztar" +fi + +python setup.py sdist --dist-dir . --formats "$DIST_FORMAT" + +if test -n "$DIST_FILE" ; then + dist_name=`python setup.py --name` + dist_version=`python setup.py --version` + case "$DIST_FORMAT" in + gztar) + dist_suffix=".tar.gz" + ;; + *) + dist_suffix=".${DIST_FORMAT}" + ;; + esac + produced_file="${dist_name}-${dist_version}${dist_suffix}" + if test "$produced_file" != "$DIST_FILE" ; then + mv "$produced_file" "$DIST_FILE" + fi +fi diff --git a/.buildbot/undist/01-unpack.sh b/.buildbot/undist/01-unpack.sh new file mode 100644 index 0000000..7dd4099 --- /dev/null +++ b/.buildbot/undist/01-unpack.sh @@ -0,0 +1,23 @@ +if test -z "$DIST_FORMAT" ; then + DIST_FORMAT="gztar" +fi + +if test -z "$DIST_FILE" ; then + echo "Environment variable DIST_FILE must not be empty" >&2 + exit 1 +fi + +if test -n "$INSTALL_DIR" ; then + mkdir -p "$INSTALL_DIR" + set -- --strip-components=1 -C "$INSTALL_DIR" +fi + +case "$DIST_FORMAT" in +gztar) + tar -xzf "$DIST_FILE" $* + ;; +*) + echo "Unsupported DIST_FORMAT ($DIST_FORMAT)" >&2 + exit 1 + ;; +esac diff --git a/MANIFEST.in b/MANIFEST.in index 91c5678..fa47c47 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,28 @@ +# common dist files +include README.rst INSTALL.rst +include setup.py requirements.txt +# dav_base recursive-include dav_base/console_scripts/django_project_config *.py recursive-include dav_base/static * recursive-include dav_base/templates * +# dav_auth include dav_auth/module.json recursive-include dav_auth/django_project_config *.py recursive-include dav_auth/templates * +# dav_events include dav_events/module.json recursive-include dav_events/django_project_config *.py recursive-include dav_events/templates * +# dav_registration +include dav_registration/module.json +recursive-include dav_registration/django_project_config *.py +recursive-include dav_registration/static * +recursive-include dav_registration/templates * +# dav_event_office +include dav_event_office/module.json +recursive-include dav_event_office/django_project_config *.py +recursive-include dav_event_office/templates * +# dav_submission +include dav_submission/module.json +recursive-include dav_submission/django_project_config *.py +recursive-include dav_submission/templates * From 83864312388739ef464e1ef6e2f7edcb9cb35e54 Mon Sep 17 00:00:00 2001 From: Jens Kleineheismann Date: Thu, 23 Apr 2020 12:33:51 +0200 Subject: [PATCH 2/4] FIX: corrected paths within CI/CD chain --- .buildbot/deploy/10-collectstatic.sh | 2 +- .buildbot/deploy/99-trigger_wsgi_reload.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildbot/deploy/10-collectstatic.sh b/.buildbot/deploy/10-collectstatic.sh index 125d422..b931baf 100644 --- a/.buildbot/deploy/10-collectstatic.sh +++ b/.buildbot/deploy/10-collectstatic.sh @@ -1 +1 @@ -python manage.py collectstatic --no-input +python env/django/manage.py collectstatic --no-input diff --git a/.buildbot/deploy/99-trigger_wsgi_reload.sh b/.buildbot/deploy/99-trigger_wsgi_reload.sh index 817be12..292460b 100644 --- a/.buildbot/deploy/99-trigger_wsgi_reload.sh +++ b/.buildbot/deploy/99-trigger_wsgi_reload.sh @@ -1 +1 @@ -touch conf/wsgi.py +touch env/django/main/wsgi.py From 60ec7bd29f914da399a1a655b64b29af38e76957 Mon Sep 17 00:00:00 2001 From: Jens Kleineheismann Date: Thu, 23 Apr 2020 13:20:49 +0200 Subject: [PATCH 3/4] UPD: changed the django env directory name --- .buildbot/deploy/02-setup.sh | 10 +++++++++- .buildbot/deploy/03-allowed_hosts.sh | 2 +- .buildbot/deploy/10-collectstatic.sh | 2 +- .buildbot/deploy/99-trigger_wsgi_reload.sh | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.buildbot/deploy/02-setup.sh b/.buildbot/deploy/02-setup.sh index ffc32c2..36af0ef 100644 --- a/.buildbot/deploy/02-setup.sh +++ b/.buildbot/deploy/02-setup.sh @@ -1,5 +1,13 @@ -django-dav-admin setup env/django +django-dav-admin setup djangoenv python env/django/manage.py enable_module dav_auth python env/django/manage.py enable_module dav_events python env/django/manage.py enable_module dav_registration python env/django/manage.py enable_module dav_event_office + +if test -n "$ROOT_URI" ; then + cat <> djangoenv/main/settings.py + +STATIC_URL = '${ROOT_URI}/static/' + +E-O-H +fi diff --git a/.buildbot/deploy/03-allowed_hosts.sh b/.buildbot/deploy/03-allowed_hosts.sh index c6ff185..b2d4dda 100644 --- a/.buildbot/deploy/03-allowed_hosts.sh +++ b/.buildbot/deploy/03-allowed_hosts.sh @@ -1 +1 @@ -echo "ALLOWED_HOSTS = ['*']" >> env/django/main/settings.py +echo "ALLOWED_HOSTS = ['*']" >> djangoenv/main/settings.py diff --git a/.buildbot/deploy/10-collectstatic.sh b/.buildbot/deploy/10-collectstatic.sh index b931baf..b8a1cfe 100644 --- a/.buildbot/deploy/10-collectstatic.sh +++ b/.buildbot/deploy/10-collectstatic.sh @@ -1 +1 @@ -python env/django/manage.py collectstatic --no-input +python djangoenv/manage.py collectstatic --no-input diff --git a/.buildbot/deploy/99-trigger_wsgi_reload.sh b/.buildbot/deploy/99-trigger_wsgi_reload.sh index 292460b..55dd0e3 100644 --- a/.buildbot/deploy/99-trigger_wsgi_reload.sh +++ b/.buildbot/deploy/99-trigger_wsgi_reload.sh @@ -1 +1 @@ -touch env/django/main/wsgi.py +touch djangoenv/main/wsgi.py From e4b9ceadaee4c95197b7bb46db709b3a4df5525f Mon Sep 17 00:00:00 2001 From: Jens Kleineheismann Date: Thu, 23 Apr 2020 13:54:09 +0200 Subject: [PATCH 4/4] FIX: corrected path to manage.py within CI/CD chain --- .buildbot/deploy/02-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.buildbot/deploy/02-setup.sh b/.buildbot/deploy/02-setup.sh index 36af0ef..596681d 100644 --- a/.buildbot/deploy/02-setup.sh +++ b/.buildbot/deploy/02-setup.sh @@ -1,8 +1,8 @@ django-dav-admin setup djangoenv -python env/django/manage.py enable_module dav_auth -python env/django/manage.py enable_module dav_events -python env/django/manage.py enable_module dav_registration -python env/django/manage.py enable_module dav_event_office +python djangoenv/manage.py enable_module dav_auth +python djangoenv/manage.py enable_module dav_events +python djangoenv/manage.py enable_module dav_registration +python djangoenv/manage.py enable_module dav_event_office if test -n "$ROOT_URI" ; then cat <> djangoenv/main/settings.py