Skip to content

Commit 5a562a9

Browse files
committed
Get rid of inner pnpm tasks. Circumvent eirslett/frontend-maven-plugin/issues/1135
Add a build container for Windows.
1 parent 0e709c0 commit 5a562a9

File tree

6 files changed

+58
-6
lines changed

6 files changed

+58
-6
lines changed

.dev/builder/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM ubuntu:latest
2+
3+
RUN apt update && apt -y install \
4+
maven \
5+
openjdk-17-jdk
6+
7+
RUN curl https://get.docker.com/ | bash -
8+
RUN curl https://get.pnpm.io/install.sh | bash -
9+
10+
COPY . /build
11+
12+
COPY .dev/builder/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
13+
RUN chmod +x /usr/local/bin/entrypoint.sh
14+
15+
WORKDIR /build
16+
17+
ENTRYPOINT ["entrypoint.sh"]
18+
19+
CMD mvn -DskipTests=true -Pprod clean package

.dev/builder/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Run:
2+
```
3+
docker-compose up --renew-anon-volumes --build && docker-compose down
4+
```
5+
6+
-----
7+
To debug run before:
8+
```
9+
#export BUILDKIT_PROGRESS=plain docker compose build
10+
```

.dev/builder/docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3.8'
2+
name: "kafbat_builder"
3+
4+
services:
5+
6+
chonky-builder:
7+
container_name: chonky-builder
8+
build:
9+
context: ../..
10+
dockerfile: .dev/builder/Dockerfile
11+
volumes:
12+
- /var/run/docker.sock:/var/run/docker.sock
13+
- ../..:/build
14+
- node_modules:/build/frontend/node_modules/ # Do not alter this as node_modules might not be transferable between OS w/ different arch
15+
- ${HOME}/.m2/repository:/root/.m2/repository # but it's not the case for maven (which also takes ten times longer to dl)
16+
environment:
17+
- DOCKER_HOST=unix:///var/run/docker.sock
18+
# command: mvn -DskipTests=true -Pprod clean package # this is the default command, feel free to override if needed
19+
20+
volumes:
21+
node_modules:

.dev/builder/docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# The volume is mounted from the host but the contents are intact, need to clean
4+
find /build/frontend/node_modules -mindepth 1 -delete
5+
6+
exec "$@"

frontend/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@
5050
"scripts": {
5151
"start": "vite",
5252
"dev": "vite",
53-
"clean": "rimraf ./src/generated-sources",
5453
"compile": "pnpm gen:sources && tsc --noEmit",
55-
"gen:sources": "pnpm clean && openapi-generator-cli generate",
56-
"build": "pnpm compile && vite build",
54+
"gen:sources": "rimraf ./src/generated-sources && openapi-generator-cli generate",
55+
"build": "rimraf ./src/generated-sources && openapi-generator-cli generate && tsc --noEmit && vite build",
5756
"preview": "vite preview",
5857
"lint": "eslint --ext .tsx,.ts src/",
5958
"lint:fix": "eslint --ext .tsx,.ts src/ --fix",

frontend/src/react-app-env.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)