Skip to content

Commit

Permalink
update demo gif, add generator scripts (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanford committed Aug 13, 2020
1 parent 3a6da24 commit c9585bf
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build lint
.PHONY: all build gen-demo lint
all: build

build:
Expand All @@ -7,11 +7,14 @@ build:
install: build
install bin/kubectl-operator $(shell go env GOPATH)/bin

gen-demo:
./assets/demo/gen-demo.sh

GOLANGCI_LINT_VER = "1.29.0"
lint:
# scripts/golangci-lint-check.sh
ifneq (${GOLANGCI_LINT_VER}, "$(shell ./bin/golangci-lint --version 2>/dev/null | cut -b 27-32)")
@echo "golangci-lint missing or not version '${GOLANGCI_LINT_VER}', downloading..."
curl -sSfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${GOLANGCI_LINT_VER}/install.sh" | sh -s -- -b ./bin "v${GOLANGCI_LINT_VER}"
endif
./bin/golangci-lint --timeout 3m run
./bin/golangci-lint --timeout 3m run
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cluster. See the OLM installation instructions [here](https://olm.operatorframew

## Demo

![asciicast](assets/asciinema-demo.gif)
![asciicast](assets/demo/demo.gif)

## Install

Expand Down
Binary file removed assets/asciinema-demo.gif
Binary file not shown.
Binary file added assets/demo/demo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions assets/demo/demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

INTERACTIVE=${INTERACTIVE:-"1"}

run() {
type "kubectl operator catalog list -A"
type "kubectl operator list-available cockroachdb"
type "kubectl operator install cockroachdb --create-operator-group -v 2.1.1"
type "kubectl operator list"
type "kubectl operator upgrade cockroachdb"
type "kubectl operator list"
type "kubectl operator uninstall cockroachdb --delete-crds --delete-operator-groups"
}

prompt() {
echo ""
echo -n "$ "
}

type() {
prompt
sleep 1
for (( i=0; i<${#1}; i++ )); do
echo -n "${1:$i:1}"
sleep 0.06
done
echo ""
sleep 0.25
$1
[[ "$INTERACTIVE" == "1" ]] && read -p ""
}

run
8 changes: 8 additions & 0 deletions assets/demo/gen-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -o errexit
set -o pipefail

INTERACTIVE=0 asciinema rec --overwrite -c ./assets/demo/demo.sh ./assets/demo/demo.asciinema.json
asciicast2gif -w 90 -h 33 ./assets/demo/demo.asciinema.json ./assets/demo/demo.gif
rm ./assets/demo/demo.asciinema.json

0 comments on commit c9585bf

Please sign in to comment.