Allow the build to be done without the install tasks
In order to cater for the option of doing a build without doing the installation tasks too (as one might do in CI), a flag has been added.
This commit is contained in:
parent
1eb3ac2ba2
commit
7a8b10fdf9
@ -60,6 +60,10 @@ venv_pip_install_args: ""
|
|||||||
# re-use the venv in subsequent deployments.
|
# re-use the venv in subsequent deployments.
|
||||||
venv_reuse_enable: yes
|
venv_reuse_enable: yes
|
||||||
|
|
||||||
|
# Enable the ability to *only* do the build, so that
|
||||||
|
# the deploy host can be pre-populated with the venvs.
|
||||||
|
venv_reuse_build_only: no
|
||||||
|
|
||||||
# The path where a built venv should be stored on the
|
# The path where a built venv should be stored on the
|
||||||
# deployment host. By default, ensure that the location
|
# deployment host. By default, ensure that the location
|
||||||
# separates venvs per distribution and architecture to
|
# separates venvs per distribution and architecture to
|
||||||
|
@ -25,8 +25,10 @@
|
|||||||
- include_tasks: "python_venv_install.yml"
|
- include_tasks: "python_venv_install.yml"
|
||||||
when:
|
when:
|
||||||
- venv_reuse_enable | bool
|
- venv_reuse_enable | bool
|
||||||
|
- not venv_reuse_build_only | bool
|
||||||
- _src_venv_present.stat.exists | bool
|
- _src_venv_present.stat.exists | bool
|
||||||
|
|
||||||
- include_tasks: "python_venv_set_facts.yml"
|
- include_tasks: "python_venv_set_facts.yml"
|
||||||
when:
|
when:
|
||||||
|
- not venv_reuse_build_only | bool
|
||||||
- venv_facts_when_changed != []
|
- venv_facts_when_changed != []
|
||||||
|
@ -21,6 +21,17 @@
|
|||||||
when:
|
when:
|
||||||
- venv_destination_path is not defined
|
- venv_destination_path is not defined
|
||||||
|
|
||||||
|
- name: Verify that venv_reuse_enable and venv_reuse_build_only are not interfering with each other
|
||||||
|
fail:
|
||||||
|
msg: |
|
||||||
|
If venv_reuse_build_only is enabled, then venv_reuse_enable must also
|
||||||
|
be enabled.
|
||||||
|
The variable venv_reuse_enable is set to {{ venv_reuse_enable }}.
|
||||||
|
The variable venv_reuse_build_only is set to {{ venv_reuse_build_only }}.
|
||||||
|
when:
|
||||||
|
- venv_reuse_build_only | bool
|
||||||
|
- not venv_reuse_enable | bool
|
||||||
|
|
||||||
- name: Ensure that venv_reuse_download_path exists on the deployment host
|
- name: Ensure that venv_reuse_download_path exists on the deployment host
|
||||||
file:
|
file:
|
||||||
path: "{{ venv_reuse_download_path }}"
|
path: "{{ venv_reuse_download_path }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user