Skip to content

Commit

Permalink
setup/update - fixed RPi.GPIO installation, updated db-schema-update-…
Browse files Browse the repository at this point in the history
…script
  • Loading branch information
superstes committed Oct 29, 2021
1 parent c7ce74b commit 8fb8bfb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup/roles/update/tasks/prep/version_after_git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- name: GA | Update | Prep | Version | After-Git | Setting commit version
ansible.builtin.set_fact:
ga_update_commit_new: "{{ ga_raw_commit.stdout }}"
ga_update_commit_new: "{{ ga_raw_commit.stdout[:8] }}"
changed_when: false
when: ga_update_type == 'release'

Expand Down
5 changes: 4 additions & 1 deletion setup/roles/update/tasks/process/do.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
}
- {
src: "{{ ga_update_path_repo }}/code/web/base/", dst: "{{ ga_update_path_web }}/",
opts: ['--exclude=*.cnf', '--exclude=*.conf', '--exclude=migrations/*', '--exclude=__pycache__/', '--exclude=static/', '--exclude=base/config.py']
opts: [
'--exclude=*.cnf', '--exclude=*.conf', '--exclude=migrations/*', '--exclude=__pycache__/', '--exclude=static/', '--exclude=base/config.py',
'--exclude=update_schema.sh',
]
}
- {src: "{{ ga_update_path_repo }}/code/web/base/static/", dst: "{{ ga_update_path_web_static }}/"}
ignore_errors: true
Expand Down
6 changes: 5 additions & 1 deletion setup/roles/web/templates/var/www/ga/update_schema.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ WEB_PATH='{{ ga_web_path }}'
VENV_PATH='{{ ga_web_path_venv }}'
CORE_PATH='{{ ga_core_path }}'

PYVER=`ls ${VENV_PATH} | grep python | cut -d ' ' -f1`

export DJANGO_SETTINGS_MODULE=base.settings
export PYTHONPATH=${WEB_PATH}:${CORE_PATH}:${VENV_PATH}/lib/python{{ ga_python_version }}/site-packages
export PYTHONPATH=${WEB_PATH}:${CORE_PATH}:${VENV_PATH}/lib/${PYVER}/site-packages

systemctl stop ga_core.service
cd ${WEB_PATH}
source ${VENV_PATH}/bin/activate
${VENV_PATH}/bin/python3 manage.py makemigrations && ${VENV_PATH}/bin/python3 manage.py migrate && sudo systemctl restart apache2.service
systemctl start ga_core.service
2 changes: 2 additions & 0 deletions setup/vars/hardcoded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ga_device_groups:

ga_device_mods:
- 'smbus'
- 'RPi.GPIO2'
- 'RPi.GPIO==0.7.1a4' # 2021-10-29: python3.9 fails to build other version..
- 'adafruit-circuitpython-dht'
- 'adafruit-circuitpython-ads1x15'
- 'adafruit-circuitpython-mcp3xxx'
Expand Down

0 comments on commit 8fb8bfb

Please sign in to comment.