Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Add shellcheck + necessary changes in the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed May 11, 2020
1 parent 93c9b47 commit 5ac9fe1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 26 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: shellcheck

on:
pull_request:
types: [opened, synchronize]
paths:
- '**.sh'
- .github/workflows/shellcheck.yml
push:
branches:
- master
paths:
- '**.sh'
- .github/workflows/shellcheck.yml

jobs:
shellcheck-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Lint check
uses: azohra/shell-linter@v0.3.0
2 changes: 1 addition & 1 deletion .github/workflows/vuepress-build-check-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: npm install -g markdown-spellcheck

- name: Run mdspell
run: find . -type f -name "*.md" | xargs --max-args=1 --verbose mdspell --ignore-numbers --ignore-acronyms --report --en-gb
run: find . -type f -name "*.md" | xargs --max-args=1 --verbose mdspell --ignore-numbers --ignore-acronyms --report --en-gb

vuepress-build-check-deploy:
runs-on: ubuntu-latest
Expand Down
24 changes: 12 additions & 12 deletions run-k8s-istio-webinar-full.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/env bash

set -eu

################################################
# include the magic
################################################
test -f ./demo-magic.sh || curl --silent https://raw.githubusercontent.com/paxtonhare/demo-magic/master/demo-magic.sh > demo-magic.sh
# shellcheck disable=SC1091
. ./demo-magic.sh -n

################################################
Expand All @@ -13,7 +16,7 @@ test -f ./demo-magic.sh || curl --silent https://raw.githubusercontent.com/paxto
#
# speed at which to simulate typing. bigger num = faster
#
TYPE_SPEED=60
export TYPE_SPEED=60

# Uncomment to run non-interactively
export PROMPT_TIMEOUT=0
Expand All @@ -27,7 +30,7 @@ export NO_WAIT=false
# see http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html for escape sequences
#
#DEMO_PROMPT="${GREEN}➜ ${CYAN}\W "
DEMO_PROMPT="${GREEN}${CYAN}$ "
export DEMO_PROMPT="${GREEN}${CYAN}$ "

# hide the evidence
clear
Expand All @@ -47,16 +50,13 @@ clear
# ./run-k8s-istio-webinar-full.sh

sed '/^## Configure AWS/,/^Create policy allowing the cert-manager to change Route 53 settings./d' docs/part-{01..08}/README.md | \
sed -n '/^```bash$/,/^```$/p;/^-----$/p' | \
sed -e 's/^-----$/\
p ""\
p "################################################################################################### Press <ENTER> to continue"\
wait\
/' \
-e 's/^```bash$/\
pe '"'"'/' \
-e 's/^```$/'"'"'/' \
-e '/^sleep/d' \
sed -n "/^\`\`\`bash.*/,/^\`\`\`$/p;/^-----$/p" | \
sed \
-e 's/^-----$/\np ""\np "################################################################################################### Press <ENTER> to continue"\nwait\n/' \
-e 's/^```bash.*/\npe '"'"'/' \
-e 's/^```$/'"'"'/' \
-e '/^sleep/d' \
> README.sh

# shellcheck disable=SC1091
source README.sh
26 changes: 13 additions & 13 deletions run-k8s-istio-webinar.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/env bash

set -eu

################################################
# include the magic
################################################
test -f ./demo-magic.sh || curl --silent https://raw.githubusercontent.com/paxtonhare/demo-magic/master/demo-magic.sh > demo-magic.sh
# shellcheck disable=SC1091
. ./demo-magic.sh -n

################################################
Expand All @@ -13,7 +16,7 @@ test -f ./demo-magic.sh || curl --silent https://raw.githubusercontent.com/paxto
#
# speed at which to simulate typing. bigger num = faster
#
TYPE_SPEED=60
export TYPE_SPEED=60

# Uncomment to run non-interactively
export PROMPT_TIMEOUT=0
Expand All @@ -27,7 +30,7 @@ export NO_WAIT=false
# see http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html for escape sequences
#
#DEMO_PROMPT="${GREEN}➜ ${CYAN}\W "
DEMO_PROMPT="${GREEN}${CYAN}$ "
export DEMO_PROMPT="${GREEN}${CYAN}$ "

# hide the evidence
clear
Expand All @@ -49,22 +52,19 @@ clear

# ./run-k8s-istio-webinar.sh

if [ -z ${EKS_CERT_MANAGER_ROUTE53_AWS_ACCESS_KEY_ID+x} ] || [ -z ${EKS_CERT_MANAGER_ROUTE53_AWS_SECRET_ACCESS_KEY+x} ]; then
if [ -z "${EKS_CERT_MANAGER_ROUTE53_AWS_ACCESS_KEY_ID+x}" ] || [ -z "${EKS_CERT_MANAGER_ROUTE53_AWS_SECRET_ACCESS_KEY+x}" ]; then
echo "One of the mandatory variables 'EKS_CERT_MANAGER_ROUTE53_AWS_ACCESS_KEY_ID' or 'EKS_CERT_MANAGER_ROUTE53_AWS_SECRET_ACCESS_KEY' is not set !!";
exit 1
fi

sed '/^## Prepare the local working environment/,/^Check if the new EKS cluster is available:/d' docs/part-{01..08}/README.md | \
sed -n '/^```bash$/,/^```$/p;/^-----$/p' | \
sed -e 's/^-----$/\
p ""\
p "################################################################################################### Press <ENTER> to continue"\
wait\
/' \
-e 's/^```bash$/\
pe '"'"'/' \
-e 's/^```$/'"'"'/' \
-e '/^sleep/d' \
sed -n "/^\`\`\`bash.*/,/^\`\`\`$/p;/^-----$/p" | \
sed \
-e 's/^-----$/\np ""\np "################################################################################################### Press <ENTER> to continue"\nwait\n/' \
-e 's/^```bash.*/\npe '"'"'/' \
-e 's/^```$/'"'"'/' \
-e '/^sleep/d' \
> README.sh

# shellcheck disable=SC1091
source README.sh

0 comments on commit 5ac9fe1

Please sign in to comment.