Github-ceph: Move file to monitor to /srv/

It's better to keep "update file" even after a reboot cause Ceph is not
necessarily automatically upgrade when a new version is release. It's
better to wait few days to avoid possibles regressions.
This commit is contained in:
Jeremy Gardais 2021-03-24 10:07:55 +01:00
parent ea792f4d43
commit 7bef77a04e
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Purpose {{{ # Purpose {{{
## Create a temp file (to monitor) if an upgrade is available for Ceph ## Create a file (to monitor) if an upgrade is available for Ceph
## project on Github. ## project on Github.
## It's based on .deb package (or repository) installation to check the ## It's based on .deb package (or repository) installation to check the
## current version. ## current version.
@ -10,7 +10,7 @@
# wget https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/github/releasetags # wget https://git.ipr.univ-rennes1.fr/cellinfo/scripts/raw/master/github/releasetags
### 2. Create a cron job, eg: ### 2. Create a cron job, eg:
#00 20 * * * root /opt/repos/ipr.scripts/github/check_ceph_update #00 20 * * * root /opt/repos/ipr.scripts/github/check_ceph_update
### 3. Monitor the temp file: /tmp/.github.ceph.upgrade ### 3. Monitor the file: /srv/.github.ceph.upgrade
# Or enable MAILTO in cronjob and edit the script to print a message. # Or enable MAILTO in cronjob and edit the script to print a message.
# Or send a mail. # Or send a mail.
# … # …
@ -50,14 +50,14 @@ ceph_new_version=$("${script_wd}"/releasetags "${ceph_repo_url}" | \
head -n1 | \ head -n1 | \
sed 's/v//g') sed 's/v//g')
ceph_new_version_file="/tmp/.github.ceph.upgrade" ceph_new_version_file="/srv/.github.ceph.upgrade"
# }}} # }}}
# Check if the current version is the last one {{{ # Check if the current version is the last one {{{
if [ "${ceph_current_version}" != "${ceph_new_version}" ]; then if [ "${ceph_current_version}" != "${ceph_new_version}" ]; then
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Test version — Current version (${ceph_current_version}) and new one (${ceph_new_version}) seems to be different." [ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Test version — Current version (${ceph_current_version}) and new one (${ceph_new_version}) seems to be different."
## Create a temp file to monitor ## Create a file to monitor
touch -- "${ceph_new_version_file}" touch -- "${ceph_new_version_file}"
printf '\e[1;35m%-6s\e[m\n' "An upgrade is available for Ceph (current: ${ceph_current_version}): ${ceph_new_version}." >> "${ceph_new_version_file}" printf '\e[1;35m%-6s\e[m\n' "An upgrade is available for Ceph (current: ${ceph_current_version}): ${ceph_new_version}." >> "${ceph_new_version_file}"