Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ install-state.gz
# Built binaries
/bin
pages/plugin.yaml
/public
backend/main

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably should ignore those too:

  • backend/static/plugin.yaml
  • backend/static/index.html

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it's leftover from my experiments. I'll clean it up.

Comment on lines +56 to +57

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why are those two added?

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ Available image tags are listed in the [container registry](https://github.com/f
In one terminal window, run:

@twoGiants twoGiants Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the entire Option 1 (rename to Setup) section to say that init.sh should be used to start the dev env?

A few more things:

  • Remove the sections:
    • #### Running start-console with Apple silicon and podman
    • Option 2: ...
  • Add a small section in the Readme telling how to view the github pages locally.
  • Add go and helm to the prerequisites.
  • You could make the plugin.yaml generation optional in the init.sh script, then go and helm will also be optional.


1. `yarn install`
2. `yarn run start`
2. `yarn dev`

This starts both the Go backend server (port 8080) and the webpack dev server (port 9001) in a single process.

In another terminal window, run:

Expand Down
41 changes: 41 additions & 0 deletions hack/dev.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're having an init.sh script which starts everything. This script won't work when init was run before, the ports are the same.

Maybe you can wire it all up in the init.sh script, so the pages assets are build every time we start the development environment?

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail

# Build pages assets into backend/static so the embedded FS serves them
echo "Building pages assets..."
helm template console-functions-plugin charts/openshift-console-plugin \
-n console-functions-plugin \
--set plugin.image=ghcr.io/functions-dev/console-functions-plugin:latest \
> backend/static/plugin.yaml
cp pages/index.html backend/static/index.html

# Track background PIDs for cleanup
PIDS=()
cleanup() {
echo ""
echo "Stopping dev servers..."
for pid in "${PIDS[@]}"; do
kill "$pid" 2>/dev/null || true
done
rm -f backend/static/plugin.yaml backend/static/index.html
wait
}
trap cleanup EXIT

# Start backend API server (also serves pages via embedded static files)
echo "Starting backend server on :8080..."
(cd backend && go run ./main.go -http-port 8080) &
PIDS+=($!)

# Start webpack dev server
echo "Starting webpack dev server..."
yarn webpack serve --progress &
PIDS+=($!)

echo ""
echo "Dev environment running:"
echo " Backend: http://localhost:8080"
echo " Plugin: http://localhost:9001"
echo ""

wait
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"clean": "rm -rf dist",
"build": "yarn clean && NODE_ENV=production yarn webpack",
"build-dev": "yarn clean && yarn webpack",
"dev": "./hack/dev.sh",
"start": "yarn webpack serve --progress",
"start-console": "./start-console.sh",
"test": "vitest run",
Expand Down
3 changes: 3 additions & 0 deletions start-console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ else
PLUGIN_HOST="host.docker.internal"
fi
CONTAINER_NETWORK_OPTS="-p ${CONSOLE_PORT}:9000"
if [[ "$(uname -s)" == "Darwin" ]]; then
CONTAINER_NETWORK_OPTS="${CONTAINER_NETWORK_OPTS} --add-host api.crc.testing:host-gateway"
fi

BRIDGE_PLUGINS="${PLUGIN_NAME}=http://${PLUGIN_HOST}:${PLUGIN_PORT}"
BRIDGE_PLUGIN_PROXY='{"services":[{"consoleAPIPath":"/api/proxy/plugin/'"${PLUGIN_NAME}"'/backend/","endpoint":"http://'"${PLUGIN_HOST}"':'"${BACKEND_PORT}"'","authorize":false}]}'
Expand Down
Loading