You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
bom 15f82ee0dc Version 0.2.1 1 year ago
doc Update scripts in docker image 1 year ago
infrastructure/c4k-website-build Bugfixes 1 year ago
public Project skeleton 2 years ago
src Remove ingress_cert files 1 year ago
.gitignore Ignore helper script 1 year ago
.gitlab-ci.yml Expire artifacts 1 year ago
LICENSE Project skeleton 2 years ago
README.md Update path handling in docker image 1 year ago
package.json Release 1.0.0 1 year ago
project.clj Version 0.2.1 1 year ago
shadow-cljs.edn Bump c4k-common version to v3.1.1 1 year ago
valid-auth.edn Simplify spec 1 year ago
valid-config.edn Update path handling in docker image 1 year ago

README.md

convention 4 kubernetes: c4k-website

Clojars Project pipeline status

DeltaChat chat over e-mail | team@social.meissa-gmbh.de team@social.meissa-gmbh.de | Website & Blog

Purpose

Delivering cryogen generated static sites with the push of a few buttons.

c4k-website generates configuration files for multiple nginx webservers, and corresponding cryogen static site generator build containers. This automatically downloads a <branch>.zip from a specified gitea API url. You need an authorization token to access the specified gitea user account. The build container is based on clojure:lein.

Following the example in valid-config.edn and valid-auth.edn you can add as many websites as you like (provided you have the DNS Routes set up). One set of configmaps, deployment, services etc will be created for each element in the :websites and :auth list.

Configs generated by c4k-website consists of the following parts:

  • nginx webserver + service + ingress + certificate definitions
  • job definition that initially starts a build container
  • cron job for building and build secret for storing auth data
  • respective volume claim

Try out

Click on the image to try out live in your browser:

Try it out

Your input will stay in your browser. No server interaction is required.

Usage

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

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.

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.

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.

sha256sum your-script-file #  use output of this call
sha256sum scripts/your-script-file #  or this
sha256sum scripts/foo/bar/your-script-file #  or this

License

Copyright © 2022 meissa GmbH Licensed under the Apache License, Version 2.0 (the "License") Pls. find licenses of our subcomponents here