Skip to content

Commit

Permalink
fix: Change venv to vagrant_venv
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Jan 2, 2025
1 parent 40a1338 commit a752bb7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build/
htmlcov/
.pytest_cache
venv/
vagrant_venv/
ubuntu-bionic-18.04-cloudimg-console.log
.vagrant/
nginx.prod.ssl.conf
Expand Down
12 changes: 3 additions & 9 deletions vagrant/04_install_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,14 @@
args:
executable: /bin/bash

- name: Remove existing virtual environment if it exists
file:
path: "{{ working_dir }}/venv"
state: absent
force: yes

- name: Set up the Python 3.12 virtual environment
command: python3.12 -m venv {{ working_dir }}/venv
command: python3.12 -m venv {{ working_dir }}/vagrant_venv
args:
creates: "{{ working_dir }}/venv/bin/activate"
creates: "{{ working_dir }}/vagrant_venv/bin/activate"

- name: Activate the virtual environment and install dependencies
shell: |
source {{ working_dir }}/venv/bin/activate
source {{ working_dir }}/vagrant_venv/bin/activate
pip install --upgrade pip
cd {{ working_dir }}
pip install -r requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions vagrant/05_run_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

- name: Set database with Rosemary
shell: |
source {{ working_dir }}venv/bin/activate
source {{ working_dir }}vagrant_venv/bin/activate
cd {{ working_dir }}
flask db upgrade
rosemary db:seed -y --reset
Expand All @@ -36,7 +36,7 @@

- name: Run Flask application
shell: |
source {{ working_dir }}venv/bin/activate
source {{ working_dir }}vagrant_venv/bin/activate
cd {{ working_dir }}
nohup flask run --host=0.0.0.0 --port=5000 --reload --debug > app.log 2>&1 &
args:
Expand Down
2 changes: 1 addition & 1 deletion vagrant/06_utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
line: '{{ item }}'
create: yes
with_items:
- 'source {{ working_dir }}venv/bin/activate'
- 'source {{ working_dir }}vagrant_venv/bin/activate'
- 'cd {{ working_dir }}'
when: ansible_user == 'vagrant'

0 comments on commit a752bb7

Please sign in to comment.