mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 01:22:15 +03:00
Fix shell scripts. (#1179)
There were various mistakes in the shell scripts, such as lack of quoting; they would break them immediately e.g. if `BIN_DIR` contained a space. Pointed out by `shellcheck`.
This commit is contained in:
parent
fef5337a64
commit
2d413129a7
@ -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 "$@"
|
||||
|
@ -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" \
|
||||
\
|
||||
"$@"
|
||||
|
||||
|
@ -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
|
||||
"${BIN_DIR}"/bin/plausible eval Plausible.Release.createdb
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
"${BIN_DIR}"/bin/plausible eval Plausible.Release.migrate
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN_DIR=`dirname "$0"`
|
||||
BIN_DIR=$(dirname "$0")
|
||||
|
||||
${BIN_DIR}/bin/plausible eval Plausible.Release.rollback
|
||||
"${BIN_DIR}"/bin/plausible eval Plausible.Release.rollback
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
BIN_DIR=`dirname "$0"`
|
||||
BIN_DIR=$(dirname "$0")
|
||||
|
||||
${BIN_DIR}/bin/plausible eval Plausible.Release.seed
|
||||
"${BIN_DIR}"/bin/plausible eval Plausible.Release.seed
|
||||
|
Loading…
Reference in New Issue
Block a user