-
Notifications
You must be signed in to change notification settings - Fork 115
Deploy on OpenShift
Jennings Zhang edited this page Dec 12, 2023
·
13 revisions
# Step 1: create "ImageStream"
# This indicates which image we want to use for s2i
oc import-image nodejs:20 --from=quay.io/fedora/nodejs-20 --confirm
# Step 2: create BuildConfig and Deployment
# the command `oc new-app` attempts to do almost everything:
# given a Github repo URL, create a BuildConfig, Deployment, Service,
# and start a build.
oc new-app --name chrisui \
--build-env=VITE_CHRIS_UI_URL='https://cube.chrisproject.org/api/v1/' \
--build-env=VITE_CHRIS_UI_USERS_URL='https://cube.chrisproject.org/api/v1/users/' \
--build-env=VITE_CHRIS_UI_AUTH_URL='https://cube.chrisproject.org/api/v1/auth-token/' \
--build-env=VITE_PFDCM_URL='https://pfdcm-hosting-of-medical-image-analysis-platform-dcb83b.apps.shift.nerc.mghpcc.org/api/v1/about/' \
nodejs:20~https://github.com/FNNDSC/ChRIS_ui.git
# Step 3: configure the build with some important options
# - Default limit is 2Gi mem, which is enough, but a little more won't hurt.
# - Set RunPolicy=SerialLatestOnly
# - Set ref=master, so that full commit history is cloned for the sake of being able to generate the version string. See https://github.com/FNNDSC/ChRIS_ui/pull/508
oc patch bc/chrisui --patch '{"spec":{"resources":{"limits":{"memory":"4Gi"}},"runPolicy":"SerialLatestOnly","source":{"git":{"ref":"master"}}}}'
# Step 4: add webhook to Github project
# https://docs.openshift.com/container-platform/4.7/cicd/builds/triggering-builds-build-hooks.html
# https://github.com/FNNDSC/ChRIS_ui/settings/hooks
# Step 5: everything works?
# Step 6: create route
It seems like print_version.sh doesn't work unless you manually specify a git ref for your BuildConfig. You should be doing so anyways, e.g. refs/heads/master
or refs/tags/freeze-chrisproject-org