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:
parent
ac72b44911
commit
0b4ed70366
@ -3,6 +3,7 @@ Javascript Roles
|
|||||||
|
|
||||||
.. zuul:autorole:: ensure-javascript-packages
|
.. zuul:autorole:: ensure-javascript-packages
|
||||||
.. zuul:autorole:: ensure-nodejs
|
.. zuul:autorole:: ensure-nodejs
|
||||||
|
.. zuul:autorole:: ensure-yarn
|
||||||
.. zuul:autorole:: fetch-javascript-content-tarball
|
.. zuul:autorole:: fetch-javascript-content-tarball
|
||||||
.. zuul:autorole:: fetch-javascript-output
|
.. zuul:autorole:: fetch-javascript-output
|
||||||
.. zuul:autorole:: fetch-javascript-tarball
|
.. zuul:autorole:: fetch-javascript-tarball
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- hosts: all
|
- hosts: all
|
||||||
roles:
|
roles:
|
||||||
- ensure-nodejs
|
- ensure-nodejs
|
||||||
- install-yarn
|
- ensure-yarn
|
||||||
- ensure-javascript-packages
|
- ensure-javascript-packages
|
||||||
|
13
roles/ensure-yarn/README.rst
Normal file
13
roles/ensure-yarn/README.rst
Normal 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.
|
15
roles/ensure-yarn/tasks/main.yaml
Normal file
15
roles/ensure-yarn/tasks/main.yaml
Normal 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
|
@ -1,13 +1 @@
|
|||||||
Install yarn from yarnpkg repos
|
.. warning:: Deprecated, use ensure-yarn instead.
|
||||||
|
|
||||||
**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.
|
|
||||||
|
@ -1,15 +1,3 @@
|
|||||||
- name: Check for yarn.lock file
|
- name: Include ensure-yarn.
|
||||||
stat:
|
include_role:
|
||||||
path: "{{ yarn_lock_file_path }}"
|
name: ensure-yarn
|
||||||
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user