Skip to content

Commit 21e24cc

Browse files
author
OpenShift-AI-DevOps
committed
conditional enablement of RHOAI env vars
1 parent c6b29d4 commit 21e24cc

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

.tekton/odh-dashboard-pull-request.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ spec:
3434
- 'odh-pr-{{revision}}'
3535
- name: pipeline-type
3636
value: pull-request
37+
- name: build-args
38+
value:
39+
- BUILD_MODE=RHOAI
3740
pipelineRef:
3841
resolver: git
3942
params:
@@ -49,4 +52,4 @@ spec:
4952
- name: git-auth
5053
secret:
5154
secretName: '{{ git_auth_secret }}'
52-
status: {}
55+
status: {}

.tekton/odh-dashboard-push.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ spec:
2323
- name: revision
2424
value: '{{revision}}'
2525
- name: output-image
26-
value: quay.io/opendatahub/odh-dashboard:odh-stable
26+
value: quay.io/opendatahub/odh-dashboard:odh-stable
2727
- name: dockerfile
2828
value: Dockerfile
2929
- name: path-context
3030
value: .
31+
- name: build-args
32+
value:
33+
- BUILD_MODE=RHOAI
3134
pipelineRef:
3235
resolver: git
3336
params:
@@ -43,4 +46,4 @@ spec:
4346
- name: git-auth
4447
secret:
4548
secretName: '{{ git_auth_secret }}'
46-
status: {}
49+
status: {}

Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Build arguments
22
ARG SOURCE_CODE=.
3+
ARG BUILD_MODE=ODH
34

45
# Use ubi9/nodejs-22 as default base image
56
ARG BASE_IMAGE="registry.access.redhat.com/ubi9/nodejs-22:latest"
@@ -8,6 +9,7 @@ FROM ${BASE_IMAGE} as builder
89

910
## Build args to be used at this step
1011
ARG SOURCE_CODE
12+
ARG BUILD_MODE
1113

1214
WORKDIR /usr/src/app
1315

@@ -22,7 +24,21 @@ RUN npm cache clean --force
2224
RUN npm ci --ignore-scripts
2325

2426
ENV TURBO_TELEMETRY_DISABLED=1
25-
RUN npm run build
27+
RUN if [ "$BUILD_MODE" = "RHOAI" ]; then \
28+
echo "Setting up RHOAI vars.."; \
29+
echo '#!/bin/sh' > /tmp/env.sh; \
30+
echo 'export ODH_LOGO=../images/rhoai-logo.svg' >> /tmp/env.sh; \
31+
echo 'export ODH_LOGO_DARK=../images/rhoai-logo-dark-theme.svg' >> /tmp/env.sh; \
32+
echo 'export ODH_PRODUCT_NAME="Red Hat OpenShift AI"' >> /tmp/env.sh; \
33+
echo 'export ODH_FAVICON="rhoai-favicon.svg"' >> /tmp/env.sh; \
34+
echo 'export DOC_LINK="https://docs.redhat.com/en/documentation/red_hat_openshift_ai/"' >> /tmp/env.sh; \
35+
echo 'export SUPPORT_LINK="https://access.redhat.com/support/cases/#/case/new/open-case?caseCreate=true"' >> /tmp/env.sh; \
36+
echo 'export COMMUNITY_LINK=""' >> /tmp/env.sh; \
37+
else \
38+
echo "Sticking to ODH vars.."; \
39+
echo '#!/bin/sh' > /tmp/env.sh; \
40+
fi
41+
RUN . /tmp/env.sh && npm run build
2642

2743
# Install only production dependencies
2844
# This is needed to remove the dev dependencies that were installed in the previous step

0 commit comments

Comments
 (0)