Skip to content

Commit 7058f62

Browse files
authored
Merge pull request #242 from mvdbeek/pnpm
Use pnpm on 26.0
2 parents 0a5970e + 93fd6fe commit 7058f62

File tree

3 files changed

+68
-7
lines changed

3 files changed

+68
-7
lines changed

tasks/_inc_client_build_steps.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55

66
- name: Install packages with yarn
77
yarn:
8-
executable: "{{ __galaxy_major_version is version('25.1', '>=') | ternary('corepack ', '') }}yarn --network-timeout 300000 --check-files"
8+
executable: "yarn --network-timeout 300000 --check-files"
99
path: "{{ galaxy_server_dir }}/client"
1010
environment:
1111
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
1212
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
13+
when: __galaxy_major_version is version('26.0', '<')
14+
15+
- name: Install packages with pnpm
16+
command: "pnpm install"
17+
args:
18+
chdir: "{{ galaxy_server_dir }}/client"
19+
environment:
20+
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
21+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
22+
when: __galaxy_major_version is version('26.0', '>=')
1323

1424
- name: Ensure deconstructed build is supported
1525
assert:
@@ -19,29 +29,52 @@
1929
fail_msg: "Deconstructed client build is not supported for Galaxy version {{ __galaxy_major_version }}, please set 'galaxy_client_make_target'"
2030

2131
- name: Run gulp # noqa no-changed-when
22-
command: "{{ __galaxy_major_version is version('25.1', '>=') | ternary('corepack ', '') }}yarn run gulp {{ item }}"
32+
command: "yarn run gulp {{ item }}"
2333
args:
2434
chdir: "{{ galaxy_server_dir }}/client"
2535
with_items: "{{ galaxy_client_build_steps[__galaxy_major_version] | default(galaxy_client_build_steps.default) }}"
2636
environment:
2737
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
2838
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
2939
NODE_ENV: "{{ galaxy_client_node_env }}"
40+
when: __galaxy_major_version is version('26.0', '<')
41+
42+
- name: Build plugins # noqa no-changed-when
43+
command: "pnpm run plugins"
44+
args:
45+
chdir: "{{ galaxy_server_dir }}/client"
46+
environment:
47+
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
48+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
49+
NODE_ENV: "{{ galaxy_client_node_env }}"
50+
when: __galaxy_major_version is version('26.0', '>=')
3051

3152
- name: Run webpack # noqa no-changed-when
32-
command: "{{ __galaxy_major_version is version('25.1', '>=') | ternary('corepack ', '') }}yarn run webpack{{ (galaxy_client_node_env == 'production') | ternary('-production', '') }}"
53+
command: "yarn run webpack{{ (galaxy_client_node_env == 'production') | ternary('-production', '') }}"
54+
args:
55+
chdir: "{{ galaxy_server_dir }}/client"
56+
environment:
57+
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
58+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
59+
NODE_OPTIONS: --max_old_space_size=8192
60+
when: __galaxy_major_version is version('26.0', '<')
61+
62+
- name: Run client build # noqa no-changed-when
63+
command: "pnpm run build-production"
3364
args:
3465
chdir: "{{ galaxy_server_dir }}/client"
3566
environment:
3667
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
3768
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
3869
NODE_OPTIONS: --max_old_space_size=8192
70+
SKIP_VIZ: "1"
71+
when: __galaxy_major_version is version('26.0', '>=')
3972

4073
- name: Stage built client
41-
command: "{{ __galaxy_major_version is version('25.1', '>=') | ternary('corepack ', '') }}yarn run stage-build"
74+
command: "yarn run stage-build"
4275
args:
4376
chdir: "{{ galaxy_server_dir }}/client"
4477
environment:
4578
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
4679
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
47-
when: "__galaxy_major_version is version('23.0', '>=')"
80+
when: __galaxy_major_version is version('23.0', '>=') and __galaxy_major_version is version('26.0', '<')

tasks/_inc_client_install_tools.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
include_tasks: _inc_galaxy_version.yml
44
when: __galaxy_major_version is undefined
55

6+
- name: Enable corepack shims # noqa no-changed-when
7+
command: "corepack enable --install-directory {{ galaxy_venv_dir }}/bin"
8+
environment:
9+
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
10+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
11+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
12+
when: __galaxy_major_version is version('25.1', '>=')
13+
614
- name: Install client build tools
715
when: __galaxy_major_version is version('25.1', '<')
816
block:

tasks/client.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,35 @@
8080
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
8181
register: __yarn_install
8282
changed_when: "'already up-to-date' not in __yarn_install.out | lower"
83+
when: __galaxy_major_version is version('26.0', '<')
8384

84-
- name: Stage prebuilt client # noqa no-changed-when
85+
- name: Install prebuilt client with pnpm
86+
command: "pnpm install"
87+
args:
88+
chdir: "{{ galaxy_server_dir }}"
89+
environment:
90+
PATH: "{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
91+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
92+
register: __pnpm_install
93+
when: __galaxy_major_version is version('26.0', '>=')
94+
95+
- name: Stage prebuilt client (yarn) # noqa no-changed-when
8596
command: "yarn run stage"
8697
args:
8798
chdir: "{{ galaxy_server_dir }}"
8899
environment:
89100
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
90101
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
91-
when: __yarn_install.changed
102+
when: __galaxy_major_version is version('26.0', '<') and __yarn_install.changed
103+
104+
- name: Stage prebuilt client (pnpm) # noqa no-changed-when
105+
command: "pnpm run stage"
106+
args:
107+
chdir: "{{ galaxy_server_dir }}"
108+
environment:
109+
PATH: "{{ galaxy_server_dir }}/client/node_modules/.bin:{{ galaxy_venv_dir }}/bin:{{ ansible_env.PATH }}"
110+
VIRTUAL_ENV: "{{ galaxy_venv_dir }}"
111+
when: __galaxy_major_version is version('26.0', '>=') and __pnpm_install.changed
92112

93113
remote_user: "{{ galaxy_remote_users.privsep | default(__galaxy_remote_user) }}"
94114
become: "{{ true if galaxy_become_users.privsep is defined else __galaxy_become }}"

0 commit comments

Comments
 (0)