Skip to content

Commit

Permalink
Add an optional flag to use pip's --upgrade flag for installing depen…
Browse files Browse the repository at this point in the history
…dencies.

Fixes #143.
  • Loading branch information
YPCrumble committed Jul 30, 2021
1 parent 7dd9370 commit 5b75119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions roles/web/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ project_path: "{{ virtualenv_path }}/{{ project_name }}"
application_log_dir: "{{ virtualenv_path }}/logs"
application_log_file: "{{ application_log_dir }}/gunicorn_supervisor.log"
requirements_file: "{{ project_path }}/requirements.txt"
pip_use_upgrade_flag: false


# Gunicorn settings.
Expand Down
5 changes: 4 additions & 1 deletion roles/web/tasks/setup_django_app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---

- name: Install packages required by the Django app inside virtualenv
pip: virtualenv={{ virtualenv_path }} requirements={{ requirements_file }}
pip:
virtualenv: "{{ virtualenv_path }}"
requirements: "{{ requirements_file }}"
extra_args: "{{ pip_use_upgrade_flag | ternary('--upgrade', omit) }}"

- name: Run the Django syncdb command
django_manage:
Expand Down

0 comments on commit 5b75119

Please sign in to comment.