mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-27 00:51:16 +01:00
fix(docker): support all previously used env variables correctly (#12567)
* fix: set build verb default * fix: use override_update_lock again
This commit is contained in:
@@ -7,6 +7,7 @@ set_defaults() {
|
|||||||
export CONFIG_DIR="${CONFIG_DIR:-/opt/config}"
|
export CONFIG_DIR="${CONFIG_DIR:-/opt/config}"
|
||||||
export CONFIG="$CONFIG_DIR/config.json"
|
export CONFIG="$CONFIG_DIR/config.json"
|
||||||
export NODEBB_INIT_VERB="${NODEBB_INIT_VERB:-install}"
|
export NODEBB_INIT_VERB="${NODEBB_INIT_VERB:-install}"
|
||||||
|
export NODEBB_BUILD_VERB="${NODEBB_BUILD_VERB:-build}"
|
||||||
export START_BUILD="${START_BUILD:-${FORCE_BUILD_BEFORE_START:-false}}"
|
export START_BUILD="${START_BUILD:-${FORCE_BUILD_BEFORE_START:-false}}"
|
||||||
export SETUP="${SETUP:-}"
|
export SETUP="${SETUP:-}"
|
||||||
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
|
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
|
||||||
@@ -52,11 +53,11 @@ copy_or_link_files() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if source and destination files are the same
|
# Check if source and destination files are the same
|
||||||
if [ "$(realpath "$src_dir/package.json")" != "$(realpath "$dest_dir/package.json")" ]; then
|
if [ "$(realpath "$src_dir/package.json")" != "$(realpath "$dest_dir/package.json")" ] || [ "$OVERRIDE_UPDATE_LOCK" = true ]; then
|
||||||
cp "$src_dir/package.json" "$dest_dir/package.json"
|
cp "$src_dir/package.json" "$dest_dir/package.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(realpath "$src_dir/$lock_file")" != "$(realpath "$dest_dir/$lock_file")" ]; then
|
if [ "$(realpath "$src_dir/$lock_file")" != "$(realpath "$dest_dir/$lock_file")" ] || [ "$OVERRIDE_UPDATE_LOCK" = true ]; then
|
||||||
cp "$src_dir/$lock_file" "$dest_dir/$lock_file"
|
cp "$src_dir/$lock_file" "$dest_dir/$lock_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -102,7 +103,7 @@ build_forum() {
|
|||||||
local config="$1"
|
local config="$1"
|
||||||
local start_build="$2"
|
local start_build="$2"
|
||||||
local package_hash=$(md5sum install/package.json | head -c 32)
|
local package_hash=$(md5sum install/package.json | head -c 32)
|
||||||
if [ package_hash = "$(cat $CONFIG_DIR/install_hash.md5)" ]; then
|
if [ "$package_hash" = "$(cat $CONFIG_DIR/install_hash.md5 || true)" ]; then
|
||||||
echo "package.json was updated. Upgrading..."
|
echo "package.json was updated. Upgrading..."
|
||||||
/usr/src/app/nodebb upgrade --config="$config" || {
|
/usr/src/app/nodebb upgrade --config="$config" || {
|
||||||
echo "Failed to build NodeBB. Exiting..."
|
echo "Failed to build NodeBB. Exiting..."
|
||||||
|
|||||||
Reference in New Issue
Block a user