[Skip-CI] Update Readme

merge-requests/4/merge
erik 2 years ago
parent 752d71dacd
commit fe1150c49d

@ -15,14 +15,14 @@ Following the example in valid-config.edn and valid-auth.edn you can add as many
Configs generated by c4k-website consists of the following parts:
* nginx webserver + service + ingress + certificate definitions
* job definition that initially starts a build container
* nginx deployment + configmap + service + ingress + certificate definitions
* nginx deployment has init container, building the website at startup time
* cron job for building and build secret for storing auth data
* respective volume claim
* respective volume claims
## Try out
Click on the image to try out live in your browser:
Click on the image to try out in your browser:
[![Try it out](doc/tryItOut.png "Try out yourself")](https://domaindrivenarchitecture.org/pages/dda-provision/c4k-website/)
@ -35,23 +35,26 @@ You need:
* DNS routes matching the fqdns in the lists
* cryogen as a static site generator
* a cryogen project ready to build
* and a gitea account which holds the buildable project
* a kubernetes cluster provisioned by [provs]
* a gitea account which holds the buildable project
* an authorization token for that account
* and a kubernetes cluster provisioned by [provs]
Before deploying, you need an authorization token, that can be generated in your gitea account.
Then you need a URL that points to: `https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/<branch>.zip`. Add this to your auth.edn config file and you should be ready to go.
Let c4k-website generate your .yaml file and `kubectl apply yourApp.yaml`. Done.
Add a unique identifier for each website to config.edn and auth.edn (e.g. domain-name).
Add the list of fqdns, your gitea host, name of the website repo and the respective branch name (usually "main") to config.edn.
Add auth token and gitea user with access to the website repo to auth.edn.
Let c4k-website generate your .yaml file.
Apply this file on your cluster with `kubectl apply -f yourApp.yaml`.
Done.
### Script Execution
Optionally you can specify a sha256sum output generated from a script file that should be executed.
Just add the :sha256-output "\[hash-of-file file.name\]" :key value pair to the respective collection in :websites. See the example in valid-config.edn.
Optionally you can specify a trusted script in your config.edn.
The script file needs to exist in the `<branch>.zip` and path specification to the script file
should be relative to the root of the unzipped folder.
1. `sha256sum` "/path/to/your/script/file"
2. copy the output of this command
3. add the :sha256-output "hash-of-file file.name" :key value pair to the respective collection in :websites.
Scripts can be of any type - as long as an according shebang exists in the first line.
Also, see the example in valid-config.edn. The script file needs to exist in the `<branch>.zip` and path specification to the script file should be relative to the root of the unzipped folder. Scripts can be of any type - as long as an according shebang exists in the first line.
```bash
sha256sum your-script-file # use output of this call

Loading…
Cancel
Save