zuul-jobs/roles/npm/tasks/main.yaml
Tristan Cacqueray 645e591256 npm: add CI=true environment
The jest test framework needs this variable to exit after test execution.

Change-Id: I40916716da04b7e86038d05385afc7e24bce6afa
2018-08-15 08:38:08 +00:00

27 lines
804 B
YAML

- name: Require npm_command variable
fail:
msg: npm_command is required for this role
when: npm_command is not defined
- name: Run npm lifecycle command
when: npm_command in npm_lifecycle_phases
command: "npm {{ npm_command }} --verbose"
# 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 }}"
- name: Run npm custom command
when: npm_command not in npm_lifecycle_phases
command: "npm run {{ npm_command }} --verbose"
# 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 }}"