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
create a `commonserver` profile with endpoint, tls, and configuration.
55
+
56
+
When `@rest(use:"commonserver")` is encountered, those arguments will be applied.
57
+
58
+
Since there is only a single `@rest` definition, this is a contrivied example, but the utility should be clear especially for CI/CD.
59
+
60
+
29
61
## Try it out!
30
62
31
-
`rest_self` in tls.graphql provides an example of self signed certificates by pointing to the `selfsign` resource in config.yaml. That configuration contains `ca: STEPZEN_SERVER_CRT`
63
+
`rest_self` in tls.graphql provides an example of self signed certificates by pointing to the `myserver` resource in config.yaml. That configuration contains `ca: STEPZEN_SERVER_CRT`
32
64
During `stepzen deploy`, the `STEPZEN_SERVER_CRT` environment variable is expanded and the result will be a yaml that looks like:
The `selfsignedmtls` configuration contains an example mutual TLS configuration.
76
+
The `mymtlsserver` configuration contains an example mutual TLS configuration.
45
77
46
78
Two safe approaches are to set the environment variables from secrets or to have a `.env` file.
47
79
@@ -88,6 +120,14 @@ By default, `rest_self` uses `host.docker.internal` which works in most modern
88
120
89
121
For Podman, you may need to change this to `host.containers.internal` or `localhost` depending on your podman defaults. You may also need to modify your podman default configuration to allow for such access.
90
122
123
+
We apply a layer of indirection for the endpoint. The actual value is held in the configuation as `url` and that is actually obtained from the environment variable `STEPZEN_SERVER_URL`. This allows for CI/CD process to inject the root URL by setting the env variable.
124
+
125
+
Here, this can be done by running, replacing the `SERVER_URL` with the value appropriate to your container runtime toolset.
126
+
```
127
+
(cd tests; make env SERVER_URL="http://localhost:8443")
128
+
```
129
+
This won't overwrite an existing .env, so remove it if already exists.
130
+
91
131
### env variables
92
132
93
133
You can set `STEPZEN_*` env variables in .env or using export.
0 commit comments