Update deployment after new release
This commit is contained in:
parent
cf8ad6c823
commit
7b924d3813
3 changed files with 11 additions and 32 deletions
39
tasks.yml
39
tasks.yml
|
|
@ -12,37 +12,16 @@
|
|||
version: '{{ app_branch }}'
|
||||
update: yes
|
||||
|
||||
- name: include poetry tasks
|
||||
include_role:
|
||||
name: common
|
||||
tasks_from: 'poetry.yml'
|
||||
vars:
|
||||
poetry_user: '{{ ansible_user_id }}'
|
||||
poetry_dir: '{{ ansible_env.HOME }}/.poetry'
|
||||
- name: create virtualenv
|
||||
pip:
|
||||
requirements: '{{ app_dir }}/requirements/production.txt'
|
||||
virtualenv: '{{ app_dir }}/env'
|
||||
virtualenv_python: python3
|
||||
|
||||
- name: run poetry tasks
|
||||
block:
|
||||
- name: retrieve user $PATH
|
||||
shell: 'echo $PATH'
|
||||
register: path_stats
|
||||
|
||||
- name: set poetry user variables
|
||||
set_fact:
|
||||
poetry_user_path: '{{ path_stats.stdout }}'
|
||||
|
||||
- name: set default venv python version
|
||||
command: 'poetry env use python3.9'
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
environment:
|
||||
PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}'
|
||||
|
||||
- name: install project dependencies
|
||||
command: 'poetry install --no-dev --extras sentry'
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
environment:
|
||||
PATH: '/home/{{ app_user }}/.local/bin:{{ poetry_user_path }}'
|
||||
- name: install the package
|
||||
command: 'env/bin/pip install --no-dependencies .'
|
||||
args:
|
||||
chdir: '{{ app_dir }}'
|
||||
|
||||
- name: create ssh directory
|
||||
file:
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ Description=Transip-client service
|
|||
[Service]
|
||||
EnvironmentFile={{ app_dir }}/.env
|
||||
WorkingDirectory={{ app_dir }}
|
||||
ExecStart={{ ansible_env.HOME }}/.local/bin/poetry run listen
|
||||
ExecStart={{ app_dir }}/env/bin/transip-listen
|
||||
Type=oneshot
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
app_url: 'https://git.fudiggity.nl/sonny/transip_client.git'
|
||||
app_user: 'sonny'
|
||||
app_branch: '0.4'
|
||||
app_branch: '0.5.1'
|
||||
app_dir: '{{ ansible_env.HOME }}/apps/transip_client'
|
||||
app_domains:
|
||||
- fudiggity.nl
|
||||
|
|
|
|||
Reference in a new issue