mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-26 09:05:10 +00:00
chore: Fix linting issues
This commit is contained in:
parent
8841cb963f
commit
33a04fc271
8 changed files with 92 additions and 92 deletions
16
.github/scripts/get-latest-tags.sh
vendored
16
.github/scripts/get-latest-tags.sh
vendored
|
|
@ -4,7 +4,7 @@ set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
get_tag() {
|
get_tag() {
|
||||||
tags=$(git ls-remote --refs --tags --sort='v:refname' https://github.com/$1 "v$2.*")
|
tags=$(git ls-remote --refs --tags --sort='v:refname' "https://github.com/$1" "v$2.*")
|
||||||
tag=$(echo "$tags" | tail -n1 | sed 's/.*\///')
|
tag=$(echo "$tags" | tail -n1 | sed 's/.*\///')
|
||||||
echo "$tag"
|
echo "$tag"
|
||||||
}
|
}
|
||||||
|
|
@ -12,11 +12,9 @@ get_tag() {
|
||||||
FRAPPE_VERSION=$(get_tag frappe/frappe "$VERSION")
|
FRAPPE_VERSION=$(get_tag frappe/frappe "$VERSION")
|
||||||
ERPNEXT_VERSION=$(get_tag frappe/erpnext "$VERSION")
|
ERPNEXT_VERSION=$(get_tag frappe/erpnext "$VERSION")
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
cat <<EOL >>"$GITHUB_ENV"
|
||||||
echo "FRAPPE_VERSION=$FRAPPE_VERSION" >>$GITHUB_ENV
|
FRAPPE_VERSION=$FRAPPE_VERSION
|
||||||
# shellcheck disable=SC2086
|
ERPNEXT_VERSION=$ERPNEXT_VERSION
|
||||||
echo "ERPNEXT_VERSION=$ERPNEXT_VERSION" >>$GITHUB_ENV
|
GIT_BRANCH=version-$VERSION
|
||||||
# shellcheck disable=SC2086
|
VERSION=$VERSION
|
||||||
echo "GIT_BRANCH=version-$VERSION" >>$GITHUB_ENV
|
EOL
|
||||||
# shellcheck disable=SC2086
|
|
||||||
echo "VERSION=$VERSION" >>$GITHUB_ENV
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ if [[ ${SKIP_NGINX_TEMPLATE_GENERATION} == 1 ]]; then
|
||||||
echo "Skipping default NGINX template generation. Please mount your own NGINX config file inside /etc/nginx/conf.d"
|
echo "Skipping default NGINX template generation. Please mount your own NGINX config file inside /etc/nginx/conf.d"
|
||||||
else
|
else
|
||||||
echo "Generating default template"
|
echo "Generating default template"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
envsubst '${FRAPPE_PY}
|
envsubst '${FRAPPE_PY}
|
||||||
${FRAPPE_PY_PORT}
|
${FRAPPE_PY_PORT}
|
||||||
${FRAPPE_SOCKETIO}
|
${FRAPPE_SOCKETIO}
|
||||||
|
|
@ -50,9 +51,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting for frappe-python to be available on ${FRAPPE_PY} port ${FRAPPE_PY_PORT}"
|
echo "Waiting for frappe-python to be available on ${FRAPPE_PY} port ${FRAPPE_PY_PORT}"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${FRAPPE_PY} ${FRAPPE_PY_PORT}
|
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${FRAPPE_PY} ${FRAPPE_PY_PORT}
|
||||||
echo "Frappe-python available on ${FRAPPE_PY} port ${FRAPPE_PY_PORT}"
|
echo "Frappe-python available on ${FRAPPE_PY} port ${FRAPPE_PY_PORT}"
|
||||||
echo "Waiting for frappe-socketio to be available on ${FRAPPE_SOCKETIO} port ${SOCKETIO_PORT}"
|
echo "Waiting for frappe-socketio to be available on ${FRAPPE_SOCKETIO} port ${SOCKETIO_PORT}"
|
||||||
|
# shellcheck disable=SC2016
|
||||||
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${FRAPPE_SOCKETIO} ${SOCKETIO_PORT}
|
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${FRAPPE_SOCKETIO} ${SOCKETIO_PORT}
|
||||||
echo "Frappe-socketio available on ${FRAPPE_SOCKETIO} port ${SOCKETIO_PORT}"
|
echo "Frappe-socketio available on ${FRAPPE_SOCKETIO} port ${SOCKETIO_PORT}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ function configureEnv() {
|
||||||
|
|
||||||
export DB_HOST="${MARIADB_HOST:-$POSTGRES_HOST}"
|
export DB_HOST="${MARIADB_HOST:-$POSTGRES_HOST}"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2016
|
||||||
envsubst '${DB_HOST}
|
envsubst '${DB_HOST}
|
||||||
${DB_PORT}
|
${DB_PORT}
|
||||||
${REDIS_CACHE}
|
${REDIS_CACHE}
|
||||||
|
|
@ -90,7 +91,7 @@ case "$1" in
|
||||||
/home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/commands/auto_migrate.py
|
/home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/commands/auto_migrate.py
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/home/frappe/frappe-bench/env/bin/gunicorn ${LOAD_CONFIG_FILE} -b 0.0.0.0:${FRAPPE_PORT} \
|
/home/frappe/frappe-bench/env/bin/gunicorn "${LOAD_CONFIG_FILE}" -b 0.0.0.0:${FRAPPE_PORT} \
|
||||||
--worker-tmp-dir /dev/shm \
|
--worker-tmp-dir /dev/shm \
|
||||||
--threads=4 \
|
--threads=4 \
|
||||||
--workers ${WORKERS} \
|
--workers ${WORKERS} \
|
||||||
|
|
|
||||||
|
|
@ -17,17 +17,17 @@ fi
|
||||||
# Set REDIS host:port
|
# Set REDIS host:port
|
||||||
REDIS_CACHE=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_cache" | sed 's|redis://||g')
|
REDIS_CACHE=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_cache" | sed 's|redis://||g')
|
||||||
if [[ "${REDIS_CACHE}" == *"/"* ]]; then
|
if [[ "${REDIS_CACHE}" == *"/"* ]]; then
|
||||||
REDIS_CACHE=$(echo ${REDIS_CACHE} | cut -f1 -d"/")
|
REDIS_CACHE=$(echo "${REDIS_CACHE}" | cut -f1 -d"/")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REDIS_QUEUE=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_queue" | sed 's|redis://||g')
|
REDIS_QUEUE=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_queue" | sed 's|redis://||g')
|
||||||
if [[ "${REDIS_QUEUE}" == *"/"* ]]; then
|
if [[ "${REDIS_QUEUE}" == *"/"* ]]; then
|
||||||
REDIS_QUEUE=$(echo ${REDIS_QUEUE} | cut -f1 -d"/")
|
REDIS_QUEUE=$(echo "${REDIS_QUEUE}" | cut -f1 -d"/")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REDIS_SOCKETIO=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_socketio" | sed 's|redis://||g')
|
REDIS_SOCKETIO=$(getUrl "${COMMON_SITE_CONFIG_JSON}" "redis_socketio" | sed 's|redis://||g')
|
||||||
if [[ "${REDIS_SOCKETIO}" == *"/"* ]]; then
|
if [[ "${REDIS_SOCKETIO}" == *"/"* ]]; then
|
||||||
REDIS_SOCKETIO=$(echo ${REDIS_SOCKETIO} | cut -f1 -d"/")
|
REDIS_SOCKETIO=$(echo "${REDIS_SOCKETIO}" | cut -f1 -d"/")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Check ${DB_HOST}:${DB_PORT}"
|
echo "Check ${DB_HOST}:${DB_PORT}"
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@ APP_BRANCH=${3}
|
||||||
|
|
||||||
[[ -n "${APP_BRANCH}" ]] && BRANCH="-b ${APP_BRANCH}"
|
[[ -n "${APP_BRANCH}" ]] && BRANCH="-b ${APP_BRANCH}"
|
||||||
|
|
||||||
git clone --depth 1 -o upstream ${APP_REPO} ${BRANCH} /home/frappe/frappe-bench/apps/${APP_NAME}
|
# shellcheck disable=SC2086
|
||||||
/home/frappe/frappe-bench/env/bin/pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/${APP_NAME}
|
git clone --depth 1 -o upstream "${APP_REPO}" ${BRANCH} "/home/frappe/frappe-bench/apps/${APP_NAME}"
|
||||||
|
/home/frappe/frappe-bench/env/bin/pip3 install --no-cache-dir -e "/home/frappe/frappe-bench/apps/${APP_NAME}"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# shellcheck source=functions.sh
|
|
||||||
source tests/functions.sh
|
source tests/functions.sh
|
||||||
|
|
||||||
project_name=frappe_bench_00
|
project_name=frappe_bench_00
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# shellcheck source=functions.sh
|
|
||||||
source tests/functions.sh
|
source tests/functions.sh
|
||||||
|
|
||||||
project_name="test_erpnext"
|
project_name="test_erpnext"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# shellcheck source=functions.sh
|
|
||||||
source tests/functions.sh
|
source tests/functions.sh
|
||||||
|
|
||||||
project_name="test_frappe"
|
project_name="test_frappe"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue