You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developing.md
+68-5Lines changed: 68 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ When making code modifications see if you can write a test first!
22
22
23
23
Sometimes its nice to demo / experiment with the service(s) you're changing locally.
24
24
25
-
### The `capi-service`
25
+
### The `clusters-service`
26
26
27
27
_Note: the following instructions will use a new local database, you can probably reconcile the internal cluster database with the local one with some fancy fs mounting, tbd..._
28
28
29
-
The `capi-service` requires the presence of a valid entitlement secret for it to work. Make sure an entitlement secret has been added to the cluster and that the `capi-service` has been configured to look for it using the correct namespace/name. By default, entitlement secrets are named `weave-gitops-enterprise-credentials` and are added to the `wego-system` namespace. If that's not the case, you will need to point the service to the right place by explicitly specifying the relevant environment variables (example below).
29
+
The `clusters-service` requires the presence of a valid entitlement secret for it to work. Make sure an entitlement secret has been added to the cluster and that the `clusters-service` has been configured to look for it using the correct namespace/name. By default, entitlement secrets are named `weave-gitops-enterprise-credentials` and are added to the `wego-system` namespace. If that's not the case, you will need to point the service to the right place by explicitly specifying the relevant environment variables (example below).
30
30
31
31
An existing entitlement secret that you can use can be found [here](../test/utils/scripts/entitlement-secret.yaml). Alternatively, you can generate your own entitlement secret by using the `wge-credentials` binary.
32
32
@@ -56,7 +56,7 @@ Run the server:
56
56
export KUBECONFIG=test-server-kubeconfig
57
57
58
58
# Run the server configured using lots of env vars
59
-
DB_URI=/tmp/wge.db CAPI_CLUSTERS_NAMESPACE=default CAPI_TEMPLATES_NAMESPACE=default GIT_PROVIDER_TOKEN=$GITHUB_TOKENGIT_PROVIDER_TYPE=github GIT_PROVIDER_HOSTNAME=github.com CAPI_TEMPLATES_REPOSITORY_URL=https://github.com/my-org/my-repo CAPI_TEMPLATES_REPOSITORY_BASE_BRANCH=main ENTITLEMENT_SECRET_NAMESPACE=wego-system ENTITLEMENT_SECRET_NAME=weave-gitops-enterprise-credentials go run cmd/capi-service/main.go
59
+
DB_URI=/tmp/wge.db CAPI_CLUSTERS_NAMESPACE=default CAPI_TEMPLATES_NAMESPACE=default GIT_PROVIDER_TYPE=github GIT_PROVIDER_HOSTNAME=github.com CAPI_TEMPLATES_REPOSITORY_URL=https://github.com/my-org/my-repo CAPI_TEMPLATES_REPOSITORY_BASE_BRANCH=main ENTITLEMENT_SECRET_NAMESPACE=wego-system ENTITLEMENT_SECRET_NAME=weave-gitops-enterprise-credentials go run cmd/clusters-service/main.go
60
60
```
61
61
62
62
You can query the local capi-server:
@@ -90,6 +90,46 @@ cd ui-cra
90
90
GITOPS_HOST=http://localhost:8090 yarn start
91
91
```
92
92
93
+
## Developing the UI
94
+
95
+
We usually develop the UI against the test server and by default the UI dev server will use that.
96
+
97
+
```bash
98
+
cd ui-cra
99
+
yarn
100
+
yarn start
101
+
```
102
+
103
+
Open up http://localhost:3000. Changes to code will be hot-reloaded.
104
+
105
+
### UI against a local clusters-service
106
+
107
+
When you need to develop the UI against new features that haven't made to the test cluster yet you can run your own clusters-service locally and point the UI dev server at it with:
108
+
109
+
```bash
110
+
CAPI_SERVER_HOST=http://localhost:8000 yarn start
111
+
```
112
+
113
+
### Testing changes to an unreleased weave-gitops locally
114
+
115
+
Maybe you need to add an extra export or tweak a style in a component in weave-gitops:
116
+
117
+
```bash
118
+
# build the weave-gitops ui-library
119
+
cd weave-gitops
120
+
git checkout cool-new-ui-feature
121
+
make ui-lib
122
+
123
+
# use it in wge
124
+
cd weave-gitops-enterprise/ui-cra
125
+
126
+
# optionally clean up node_modules a bit if changes don't seem to be coming through
127
+
rm -rf node_modules/@weaveworks/weave-gitops/
128
+
129
+
# install local copy of weave-gitops ui-lib
130
+
yarn add ../../weave-gitops/dist
131
+
```
132
+
93
133
## How to update the version of `weave-gitops`
94
134
95
135
[`weave-gitops-enterprise`](https://github.com/weaveworks/weave-gitops-enterprise) depends on [`weave-gitops`](https://github.com/weaveworks/weave-gitops). When WG makes a new release we'll want to update the version WGE depends on. It goes a little something like this:
@@ -107,9 +147,32 @@ cd ui-cra && yarn add @weaveworks/weave-gitops@$WG_VERSION
107
147
open "https://github.com/weaveworks/weave-gitops/tree/v${WG_VERSION}/manifests/crds"
108
148
```
109
149
110
-
## How to update the demo cluster
150
+
## The test cluster
151
+
152
+
The test cluster currently lives at a static ip but will hopefully move behind a DNS address with auth _soon_.
153
+
154
+
Hit up http://34.67.250.163:30080
155
+
156
+
### `kubectl` access
157
+
158
+
The private ssh key to the server lives in the `pesto test cluster ssh key` secret in 1Password.
The demo cluster currently lives at http://34.67.250.163:30080/ but will hopefully move behind a DNS address with auth _soon_.
175
+
### How to update the test cluster
113
176
114
177
1. Figure out the version of chart you want to deploy. If we've done a release recently you can change it to `0.0.8` or a major version like that. To deploy a unreleased version from `main` or a `branch` we need to figure out the git ref version:
0 commit comments