-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MTV-1972: Fixing start script for macos #1427
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -4,26 +4,39 @@ set -euo pipefail | |||||||||
script_dir=$(dirname "$0") | ||||||||||
source ${script_dir}/configure/openshift.sh | ||||||||||
|
||||||||||
CONSOLE_CONTAINER_NAME=okd-console | ||||||||||
FORKLIFT_NAMESPACE=konveyor-forklift | ||||||||||
CONSOLE_CONTAINER_NAME="okd-console" | ||||||||||
FORKLIFT_NAMESPACE="konveyor-forklift" | ||||||||||
|
||||||||||
BASE_HOST_URL="https://localhost" | ||||||||||
|
||||||||||
PLUGIN_NAME="forklift-console-plugin" | ||||||||||
PLUGIN_URL=${PLUGIN_URL:-"http://localhost:9001"} | ||||||||||
CONTAINER_NETWORK_TYPE=${CONTAINER_NETWORK_TYPE:-"host"} | ||||||||||
CONSOLE_IMAGE=${CONSOLE_IMAGE:-"quay.io/openshift/origin-console:latest"} | ||||||||||
CONSOLE_PORT=${CONSOLE_PORT:-9000} | ||||||||||
PLUGIN_URL="http://localhost:9001" | ||||||||||
|
||||||||||
CONTAINER_NETWORK="--network=host" | ||||||||||
|
||||||||||
CONSOLE_IMAGE="quay.io/openshift/origin-console:latest" | ||||||||||
CONSOLE_PORT="9000" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||||||||||
CONSOLE_PORT_PUBLISH="--publish=$CONSOLE_PORT:$CONSOLE_PORT" | ||||||||||
CONSOLE_CONTAINER_NAME_RUN="--name=$CONSOLE_CONTAINER_NAME" | ||||||||||
|
||||||||||
# On macOS | ||||||||||
if [[ $(uname) = "Darwin" ]]; then | ||||||||||
BASE_HOST_URL="http://host.containers.internal" | ||||||||||
CONTAINER_NETWORK="" | ||||||||||
PLUGIN_URL="$BASE_HOST_URL:9001" | ||||||||||
fi | ||||||||||
|
||||||||||
# Default to localhost | ||||||||||
INVENTORY_SERVER_HOST="$BASE_HOST_URL:30444" | ||||||||||
SERVICES_API_SERVER_HOST="$BASE_HOST_URL:30446" | ||||||||||
Comment on lines
+30
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||||||||||
|
||||||||||
# Look for forklift routes | ||||||||||
if oc_available_loggedin; then | ||||||||||
routes=$(oc get routes -A -o template --template='{{range .items}}{{.spec.host}}{{"\n"}}{{end}}' 2>/dev/null || true) | ||||||||||
INVENTORY_SERVER_HOST=${INVENTORY_SERVER_HOST:-$(echo "$routes" | grep forklift-inventory || true)} | ||||||||||
SERVICES_API_SERVER_HOST=${SERVICES_API_SERVER_HOST:-$(echo "$routes" | grep forklift-services || true)} | ||||||||||
INVENTORY_SERVER_HOST="https://$(echo "$routes" | grep forklift-inventory)" | ||||||||||
SERVICES_API_SERVER_HOST="https://$(echo "$routes" | grep forklift-services)" | ||||||||||
Comment on lines
+36
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, worth to support defining those variables externally... |
||||||||||
fi | ||||||||||
|
||||||||||
# Default to localhost if no route found | ||||||||||
INVENTORY_SERVER_HOST=${INVENTORY_SERVER_HOST:-"https://localhost:30444"} | ||||||||||
SERVICES_API_SERVER_HOST=${SERVICES_API_SERVER_HOST:-"https://localhost:30446"} | ||||||||||
|
||||||||||
if [[ ${CONSOLE_IMAGE} =~ ^localhost/ ]]; then | ||||||||||
PULL_POLICY="never" | ||||||||||
else | ||||||||||
|
@@ -32,8 +45,8 @@ fi | |||||||||
|
||||||||||
# Test if console is already running | ||||||||||
if podman container exists ${CONSOLE_CONTAINER_NAME}; then | ||||||||||
echo "container named ${CONSOLE_CONTAINER_NAME} is running, exit." | ||||||||||
exit 1 | ||||||||||
echo "container named ${CONSOLE_CONTAINER_NAME} is running, exit." | ||||||||||
exit 1 | ||||||||||
fi | ||||||||||
|
||||||||||
# Base setup for the bridge | ||||||||||
|
@@ -48,8 +61,9 @@ fi | |||||||||
# When the container network is default, host.containers.internal == container host | ||||||||||
# | ||||||||||
# NOTE: When running KinD we should use host network type because KinD only listen on localhost. | ||||||||||
BRIDGE_PLUGINS="${PLUGIN_NAME}=${PLUGIN_URL}" | ||||||||||
BRIDGE_PLUGIN_PROXY=$(cat << END | jq -c . | ||||||||||
BRIDGE_PLUGINS="$PLUGIN_NAME=$PLUGIN_URL" | ||||||||||
BRIDGE_PLUGIN_PROXY=$( | ||||||||||
cat <<END | jq -c . | ||||||||||
{"services":[ | ||||||||||
{ | ||||||||||
"consoleAPIPath":"/api/proxy/plugin/${PLUGIN_NAME}/forklift-inventory/", | ||||||||||
|
@@ -94,10 +108,10 @@ $(echo ${BRIDGE_PLUGIN_PROXY} | jq .) | |||||||||
podman run \ | ||||||||||
--pull=${PULL_POLICY} \ | ||||||||||
--rm \ | ||||||||||
${mount_tmp_dir_flag} \ | ||||||||||
--network=${CONTAINER_NETWORK_TYPE} \ | ||||||||||
--publish=${CONSOLE_PORT}:${CONSOLE_PORT} \ | ||||||||||
--name=${CONSOLE_CONTAINER_NAME} \ | ||||||||||
--env "BRIDGE_*" \ | ||||||||||
--arch=amd64 \ | ||||||||||
${mount_tmp_dir_flag} \ | ||||||||||
${CONTAINER_NETWORK} \ | ||||||||||
${CONSOLE_PORT_PUBLISH} \ | ||||||||||
${CONSOLE_CONTAINER_NAME_RUN} \ | ||||||||||
${CONSOLE_IMAGE} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
"clean:all": "yarn clean ./node_modules ./.rollup.cache", | ||
"i18n": "i18next \"./src/**/*.{js,jsx,ts,tsx}\" [-oc] -c ./i18next-parser.config.js", | ||
"build": "NODE_ENV=production webpack", | ||
"start": "NODE_ENV=development webpack serve", | ||
"start": "NODE_ENV=development webpack serve --progress", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we omit the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, of course, I can omit it. I've added it :) It's just to know the percentage progress when u sit and wait to 100% to start working. with all other projects we do have it with progress There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And isn't it extending the build running time? It seems like it is for me :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think so, and if so, it's so minor compared to the status awarnance There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
? |
||
"buildlib": "rollup -c --bundleConfigAsCjs", | ||
"lint": "eslint . && stylelint \"src/**/*.css\" --allow-empty-input", | ||
"lint:fix": "eslint . --fix && stylelint \"src/**/*.css\" --allow-empty-input --fix", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to support setting those vars externally to be backward with previous implementation - see README.