Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CI to automatically generate documentation gifs using vhs #1230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
paths-ignore:
- 'docs/**'
- '.github/workflows/documentation.yml'
- '.github/workflows/vhs.yml'
- 'mkdocs.yml'
- 'CNAME'

Expand All @@ -25,6 +26,7 @@ on:
paths-ignore:
- 'docs/**'
- '.github/workflows/documentation.yml'
- '.github/workflows/vhs.yml'
- 'mkdocs.yml'
- 'CNAME'

Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/vhs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Generate gifs from VHS tapes
on:
workflow_dispatch:
pull_request:
paths:
- docs/vhs/tapes/*.tape

jobs:
vhs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
- name: Setup Kapitan
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/kapicorp/kapitan@init-with-copier
- name: Install vhs-action
uses: charmbracelet/[email protected]
- name: run VHS
run: |
# shellcheck disable=SC2086
for file in docs/vhs/tapes/*.tape
do
filename="$(basename ${file})"
vhs "${file}" -o "docs/vhs/gifs/${filename%%.tape}.gif"
done

- uses: stefanzweifel/git-auto-commit-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: Update generated VHS GIF
commit_user_name: vhs-action 📼
commit_user_email: [email protected]
commit_author: vhs-action 📼 <[email protected]>
file_pattern: '*.gif'
98 changes: 34 additions & 64 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,47 @@
# :kapitan-logo: **Kapitan Overview**
# :kapitan-logo: **Installation**

## Setup your installation
## Setup your project

Using our reference repositories you can easily get started with **Kapitan**

### Examples repository

[kapicorp/kapitan-reference](https://github.com/kapicorp/kapitan-reference) repository is meant show you many working examples of things you can do with Kapitan.
You can use this to get familiar with **Kapitan**
Once you have installed *Kapitan* (see #installation-methods), you can easily initialise your project with:

```
$ git clone [email protected]:kapicorp/kapitan-reference.git kapitan-templates
$ cd kapitan-templates

$ ./kapitan compile
Compiled postgres-proxy (1.51s)
Compiled tesoro (1.70s)
Compiled echo-server (1.64s)
Compiled mysql (1.67s)
Compiled gke-pvm-killer (1.17s)
Compiled prod-sockshop (4.74s)
Compiled dev-sockshop (4.74s)
Compiled tutorial (1.68s)
Compiled global (0.76s)
Compiled examples (2.60s)
Compiled pritunl (2.03s)
Compiled sock-shop (4.36s)
kapitan init --directory $HOME/kapitan-templates
```

### Minimal repository

> Using [cruft](https://cruft.github.io/cruft/) based cookiecutter

```shell
pip3 install cruft
```

```shell
cruft create http://github.com/kapicorp/kapitan-reference --checkout cookiecutter --no-input
Dependency https://github.com/kapicorp/generators.git: saved to system/lib
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/kubernetes
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/terraform
Rendered inventory (1.74s)
Compiled echo-server (0.14s)
```

## running **Kapitan**

!!! success "recommended"
### `kapitan` wrapper script
If you use the provided repository, we already package a `kapitan` shell script that wraps the docker command to run **Kapitan**

```shell
$ ./kapitan compile
Compiled postgres-proxy (1.51s)
Compiled tesoro (1.70s)
Compiled echo-server (1.64s)
Compiled mysql (1.67s)
Compiled gke-pvm-killer (1.17s)
Compiled prod-sockshop (4.74s)
Compiled dev-sockshop (4.74s)
Compiled tutorial (1.68s)
Compiled global (0.76s)
Compiled examples (2.60s)
Compiled pritunl (2.03s)
Compiled sock-shop (4.36s)
??? note "Example output"
```
Initialising skeleton from https://github.com/kapicorp/kapitan-reference.git@copier in $HOME/kapitan-templates
🎤 What version of Kapitan
0.32.0

Copying from template version 0.0.0.post140.dev0+aaeecf6
create .
create .kapitan
create .github
create .github/workflows
create .github/workflows/integration-test.yml
create .github/workflows/pre-commit.yml
create .gitignore
create system
create system/sources
[OMITTED]
create .pre-commit-config.yaml
create README.md
create kapitan

> Running task 1 of 2: git init --quiet
> Running task 2 of 2: ./kapitan compile
Dependency https://github.com/kapicorp/generators.git: saved to system/lib
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/kubernetes
Dependency https://github.com/kapicorp/generators.git: saved to system/generators/terraform
Rendered inventory (2.09s)
Compiled tutorial (0.16s)
```

## Other installation methods

### Docker
## Installation methods

[![Releases](https://img.shields.io/github/release/kapicorp/kapitan.svg)](https://github.com/kapicorp/kapitan/releases)
We provide you with different easy ways to install `kapitan`. Please pick one of the following methods

!!! success "recommended"
### Docker
Expand Down
Binary file added docs/vhs/gifs/kapitan-init.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/vhs/tapes/kapitan-init.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Require kapitan
Set WindowBar Colorful
Set Margin 20
Set MarginFill "#674EFF"
Set BorderRadius 10
Type "kapitan init --directory $HOME/kapitan-templates"
Enter
Sleep 2.5s
Enter
Sleep 25s