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 }}'
|
version: '{{ app_branch }}'
|
||||||
update: yes
|
update: yes
|
||||||
|
|
||||||
- name: include poetry tasks
|
- name: create virtualenv
|
||||||
include_role:
|
pip:
|
||||||
name: common
|
requirements: '{{ app_dir }}/requirements/production.txt'
|
||||||
tasks_from: 'poetry.yml'
|
virtualenv: '{{ app_dir }}/env'
|
||||||
vars:
|
virtualenv_python: python3
|
||||||
poetry_user: '{{ ansible_user_id }}'
|
|
||||||
poetry_dir: '{{ ansible_env.HOME }}/.poetry'
|
|
||||||
|
|
||||||
- name: run poetry tasks
|
- name: install the package
|
||||||
block:
|
command: 'env/bin/pip install --no-dependencies .'
|
||||||
- name: retrieve user $PATH
|
args:
|
||||||
shell: 'echo $PATH'
|
chdir: '{{ app_dir }}'
|
||||||
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: create ssh directory
|
- name: create ssh directory
|
||||||
file:
|
file:
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,5 @@ Description=Transip-client service
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile={{ app_dir }}/.env
|
EnvironmentFile={{ app_dir }}/.env
|
||||||
WorkingDirectory={{ app_dir }}
|
WorkingDirectory={{ app_dir }}
|
||||||
ExecStart={{ ansible_env.HOME }}/.local/bin/poetry run listen
|
ExecStart={{ app_dir }}/env/bin/transip-listen
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
app_url: 'https://git.fudiggity.nl/sonny/transip_client.git'
|
app_url: 'https://git.fudiggity.nl/sonny/transip_client.git'
|
||||||
app_user: 'sonny'
|
app_user: 'sonny'
|
||||||
app_branch: '0.4'
|
app_branch: '0.5.1'
|
||||||
app_dir: '{{ ansible_env.HOME }}/apps/transip_client'
|
app_dir: '{{ ansible_env.HOME }}/apps/transip_client'
|
||||||
app_domains:
|
app_domains:
|
||||||
- fudiggity.nl
|
- fudiggity.nl
|
||||||
|
|
|
||||||
Reference in a new issue