5973c9b7b1
The pre-playbook for the javascript jobs got complex. Extract it to a role so we can better document it. Also - stop installing javascript depends in pre - the depends declared in a patch should be tested as part of the patch. Change-Id: I50a483f223620cd3f9ecd82887062cfc9ac64b7f
25 lines
594 B
YAML
25 lines
594 B
YAML
- 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
|
|
get_md5: false
|
|
register: yarn_lock_exists
|
|
|
|
- name: Set js_build_tool fact
|
|
set_fact:
|
|
js_build_tool: '{{ yarn_lock_exists.stat.exists | ternary("yarn", "npm") }}'
|
|
cacheable: true
|
|
when: js_build_tool is not defined
|
|
|
|
- name: Ensure yarn if needed
|
|
include_role:
|
|
name: ensure-yarn
|
|
when: js_build_tool == 'yarn'
|
|
|
|
- name: Ensure nodejs if needed
|
|
include_role:
|
|
name: ensure-nodejs
|
|
when: js_build_tool == 'npm'
|