Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix shell scripts. (#1179)

Niklas Hambüchen2d413129a72d
diff --git a/.gitlab/build-scripts/docker-entrypoint.sh b/.gitlab/build-scripts/docker-entrypoint.sh
index 0ab3e8ff2d..b693040f97 100755
--- a/.gitlab/build-scripts/docker-entrypoint.sh
+++ b/.gitlab/build-scripts/docker-entrypoint.sh
@@ -1,10 +1,10 @@
#!/bin/sh
set -e
-if [[ "$1" = 'run' ]]; then
+if [ "$1" = 'run' ]; then
exec /app/bin/plausible start
-elif [[ "$1" = 'db' ]]; then
+elif [ "$1" = 'db' ]; then
exec /app/"$2".sh
else
exec "$@"
diff --git a/.gitlab/build-scripts/docker.gitlab.sh b/.gitlab/build-scripts/docker.gitlab.sh
index 4cc663ca04..51395c8b18 100644
--- a/.gitlab/build-scripts/docker.gitlab.sh
+++ b/.gitlab/build-scripts/docker.gitlab.sh
@@ -23,10 +23,10 @@ function docker_build_image() {
/kaniko/executor \
--cache=true \
- --context ${CI_PROJECT_DIR} \
- --dockerfile ${CI_PROJECT_DIR}/Dockerfile \
- --destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA} \
- --destination ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-latest \
+ --context "${CI_PROJECT_DIR}" \
+ --dockerfile "${CI_PROJECT_DIR}"/Dockerfile \
+ --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}" \
+ --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}-latest" \
\
"$@"
diff --git a/rel/overlays/createdb.sh b/rel/overlays/createdb.sh
index 21a221f0dc..172c9bb71e 100755
--- a/rel/overlays/createdb.sh
+++ b/rel/overlays/createdb.sh
@@ -2,6 +2,6 @@
# Creates the database if needed
-BIN_DIR=`dirname "$0"`
+BIN_DIR=$(dirname "$0")
-${BIN_DIR}/bin/plausible eval Plausible.Release.createdb
\ No newline at end of file
+"${BIN_DIR}"/bin/plausible eval Plausible.Release.createdb
diff --git a/rel/overlays/init-admin.sh b/rel/overlays/init-admin.sh
index 5d64ec6d4e..474fc3f038 100755
--- a/rel/overlays/init-admin.sh
+++ b/rel/overlays/init-admin.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# Create an admin user
-BIN_DIR=`dirname "$0"`
+BIN_DIR=$(dirname "$0")
-${BIN_DIR}/bin/plausible eval Plausible.Release.init_admin
+"${BIN_DIR}"/bin/plausible eval Plausible.Release.init_admin
diff --git a/rel/overlays/migrate.sh b/rel/overlays/migrate.sh
index d77c1ece0e..15a0e0d406 100755
--- a/rel/overlays/migrate.sh
+++ b/rel/overlays/migrate.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# starts the db migration
-BIN_DIR=`dirname "$0"`
+BIN_DIR=$(dirname "$0")
-${BIN_DIR}/bin/plausible eval Plausible.Release.migrate
\ No newline at end of file
+"${BIN_DIR}"/bin/plausible eval Plausible.Release.migrate
diff --git a/rel/overlays/rollback.sh b/rel/overlays/rollback.sh
index db69eba64e..fc39fed5bc 100755
--- a/rel/overlays/rollback.sh
+++ b/rel/overlays/rollback.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-BIN_DIR=`dirname "$0"`
+BIN_DIR=$(dirname "$0")
-${BIN_DIR}/bin/plausible eval Plausible.Release.rollback
\ No newline at end of file
+"${BIN_DIR}"/bin/plausible eval Plausible.Release.rollback
diff --git a/rel/overlays/seed.sh b/rel/overlays/seed.sh
index 1791f86d71..919c09e62e 100755
--- a/rel/overlays/seed.sh
+++ b/rel/overlays/seed.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-BIN_DIR=`dirname "$0"`
+BIN_DIR=$(dirname "$0")
-${BIN_DIR}/bin/plausible eval Plausible.Release.seed
\ No newline at end of file
+"${BIN_DIR}"/bin/plausible eval Plausible.Release.seed