Skip to content

Commit

Permalink
Merge pull request #185 from YPCrumble/feature/pip-upgrade-flag
Browse files Browse the repository at this point in the history
Add an optional flag to use pip's --upgrade flag for installing depen…
  • Loading branch information
YPCrumble authored Jul 30, 2021
2 parents 437a815 + 5b75119 commit 298b526
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 298b526

Please sign in to comment.