Skip to content

Commit c0b5a93

Browse files
authored
Merge pull request #304 from plone/fixDockerfilebuild
Fix dockerfilebuild
2 parents 697694b + fd45622 commit c0b5a93

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ jobs:
138138
name: Setup pnpm cache
139139
with:
140140
path: ${{ env.STORE_PATH }}
141-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
141+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
142142
restore-keys: |
143143
${{ runner.os }}-pnpm-store-
144144
@@ -147,13 +147,19 @@ jobs:
147147
uses: actions/cache@v4
148148
with:
149149
path: ~/.cache/Cypress
150-
key: binary-${{ env.node-version }}-${{ hashFiles('volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
150+
key: Cypress-binary-${{ env.node-version }}-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
151151

152152
- name: Install generated package
153153
working-directory: ${{ env.name }}
154154
run: |
155155
make install
156156
157+
- name: Install Cypress if not in cache
158+
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
159+
working-directory: ${{ env.name }}
160+
shell: bash
161+
run: 'NODEBIN=$(pnpm bin) && $NODEBIN/cypress install'
162+
157163
- name: Run unit tests
158164
working-directory: ${{ env.name }}
159165
run: |
@@ -261,13 +267,19 @@ jobs:
261267
uses: actions/cache@v4
262268
with:
263269
path: ~/.cache/Cypress
264-
key: binary-${{ env.node-version-prerelease }}-${{ hashFiles('volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
270+
key: Cypress-binary-${{ env.node-version }}-${{ hashFiles('volto-add-on/pnpm-lock.yaml', 'volto-add-on/package.json','volto-add-on/mrs.developer.json') }}
265271

266272
- name: Install generated package
267273
working-directory: ${{ env.name }}
268274
run: |
269275
make install
270276
277+
- name: Install Cypress if not in cache
278+
if: steps.cache-cypress-binary.outputs.cache-hit != 'true'
279+
working-directory: ${{ env.name }}
280+
shell: bash
281+
run: 'NODEBIN=$(pnpm bin) && $NODEBIN/cypress install'
282+
271283
- name: Run unit tests
272284
working-directory: ${{ env.name }}
273285
run: |

news/+pnpm10build.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed Dockerfile build command because pnpm complains about ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY. @sneridagh

templates/add-ons/seven_addon/{{ cookiecutter.__folder_name }}/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ RUN --mount=type=cache,id=pnpm,target=/app/.pnpm-store,uid=1000 <<EOT
1717
(cd core && git fetch --depth 1 origin seven:seven && git checkout seven)
1818
pnpm install && make build-deps
1919
pnpm build
20-
pnpm install --prod
20+
# This is necessary because the build is trying to recreate the node_modules folder
21+
# by telling it to CI=1 it will just recreate them
22+
CI=1 pnpm install --prod
2123
EOT
2224

2325
FROM plone/frontend-prod-config:${VOLTO_VERSION}

templates/sub/project_settings/{{ cookiecutter.__folder_name }}/frontend/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ RUN --mount=type=cache,id=pnpm,target=/app/.pnpm-store,uid=1000 <<EOT
1616
pnpm dlx mrs-developer missdev --no-config --fetch-https
1717
pnpm install && pnpm build:deps
1818
pnpm build
19-
pnpm install --prod
19+
# This is necessary because the build is trying to recreate the node_modules folder
20+
# by telling it to CI=1 it will just recreate them
21+
CI=1 pnpm install --prod
2022
EOT
2123

2224
FROM plone/frontend-prod-config:${VOLTO_VERSION}

0 commit comments

Comments
 (0)