Rename install-yarn to ensure-yarn for consistency

The old role will be kept and include ensure-yarn for backwards-compatability.

Change-Id: I7631c7e588bc953d6e3b22759abe66a73ffca728
This commit is contained in:
vass 2020-04-01 19:57:01 +02:00 committed by Mohammed Naser
parent ac72b44911
commit 0b4ed70366
10 changed files with 34 additions and 29 deletions

View File

@ -3,6 +3,7 @@ Javascript Roles
.. zuul:autorole:: ensure-javascript-packages
.. zuul:autorole:: ensure-nodejs
.. zuul:autorole:: ensure-yarn
.. zuul:autorole:: fetch-javascript-content-tarball
.. zuul:autorole:: fetch-javascript-output
.. zuul:autorole:: fetch-javascript-tarball

View File

@ -1,5 +1,5 @@
- hosts: all
roles:
- ensure-nodejs
- install-yarn
- ensure-yarn
- ensure-javascript-packages

View File

@ -0,0 +1,13 @@
Install yarn from yarnpkg repos
**Role Variables**
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
The directory to work in.
.. zuul:rolevar:: yarn_lock_file_path
:default: {{ zuul_work_dir }}/yarn.lock
Path to yarn.lock file used by a project.

View File

@ -0,0 +1,15 @@
- name: Check for yarn.lock file
stat:
path: "{{ yarn_lock_file_path }}"
get_checksum: false
get_mime: false
get_md5: false
register: yarn_lock
- name: Install yarn if needed
include: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
when:
- yarn_lock.stat.exists

View File

@ -1,13 +1 @@
Install yarn from yarnpkg repos
**Role Variables**
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
The directory to work in.
.. zuul:rolevar:: yarn_lock_file_path
:default: {{ zuul_work_dir }}/yarn.lock
Path to yarn.lock file used by a project.
.. warning:: Deprecated, use ensure-yarn instead.

View File

@ -1,15 +1,3 @@
- name: Check for yarn.lock file
stat:
path: "{{ yarn_lock_file_path }}"
get_checksum: false
get_mime: false
get_md5: false
register: yarn_lock
- name: Install yarn if needed
include: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
when:
- yarn_lock.stat.exists
- name: Include ensure-yarn.
include_role:
name: ensure-yarn