From a2549f344788f96c5660b0f5ba0aa28dc61f96ec Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Mar 02 2018 15:03:14 +0000 Subject: [PATCH 1/2] Improve docker-compose and documentation This commits makes the current docker-compose.yml to work with the latest version of docker-compose, documentation on creating the initial directories are added to the docker-compose section. Signed-off-by: Farhaan Bukhsh --- diff --git a/README.rst b/README.rst index 538c198..b7767fe 100644 --- a/README.rst +++ b/README.rst @@ -57,6 +57,10 @@ host machine. Docker Compose ^^^^^^^^^^^^^^ +Create the folder that will receive the projects, forks, docs, requests and +tickets' git repo:: + + mkdir -p lcl/{repos,remotes,attachments,releases} A docker compose environment is available to run pagure. First use the following command to build the containers. :: diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 44c3a0f..aab44ef 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -13,14 +13,8 @@ services: ports: - "5000:5000" volumes: - - type: volume - source: ../lcl/repos - target: /repos - read_only: false - - type: volume - source: ../lcl/attachments - target: /attachments - read_only: false + - ../lcl/repos:/repos + - ../lcl/attachments:/attachments - ..:/code:z worker: build: @@ -31,14 +25,8 @@ services: - postgresql image: pagure-worker:latest volumes: - - type: volume - source: ../lcl/repos - target: /repos - read_only: false - - type: volume - source: ../lcl/attachments - target: /attachments - read_only: true + - ../lcl/repos:/repos + - ../lcl/attachments:/attachments - ..:/code:z environment: - PYTHONPATH=. From 54719fed54d3444b464f8c63ea384947319871ee Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Mar 02 2018 18:57:42 +0000 Subject: [PATCH 2/2] Replace print with debug logs The print statements are not read by docker logs instead using debug statements are better this way the dev server could see the logs and docker logs could them too. Signed-off-by: Farhaan Bukhsh --- diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index aab44ef..0f38c1b 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -26,7 +26,7 @@ services: image: pagure-worker:latest volumes: - ../lcl/repos:/repos - - ../lcl/attachments:/attachments + - ../lcl/attachments:/attachments:ro - ..:/code:z environment: - PYTHONPATH=. diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index e153976..ee18148 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -289,17 +289,17 @@ def send_email(text, subject, to_mail, pagure_config['DOMAIN_EMAIL_NOTIFICATIONS']) msg['Mail-Followup-To'] = msg['Reply-To'] if not pagure_config.get('EMAIL_SEND', True): - print('******EMAIL******') - print('From: %s' % from_email) - print('To: %s' % to_mail) - print('Subject: %s' % subject) - print('in_reply_to: %s' % in_reply_to) - print('mail_id: %s' % mail_id) - print('Contents:') - print(text.encode('utf-8')) - print('*****************') - print(msg.as_string()) - print('*****/EMAIL******') + _log.debug('******EMAIL******') + _log.debug('From: %s', from_email) + _log.debug('To: %s', to_mail) + _log.debug('Subject: %s', subject) + _log.debug('in_reply_to: %s', in_reply_to) + _log.debug('mail_id: %s', mail_id) + _log.debug('Contents:') + _log.debug(text.encode('utf-8')) + _log.debug('*****************') + _log.debug(msg.as_string()) + _log.debug('*****/EMAIL******') continue try: if smtp is None: