You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ shellcheck gitlab/tasks/postgres_upgrade.sh
In gitlab/tasks/postgres_upgrade.sh line 12:
if [ $DB_SIZE -lt $FREE ]; then
^------^ SC2086: Double quote to prevent globbing and word splitting.
^---^ SC2086: Double quote to prevent globbing and word splitting.
Did you mean:
if [ "$DB_SIZE" -lt "$FREE" ]; then
For more information:
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
The text was updated successfully, but these errors were encountered:
here's the corrected file. am not sure how I can get pupperware/puppet module to show me a diff against the forge version
#!/bin/bash
echo 'Checking pgsql version'
CMD=$(gitlab-psql --version)
echo "version is ${CMD##* }"
#9.2.18
if [ "${CMD##* }" = "9.2.18" ]; then
echo 'Version is below required for Gitlab 10+, checking...'
DB_SIZE=$(du -shk /var/opt/gitlab/postgresql/data | awk '{print $1}')
FREE=$(df -hk /var/opt/gitlab/postgresql/data/ | tail -1 | awk '{print $4}')
echo "Database size is: $DB_SIZE kb and freespace is $FREE kb"
if [ "$DB_SIZE" -lt "$FREE" ]; then
echo 'Enough freespace available to proceed.'
gitlab-ctl pg-upgrade
echo 'Upgrade complete. Please verify everything is correct and then run the post_upgrade task.'
else
echo 'You need to have enough freespace for a second copy of the database. Please resolve and then re-run the task.'
exit 1
fi
else
echo 'Version is correct for Gitlab 10+, upgrade skipped...'
fi
simple scripting tweak required:
The text was updated successfully, but these errors were encountered: