Skip to content

Commit

Permalink
Merge pull request #62 from fdm-monster/feat/upgrade-fdm-monster-1.6.2
Browse files Browse the repository at this point in the history
feat: upgrade to FDM Monster 1.6.2
  • Loading branch information
davidzwa authored Apr 22, 2024
2 parents 804d424 + eb1b813 commit 59f0622
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export DIST_NAME=MonsterPi
export DIST_VERSION=0.3.2-rc3
export DIST_VERSION=0.3.2-rc4

export BASE_DISTRO=ubuntu
export BASE_ARCH=aarch64
Expand Down
2 changes: 1 addition & 1 deletion src/modules/monsterpi/config
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
[ -n "$MONSTERPI_INCLUDE_HAPROXY" ] || MONSTERPI_INCLUDE_HAPROXY=yes

# FDM Monster version
[ -n "$MONSTERPI_FDMMONSTER_VERSION" ] || MONSTERPI_FDMMONSTER_VERSION=1.6.0-rc3
[ -n "$MONSTERPI_FDMMONSTER_VERSION" ] || MONSTERPI_FDMMONSTER_VERSION=1.6.2
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,26 @@ dpkg --verify p7zip-full || sudo apt-get install -y p7zip-full
echo "[7b/${ts}] Extracting new dist zip to ${dist_active_path}"
7z x "${dist_zips_path}/${zip_file}" -o"${dist_active_path}"

# Step 8) Ensure yarn is new, (optional)
echo "[8/${ts}] Updating yarn"
npm i --global --force yarn
yarn set version berry

# Step 9) Ensure the required packages are present with yarn (which is already installed, we're just keeping it fresh)
echo "[9/${ts}] Updating the necessary modules of FDM Monster"
pushd "${dist_active_path}"
YARN_HTTP_TIMEOUT=1000000 yarn workspaces focus --all --production
# Step 8) Ensure yarn is new, (optional)
echo "[8/${ts}] Ensure .yarn and yarnrc.yml are in correct state, enable corepack and set to using yarn v4+"

# Until the fix in this issue is released, we need a small hack
# https://github.com/fdm-monster/fdm-monster/issues/3143
if [ -d ".yarn" ]; then
echo "[8/${ts}] .yarn directory exists."
corepack enable
else
echo ".yarn directory does not exist."
rm -f -- "yarnrc.yml"
export YARN_IGNORE_PATH=1
corepack enable
yarn set version latest
fi

# Step 9) Ensure the required packages are present with yarn (which is already installed, we're just keeping it fresh)
echo "[9/${ts}] Updating the necessary modules of FDM Monster"
YARN_HTTP_TIMEOUT=1000000 yarn workspaces focus --all --production
popd

# Step 10) Run the service
Expand Down
25 changes: 11 additions & 14 deletions src/modules/monsterpi/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,13 @@ fi
# Install GPG
apt install -y gnupg

# Add MongoDB as trusted source list
wget -qO - https://www.mongodb.org/static/pgp/server-"$MONSTERPI_MONGODB_VERSION".asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/`cat /etc/os-release | grep "^ID=" | cut -d "=" -f2` `cat /etc/os-release | grep "^VERSION_CODENAME=" | cut -d "=" -f2`/mongodb-org/$MONSTERPI_MONGODB_VERSION multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$MONSTERPI_MONGODB_VERSION.list
apt update

# Install MongoDB
sudo apt install -y mongodb-org=4.4.15 mongodb-org-server=4.4.15 mongodb-org-shell=4.4.15 mongodb-org-mongos=4.4.15 mongodb-org-tools=4.4.15
systemctl enable mongod
systemctl start mongod

# Install Node.js based on MONSTERPI_NODEJS_VERSION
curl -sL https://deb.nodesource.com/setup_$MONSTERPI_NODEJS_VERSION | bash -
apt update
apt install -y nodejs

# Enable yarn/pnpm/npm
corepack enable

# Install FDM Monster (this is really slow on QEMU!)
pushd /home/"${BASE_USER}"
# Install FDM Monster (this is really slow on QEMU!)
cd /home/"${BASE_USER}"/scripts/
bash ./update-fdm-monster.sh --tag "${tag}" --non-interactive

Expand All @@ -81,6 +68,16 @@ pushd /home/"${BASE_USER}"
fi
popd

# Add MongoDB as trusted source list
wget -qO - https://www.mongodb.org/static/pgp/server-"$MONSTERPI_MONGODB_VERSION".asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/`cat /etc/os-release | grep "^ID=" | cut -d "=" -f2` `cat /etc/os-release | grep "^VERSION_CODENAME=" | cut -d "=" -f2`/mongodb-org/$MONSTERPI_MONGODB_VERSION multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-$MONSTERPI_MONGODB_VERSION.list
apt update

# Install MongoDB
sudo apt install -y mongodb-org=4.4.15 mongodb-org-server=4.4.15 mongodb-org-shell=4.4.15 mongodb-org-mongos=4.4.15 mongodb-org-tools=4.4.15
systemctl enable mongod
systemctl start mongod

# add some "How To" info to boot output
# Note, this code is also in /filesystem/home/pi/scripts/
sed -i 's@exit 0@@' /etc/rc.local
Expand Down

0 comments on commit 59f0622

Please sign in to comment.