Skip to content

Commit

Permalink
Fix shell code
Browse files Browse the repository at this point in the history
  • Loading branch information
devpro committed Sep 3, 2024
1 parent abcbbce commit aeb3e77
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: '**/*.md'
# checking shell code with ShellCheck (https://github.com/koalaman/shellcheck)
- name: Installs packages
run: sudo apt install shellcheck
- name: Checks shell file code
run:
shellcheck scripts/**/*.sh
shellcheck -e SC2148 scripts/**/*.sh
1 change: 1 addition & 0 deletions scripts/download.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
# Script to download a specific version of the scripts from GitHub

# Usage:
# curl ... | ENV_VAR=... sh -
Expand Down
3 changes: 3 additions & 0 deletions scripts/index.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash
# File to be sourced to have all shell functions available in the bash terminal

SCRIPT_FOLDER=$(dirname "${BASH_SOURCE[0]}")
for file in ${SCRIPT_FOLDER}/*/*.sh
do {
Expand Down
1 change: 1 addition & 0 deletions scripts/k3s/cluster-lifecycle.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to manage K3s cluster lifecycle

#######################################
Expand Down
1 change: 1 addition & 0 deletions scripts/kubernetes/certificate-management.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to add components to manage certificates in a Kubernetes cluster

#######################################
Expand Down
3 changes: 2 additions & 1 deletion scripts/kubernetes/cluster-status.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to add query status on a Kubernetes cluster

#######################################
Expand All @@ -14,7 +15,7 @@ k8s_wait_fornodesandpods() {
sleep 5
done
while true; do
NOT_READY_NODES=$(kubectl get nodes --no-headers 2>/dev/null | grep -v " Ready" | wc -l)
NOT_READY_NODES=$(kubectl get nodes --no-headers 2>/dev/null | grep -c " Ready")
if [ "$NOT_READY_NODES" -eq 0 ]; then
echo "All nodes are ready."
break
Expand Down
1 change: 1 addition & 0 deletions scripts/rancher/cluster-actions.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to manage clusters from Rancher

#######################################
Expand Down
1 change: 1 addition & 0 deletions scripts/rancher/manager-lifecycle.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to manage Rancher lifecycle

#######################################
Expand Down
1 change: 1 addition & 0 deletions scripts/rancher/manager-settings.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to update Rancher settings

#######################################
Expand Down
3 changes: 2 additions & 1 deletion scripts/rancher/user-actions.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# Collection of functions to make user actions

#######################################
Expand Down Expand Up @@ -77,7 +78,7 @@ rancher_create_apikey() {
-H "Authorization: Bearer $token" \
--data-binary '{
"type": "token",
"description": "${description}",
"description": "$description",
"ttl": 0
}')
echo "DEBUG API_KEY_RESPONSE=${API_KEY_RESPONSE}"
Expand Down

0 comments on commit aeb3e77

Please sign in to comment.