Skip to content

Commit 4d0c39a

Browse files
authored
Merge pull request #19 from sahil143/update-readme-konflux-ci-setup
chore(README): added steps to run ui with local konflux-ci
2 parents f8c0c2b + 7cee979 commit 4d0c39a

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,59 @@ A step by step series of examples that tell you how to get a development environ
1515
```
1616
yarn start
1717
```
18+
## Running with Konflux-ci
19+
20+
By default, the UI uses the stage cluster for API calls. However, if you want to run the UI with a local Konflux deployment, follow the steps below.
21+
22+
1. Follow the guide at https://github.com/konflux-ci/konflux-ci to deploy Konflux locally (use branch: `new-ui`)
23+
24+
2. Once you have Konflux deployed, make the following changes to your .env file:
25+
26+
```diff
27+
# .env
28+
29+
+ AUTH_URL=https://127.0.0.1:9443/
30+
+ REGISTRATION_URL=https://127.0.0.1:9443/
31+
+ PROXY_URL=https://127.0.0.1:9443/
32+
+ PROXY_WEBSOCKET_URL=wss://127.0.0.1:9443
33+
- AUTH_URL= https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
34+
- REGISTRATION_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
35+
- PROXY_URL=https://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
36+
- PROXY_WEBSOCKET_URL=wss://konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com/
37+
```
38+
3. Update your webpack.dev.config.js file with the following changes:
39+
40+
```diff
41+
@@ webpack.dev.config.js:14 @@
42+
historyApiFallback: true,
43+
hot: true,
44+
server: 'https',
45+
proxy: [
46+
{
47+
+ context: (path) => path.includes('/oauth2/') || path.includes('/idp/'),
48+
- context: (path) => path.includes('/oauth2/'),
49+
target: process.env.AUTH_URL,
50+
secure: false,
51+
changeOrigin: true,
52+
+ autoRewrite: true,
53+
- autoRewrite: false,
54+
toProxy: true,
55+
headers: {
56+
'X-Forwarded-Host': `localhost:${DEV_SERVER_PORT}`,
57+
},
58+
onProxyRes: (proxyRes) => {
59+
const location = proxyRes.headers['location'];
60+
if (location) {
61+
proxyRes.headers['location'] = location.replace(
62+
+ 'localhost:9443',
63+
+ `localhost:${DEV_SERVER_PORT}`,
64+
- 'konflux-ui.apps.stone-stg-rh01.l2vh.p1.openshiftapps.com%2Foauth2',
65+
- `localhost:${DEV_SERVER_PORT}/oauth2`,
66+
);
67+
}
68+
},
69+
70+
```
1871

1972
## Available Scripts
2073

0 commit comments

Comments
 (0)