Skip to content

Commit

Permalink
fix(docker): support all previously used env variables correctly (#12567
Browse files Browse the repository at this point in the history
)

* fix: set build verb default

* fix: use override_update_lock again
  • Loading branch information
oplik0 committed May 11, 2024
1 parent bc807c4 commit 995b2de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions install/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set_defaults() {
export CONFIG_DIR="${CONFIG_DIR:-/opt/config}"
export CONFIG="$CONFIG_DIR/config.json"
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 SETUP="${SETUP:-}"
export PACKAGE_MANAGER="${PACKAGE_MANAGER:-npm}"
Expand Down Expand Up @@ -52,11 +53,11 @@ copy_or_link_files() {
esac

# 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"
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"
fi

Expand Down Expand Up @@ -102,7 +103,7 @@ build_forum() {
local config="$1"
local start_build="$2"
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..."
/usr/src/app/nodebb upgrade --config="$config" || {
echo "Failed to build NodeBB. Exiting..."
Expand Down

0 comments on commit 995b2de

Please sign in to comment.