d8ec17cab0
The get_md5 parameter was removed with ansible 9. https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_9.html#id44 If it is being used the following error appears: "Unsupported parameters for (stat) module: get_md5..." Unrelated, but also blocking testing/merging of this change, the Ansible version specs for older python versions is loosened to allow installing older versions of Ansible on test nodes (like focal) that have older pythons that are unsupported by newer Ansible. Change-Id: I99dd4f16fde659d84eb3dfa191557b3d9508b0fb
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
- name: Require js_build_command variable
|
|
fail:
|
|
msg: js_build_command is required for this role
|
|
when:
|
|
- js_build_command is not defined
|
|
- npm_command is not defined
|
|
|
|
# Set this unconditionally because people who were using old
|
|
# versions of things with npm_command to override don't want to
|
|
# stop overriding. We can remove this once we remove the npm
|
|
# versions of the jobs.
|
|
- name: Set js_build_command to npm_command for backwards compat
|
|
when: npm_command is defined
|
|
set_fact:
|
|
js_build_command: '{{ npm_command }}'
|
|
|
|
- name: Check for yarn.lock
|
|
when: js_build_tool is not defined
|
|
stat:
|
|
path: "{{ zuul_work_dir }}/yarn.lock"
|
|
get_checksum: false
|
|
get_mime: false
|
|
register: yarn_lock_exists
|
|
|
|
- name: Set js_build_tool fact
|
|
set_fact:
|
|
js_build_tool: '{{ yarn_lock_exists.stat.exists | ternary("yarn", "npm") }}'
|
|
when: js_build_tool is not defined
|
|
|
|
- name: Install javascript depends
|
|
include_role:
|
|
name: ensure-javascript-packages
|
|
|
|
- name: Run js build command
|
|
command: "{{ js_build_tool }} {% if js_build_command not in npm_lifecycle_phases %} run {% endif %} {{ js_build_command }}"
|
|
# Need to set DISPLAY to the value that will be set when the virtual
|
|
# framebuffer is set up for doing browser tests.
|
|
environment:
|
|
DISPLAY: ':99'
|
|
CI: 'true'
|
|
args:
|
|
chdir: "{{ zuul_work_dir }}"
|