Skip to content

Commit

Permalink
shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 11, 2024
1 parent d517bf0 commit 1d37fdb
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 8 deletions.
1 change: 1 addition & 0 deletions devcontainer/nix-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set +e
if ! pidof nix-daemon > /dev/null 2>&1; then
start_ok=false
if [ "$(id -u)" = "0" ]; then
# shellcheck disable=SC1091
# shellcheck source=/dev/null
( . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh; /nix/var/nix/profiles/default/bin/nix-daemon > /tmp/nix-daemon.log 2>&1 ) &
# shellcheck disable=SC2181
Expand Down
1 change: 1 addition & 0 deletions examples/clickhouse/.test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
set -xe
timeout 20 bash -c 'until echo > /dev/tcp/localhost/9000; do sleep 0.5; done'
sleep 2
Expand Down
1 change: 0 additions & 1 deletion examples/dotenv/.test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

env | grep FOO=1
env | grep BAR=1
env | grep BAZ=5
1 change: 0 additions & 1 deletion examples/fly.io/.test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

if [ "$(uname -s)" == "Linux" ]; then
devenv container shell
devenv container processes
Expand Down
1 change: 0 additions & 1 deletion examples/imports/.test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env bash

env | grep "FILE=1"
env | grep "FOLDER=1"
1 change: 1 addition & 0 deletions examples/mysql/.test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
set -ex

timeout 60 bash -c 'until MYSQL_PWD="" mysql -u root test_database < /dev/null; do sleep 0.5; done'
1 change: 1 addition & 0 deletions examples/postgres/.test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash
set -ex
timeout 20 bash -c 'until psql -h /tmp -c "SELECT 1" mydb 2>/dev/null; do sleep 0.5; done'
14 changes: 12 additions & 2 deletions examples/temporal/.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ export TEMPORAL_ADDRESS=127.0.0.1:17233

timeout 20 bash -c 'until echo > /dev/tcp/localhost/17233; do sleep 0.5; done'

sleep 1
# Continuously check temporal status until it returns successfully (up to a maximum of 20 times)
# shellcheck disable=SC2034
for i in $(seq 1 20); do
check_temporal_status
if [ $TEMPORAL_EXIT_STATUS -eq 0 ]; then
echo "Service is up..."
break
else
sleep 1
fi
done

if ! temporal operator cluster health; then
echo "Temporal not started"
Expand All @@ -21,4 +31,4 @@ temporal operator cluster system
echo "$TEMPORAL_OUTPUT"

# Exit the script
exit $TEMPORAL_EXIT_STATUS
exit "$TEMPORAL_EXIT_STATUS"
16 changes: 13 additions & 3 deletions examples/vault/.test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -ex
set -x

# vault status and store its exit status
check_vault_status() {
Expand All @@ -8,9 +8,19 @@ check_vault_status() {
VAULT_EXIT_STATUS=$?
}

trap devenv_stop EXIT
# Continuously check vault status until it returns successfully (up to a maximum of 100 times)
# shellcheck disable=SC2034
for i in $(seq 1 20); do
check_vault_status
if [ $VAULT_EXIT_STATUS -eq 0 ]; then
echo "Service is up..."
break
else
sleep 1
fi
done

timeout 20 bash -c 'until echo > /dev/tcp/localhost/8200; do sleep 0.5; done'

# Exit the script
exit $VAULT_EXIT_STATUS
exit "$VAULT_EXIT_STATUS"
1 change: 1 addition & 0 deletions tests/cli/.test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash
set -xe
devenv build languages.python.package

0 comments on commit 1d37fdb

Please sign in to comment.