Skip to content

Commit

Permalink
Merge pull request #46 from caktus/TEQ-86
Browse files Browse the repository at this point in the history
[TEQ-86] Add variable which allows virtualenv to be deleted.
  • Loading branch information
vkurup authored Aug 6, 2019
2 parents 1ea0965 + 28373af commit 2fa0e5f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Tequila-django

Changes

v 0.9.24 on Jul 5, 2019
-----------------------

* Add variable ``force_recreate_venv`` to allow virtualenv to be deleted, forcing
it to be refreshed from scratch.


v 0.9.23 on Apr 8, 2019
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016, Caktus Consulting Group, LLC
Copyright (c) 2016-2019, Caktus Consulting Group, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ The following variables are used by the ``tequila-django`` role:
- ``root_dir`` **default:** ``"/var/www/{{ project_name }}"``
- ``source_dir`` **default:** ``"{{ root_dir }}/src"``
- ``venv_dir`` **default:** ``"{{ root_dir }}/env"``
- ``force_recreate_venv`` **default:** ``false``
- ``ssh_dir`` **default:** ``"/home/{{ project_user }}/.ssh"``
- ``requirements_file`` **default:** ``"{{ source_dir }}/requirements/{{ env_name }}.txt"``
- ``requirements_extra_args`` **default:** ``""``
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python_version: "2.7"
root_dir: "/var/www/{{ project_name }}"
source_dir: "{{ root_dir }}/src"
venv_dir: "{{ root_dir }}/env"
force_recreate_venv: false
ssh_dir: "/home/{{ project_user }}/.ssh"
requirements_file: "{{ source_dir }}/requirements/{{ env_name }}.txt"
project_user: "{{ project_name }}"
Expand Down
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@
vars:
ansible_ssh_pipelining: true

# allow user to force recreation of venv by passing force_recreate_venv=1 to the deploy command
- name: force recreation of virtualenv
file:
path: "{{ venv_dir }}"
state: absent
when: force_recreate_venv

# Kept running into AttributeError: '_NamespacePath' object has no attribute 'sort'
# https://github.com/pypa/setuptools/issues/885#issuecomment-387711115
# Fix is to force most recent setuptools
Expand Down

0 comments on commit 2fa0e5f

Please sign in to comment.