Skip to content

Commit

Permalink
Merge pull request #7773 from tangledbytes/utkarsh/fix/rpm-upgrades
Browse files Browse the repository at this point in the history
[NSFS | NC] fix NooBaa NSFS RPM Upgrade
  • Loading branch information
tangledbytes authored Jan 31, 2024
2 parents 2212055 + 4421cb5 commit 3142e2b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
35 changes: 0 additions & 35 deletions src/deploy/RPM_build/noobaa.spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,6 @@ if [ "${state}" == "active" ]; then
service rsyslog restart
fi

if [ $1 -gt 1 ]; then
UPGRADE_SCRIPTS_DIR=/root/node_modules/noobaa-core/src/upgrade/upgrade_scripts
NSFS_UPGRADE_SCRIPTS_DIR=/root/node_modules/noobaa-core/src/upgrade/nsfs_upgrade_scripts

NOOBAA_RPM_BASE_PATH="$RPM_BUILD_ROOT/usr/local/noobaa-core"
pushd $NOOBAA_RPM_BASE_PATH

echo "Checking deployment type"
echo "Looking for NSFS deployment"
pgrep -f "cmd/nsfs" > /dev/null
rc=$?
if [ "${rc}" -eq 0 ]; then
echo "Found NSFS deployment"
/usr/local/noobaa-core/bin/node src/upgrade/upgrade_manager.js --nsfs true --upgrade_scripts_dir ${NSFS_UPGRADE_SCRIPTS_DIR}
rccmd=$?
else
echo "Looking for non-NSFS deployment"
pgrep -f "server/web_server" > /dev/null
rc=$?
if [ "${rc}" -eq 0 ]; then
echo "Found non-NSFS deployment"
/usr/local/noobaa-core/bin/node src/upgrade/upgrade_manager.js --upgrade_scripts_dir ${UPGRADE_SCRIPTS_DIR}
rccmd=$?
else
echo "No deployments found, skipping upgrade"
exit 0
fi
fi

if [ ${rccmd} -ne 0 ]; then
echo "upgrade_manager failed with exit code ${rccmd}"
exit ${rccmd}
fi
fi

%changelog
* %{releasedate} NooBaa Team <[email protected]>
%{changelogdata}
1 change: 1 addition & 0 deletions src/deploy/noobaa_nsfs.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Restart=always
RestartSec=2
User=root
Group=root
ExecStartPre=/usr/local/noobaa-core/bin/node /usr/local/noobaa-core/src/upgrade/upgrade_manager.js --nsfs true --upgrade_scripts_dir /usr/local/noobaa-core/src/upgrade/nsfs_upgrade_scripts
ExecStart=/usr/local/noobaa-core/bin/node /usr/local/noobaa-core/src/cmd/nsfs.js
EnvironmentFile=-/etc/sysconfig/noobaa_nsfs
ExecStop=/bin/kill $MAINPID
Expand Down

0 comments on commit 3142e2b

Please sign in to comment.