Skip to content

Commit

Permalink
fix: deployment_type catch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Jul 12, 2022
1 parent aa0d939 commit 179c2a1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# CHANGELOG

## NEXT RELEASE
## v0.20.0 (2022-07-11)

- Swaps `gunicorn` for `uwsgi` for better performance. This switch also fixes the concurrency deadlock in production
- Harvey now runs as a daemon which should drastically improve performance
- Drops default processes running from 4 to 2
- Adds a check to ensure the `deployment_type` passed was valid and fails if not

## v0.19.0 (2022-05-22)

Expand Down
2 changes: 2 additions & 0 deletions harvey/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def run_deployment(webhook: Dict[str, Any]):
logger.info(pull_success_message)
final_output = f'{webhook_output}\n{pull_success_message}'
Utils.success(final_output, webhook)
else:
Utils.kill(f'deployment_type invalid, must be one of {Config.supported_deployments}', webhook)

@staticmethod
def open_project_config(webhook: Dict[str, Any]):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

setuptools.setup(
name='harvey-cd',
version='0.19.0',
version='0.20.0',
description='The lightweight Docker Compose deployment platform.',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def test_open_project_config_not_found(mock_utils_kill, mock_webhook):
return_value=[mock_config(deployment_type='pull'), MOCK_OUTPUT, MOCK_TIME],
)
def test_run_deployment_pull(mock_initialize_deployment, mock_utils_success, mock_path_exists, mock_exit, mock_webhook):
# TODO: This test requires the Docker daemon to be running, refactor so it can run without
_ = Deployment.run_deployment(mock_webhook)

mock_initialize_deployment.assert_called_once_with(mock_webhook)
Expand All @@ -97,6 +98,7 @@ def test_run_deployment_pull(mock_initialize_deployment, mock_utils_success, moc
def test_run_deployment_deploy(
mock_initialize_deployment, mock_deploy_deployment, mock_healthcheck, mock_utils_success, mock_webhook
):
# TODO: This test requires the Docker daemon to be running, refactor so it can run without
_ = Deployment.run_deployment(mock_webhook)

mock_initialize_deployment.assert_called_once_with(mock_webhook)
Expand Down
2 changes: 1 addition & 1 deletion uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ die-on-term = true
need-app = true

; concurrency
processes = 4
processes = 2
threads = 2

; app setup
Expand Down

0 comments on commit 179c2a1

Please sign in to comment.