Skip to content

Commit 34fa500

Browse files
alfonsomthdopenshift-cherrypick-robot
authored and
openshift-cherrypick-robot
committed
Build any plugin image with Dockerfile.ci
- Cleanup unnecesary files. Signed-off-by: Alfonso Martínez <[email protected]>
1 parent 728f355 commit 34fa500

File tree

4 files changed

+35
-52
lines changed

4 files changed

+35
-52
lines changed

Dockerfile.ci

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
FROM docker.io/library/node:20.16.0 AS builder
2+
3+
ARG PLUGIN=odf
4+
25
WORKDIR /app
36
COPY . /app
47
RUN yarn install --prod --frozen-lockfile --network-timeout 300000
5-
RUN NODE_OPTIONS="--max-old-space-size=1024" yarn build
8+
RUN BUILD_SCRIPT=build; \
9+
if [ "$PLUGIN" = "client" ]; then \
10+
BUILD_SCRIPT="${BUILD_SCRIPT}-client"; \
11+
elif [ "$PLUGIN" = "mco" ]; then \
12+
BUILD_SCRIPT="${BUILD_SCRIPT}-mco"; \
13+
fi && \
14+
NODE_OPTIONS="--max-old-space-size=1024" yarn "${BUILD_SCRIPT}" && \
15+
mv /app/plugins/${PLUGIN}/dist /dist
616

17+
FROM docker.io/library/node:20.16.0
718

8-
FROM docker.io/library/node:20.16.0 AS serverpackage
919
RUN yarn global add http-server
10-
RUN export PATH="$(yarn global bin):$PATH"
11-
12-
FROM serverpackage
13-
COPY --from=builder /app/plugins/odf/dist /app
14-
COPY --from=builder /app/plugins/odf/dist /app/compatibility
20+
COPY --from=builder /dist /app
21+
COPY --from=builder /dist /app/compatibility
1522
COPY --from=builder /app/http-server.sh .
1623
ENTRYPOINT [ "./http-server.sh", "./app", "-S", "true", "-C", "/var/serving-cert/tls.crt", "-K", "/var/serving-cert/tls.key" ]

Dockerfile.mco.ci

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

Dockerfile.prod

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

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,27 @@ To debug with VSCode breakpoints, do the following:
142142

143143
- Interact with the browser until you reach the breakpoint.
144144

145+
## Build the CI plugin image
146+
147+
Build a plugin image for testing purposes:
148+
149+
```
150+
# odf plugin.
151+
docker build -t quay.io/<username>/odf-console:test -f Dockerfile.ci .
152+
# client plugin.
153+
docker build -t quay.io/<username>/ocs-client-console:test -f Dockerfile.ci . --build-arg PLUGIN=client
154+
# mco plugin.
155+
docker build -t quay.io/<username>/odf-multicluster-console:test -f Dockerfile.ci . --build-arg PLUGIN=mco
156+
```
157+
158+
Push it:
159+
160+
```
161+
docker push quay.io/<username>/odf-console:test
162+
```
163+
164+
After pushing you can replace the cluster's console plugin image with your test image.
165+
145166
## Build the CI runner image
146167

147168
Build a beta for testing:

0 commit comments

Comments
 (0)