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.
|
||||
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
|
||||
# deployment host. By default, ensure that the location
|
||||
# separates venvs per distribution and architecture to
|
||||
|
@ -25,8 +25,10 @@
|
||||
- include_tasks: "python_venv_install.yml"
|
||||
when:
|
||||
- venv_reuse_enable | bool
|
||||
- not venv_reuse_build_only | bool
|
||||
- _src_venv_present.stat.exists | bool
|
||||
|
||||
- include_tasks: "python_venv_set_facts.yml"
|
||||
when:
|
||||
- not venv_reuse_build_only | bool
|
||||
- venv_facts_when_changed != []
|
||||
|
@ -21,6 +21,17 @@
|
||||
when:
|
||||
- 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
|
||||
file:
|
||||
path: "{{ venv_reuse_download_path }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user