Skip to content

Commit

Permalink
No need to backup during upgrade. Also ensure that django secret key …
Browse files Browse the repository at this point in the history
…doesn't get overwritten.
  • Loading branch information
bdzim committed Nov 4, 2014
1 parent 7210272 commit 10f73bf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions upgrade/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ echo "updated tarball"
# Bring over configuration into the new stuff.
cp /opt/openmanage.$CURRENT_DATE/etc/agent_config.json /opt/openmanage/etc

random_string="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c 64;echo;)"
secret_key="export DJANGO_SECRET_KEY=\"$random_string\""
echo $secret_key >> /opt/openmanage/etc/openmanage_defaults

echo "Updating database..."
/opt/openmanage/upgrade/apply_sql.sh

Expand All @@ -78,15 +74,16 @@ find /opt/openmanage/upgrade/resources/ -name '*.deb' | xargs dpkg -i

cat /opt/openmanage/upgrade/requirements.txt | xargs pip install

# Set django secret key
random_string="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c 64;echo;)"
secret_key="export DJANGO_SECRET_KEY=\"$random_string\""
echo $secret_key >> /opt/openmanage/etc/openmanage_defaults

# Restart services
for SERVICE in openmanage admin_console; do
sv up $SERVICE
done

# Backup VM
sudo /opt/openmanage/bin/backup_omva.sh
echo "Backup complete"

# Set VM version
python /opt/openmanage/bin/set_version.py $VERSION

Expand Down

0 comments on commit 10f73bf

Please sign in to comment.