docs: simplify readme svg (#1418)

This commit is contained in:
Moritz Eckert 2023-03-15 12:11:54 +01:00 committed by GitHub
parent d16f01d810
commit 16f2f9bb64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 183 additions and 705 deletions

View File

@ -23,66 +23,21 @@ spawn asciinema rec --overwrite /recordings/github-readme.cast
send "\r"
expect_prompt
run_command "# Step 1: Create IAM configuration"
expect_prompt
run_command "constellation iam create gcp --generate-config --projectID constellation-331613 --serviceAccountID constellation-demo --zone europe-west3-b"
expect -re "y\/n"
send "y"
send "\r"
expect_prompt
# TODO: Delete step once #1149 released
run_command "# Step 2: Fill in configuration"
expect_prompt
run_command "yq '.provider.gcp.project = \"constellation-331613\"' -i constellation-conf.yaml"
expect_prompt
run_command "yq '.provider.gcp.zone = \"europe-west3-b\"' -i constellation-conf.yaml"
expect_prompt
run_command "yq '.provider.gcp.region = \"europe-west3\"' -i constellation-conf.yaml"
expect_prompt
run_command "cat constellation-conf.yaml | head -n15"
expect_prompt
run_command "# Step 3: Create cloud environment"
expect_prompt
run_command "constellation create --control-plane-nodes 3 --worker-nodes 2"
expect -re "y\/n"
send "y"
send "\r"
expect_prompt
run_command "# Step 4: Initialize Constellation"
expect_prompt
run_command "constellation init"
expect_prompt
run_command "# Wait for cluster to finish bootstrapping..."
expect_prompt
# Without a sleep we only see a single node, not 5.
run_command "sleep 300"
expect_prompt
run_command "# Step 5: Connect to Constellation"
expect_prompt
run_command "export KUBECONFIG=/constellation/constellation-admin.conf"
expect_prompt
run_command "kubectl get nodes"
run_command "# Step 6: Delete Constellation cluster"
expect_prompt
run_command "constellation terminate"
expect -re "y\/n"
send "y"
send "\r"
expect_prompt
run_command "# Step 7: Remove IAM resources"
expect_prompt
run_command "cd constellation-iam-terraform"
expect_prompt
run_command "terraform apply -destroy -auto-approve"
expect -timeout 25
run_command "# All resources are cleaned up."
# Stop recording
send "exit"

View File

@ -8,6 +8,11 @@
# screenrecordings container. A full script run takes ~20min.
#
# Create IAM configuration
pushd constellation || exit
constellation iam create gcp --generate-config --projectID constellation-331613 --serviceAccountID constellation-demo --zone europe-west3-b --yes
popd || exit
docker build -t screenrecodings docker
# Create cast
@ -19,14 +24,24 @@ docker run -it \
# Fix meta data: width and height are always zero in Docker produced cast files.
# Header is the first lint of cast file in JSON format, we read, fix and write it.
head recordings/github-readme.cast -n 1 | yq e -M '.width = 95 | .height = 17' - > new_header.cast
head -n 1 recordings/github-readme.cast | yq -M '.width = 95 | .height = 17 | . + {"idle_time_limit": 0.5}' - > new_header.cast
# Does not work on MacOS due to a different sed
sed -i 's/idle_time_limit:/"idle_time_limit":/' new_header.cast
# Then append everything, expect first line from original cast file.
tail -n+2 recordings/github-readme.cast >> new_header.cast
# Then render cast into svg using:
# https://github.com/nbedos/termtosvg
termtosvg render new_header.cast readme.svg -t window-frame.svg
termtosvg render new_header.cast readme.svg -t window-frame.svg -D 1ms
# Copy and cleanup
cp readme.svg ../static/img/shell-windowframe.svg
rm readme.svg new_header.cast
# cleanup Constellation
sudo chown -R "$USER":"$USER" ./constellation
pushd constellation || exit
constellation terminate -y
constellation iam destroy -y
rm -rf ./*
popd || exit

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 97 KiB