diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2019-11-30 21:44:01 +0100 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-11-30 21:44:01 +0100 |
commit | 6ab13a314902cfdb5296d1987557c351ecf3e54d (patch) | |
tree | 503d3713506b4a903b7334ce527b542446bd5498 /installer/opengnsys_installer.sh | |
parent | 062ea34989d8c7797ceb60a439c88550d87cb1df (diff) |
#914: Fix bug when getting the release from a Git tag.opengnsys-1.1.1
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-x | installer/opengnsys_installer.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 39ca5e91..04ecf25c 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -132,9 +132,9 @@ function globalSetup () else REMOTE=1 fi - BRANCH="master" + BRANCH="opengnsys-1.1.1" CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH" - API_URL="https://api.github.com/repos/opengnsys/OpenGnsys/branches/$BRANCH" + API_URL="https://api.github.com/repos/opengnsys/OpenGnsys" # Directorios de instalación y destino de OpenGnsys. WORKDIR=/tmp/opengnsys_installer @@ -1568,8 +1568,10 @@ function installationSummary() # de código o si no está incluida en el fichero de versión. 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" + (.commit.commit.committer.date | split("-") | join("")[:8]) + "." + (.commit.sha[:7])') - jq ".release=$REVISION" $VERSIONFILE | sponge $VERSIONFILE + RELEASE=$(curl -s "$API_URL/branches/$BRANCH" | jq -r '"r" + (.commit.commit.committer.date | split("-") | join("")[:8]) + "." + (.commit.sha[:7])' 2>/dev/null) + # Obtener revisión para etiqueta de versión en vez de rama de código. + [ -z "$RELEASE" ] && RELEASE=$(curl -s $(curl -s "$API_URL/tags" | jq -r ".[] | select(.name==\"$BRANCH\").commit.url" 2>/dev/null) | jq -r '"r" + (.commit.committer.date | split("-") | join("")[:8]) + "." + (.commit.tree.sha[:7])' 2>/dev/null) + jq ".release=\"$RELEASE\"" $VERSIONFILE | sponge $VERSIONFILE fi VERSION="$(jq -r '[.project, .version, .codename, .release] | join(" ")' $VERSIONFILE 2>/dev/null)" |