diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-06-12 11:54:56 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-06-12 11:54:56 +0200 |
commit | 3bbaf79bf5961f05f2a6f278f6f222b8e3ba49f7 (patch) | |
tree | cc98b2a705b92d88f937aec04ca5d82d1f1377dd /installer/opengnsys_installer.sh | |
parent | 22087adb0242fbd6ed6896a6227bb41c1c1af668 (diff) |
#843: Installer and updater use new version file.
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-x | installer/opengnsys_installer.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 7d41bd6b..523aaaf2 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -1556,21 +1556,22 @@ function installationSummary() local VERSIONFILE REVISION # Crear fichero de versión y revisión, si no existe. - VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt" - [ -f $VERSIONFILE ] || echo "OpenGnsys Server" >$VERSIONFILE - # Incluir datos de revisión, si se está instaladno desde el repositorio + VERSIONFILE="$INSTALL_TARGET/doc/VERSION.json" + [ -f $VERSIONFILE ] || echo '{ "project": "OpenGnsys" }' >$VERSIONFILE + # Incluir datos de revisión, si se está instalando desde el repositorio # de código o si no está incluida en el fichero de versión. - if [ $REMOTE -eq 1 ] || [ -z "$(awk '$3~/r[0-9]*/ {print}' $VERSIONFILE)" ]; then + if [ $REMOTE -eq 1 ] || [ -z "$(jq -r '.release' $VERSIONFILE)" ]; then # Revisión: rAñoMesDía.Gitcommit (8 caracteres de fecha y 7 primeros de commit). - REVISION=$(curl -s "$API_URL" | jq -r '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])') - sed -ri "s/($| r[.0-9a-f]+)/ $REVISION/" $VERSIONFILE + REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.commit.committer.date | gsub("-"; "")[:8]) + "." + (.commit.sha[:7])') + jq ".release=$REVISION" $VERSIONFILE | sponge $VERSIONFILE fi + VERSION="$(jq -r '[.project, .version, .codename, .release] | join(" ")' $VERSIONFILE 2>/dev/null)" # Mostrar información. echo echoAndLog "OpenGnsys Installation Summary" echo "==============================" - echoAndLog "Project version: $(cat $VERSIONFILE 2>/dev/null)" + echoAndLog "Project version: $VERSION" echoAndLog "Installation directory: $INSTALL_TARGET" echoAndLog "Installation log file: $LOG_FILE" echoAndLog "Repository directory: $INSTALL_TARGET/images" |