From ee4e5c244fb0fefada5ffc83be132b4572930387 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 10 Jan 2019 14:48:16 +0100 Subject: [PATCH 1/2] Bumbed version number to 0.18-dev --- api/funkwhale_api/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/funkwhale_api/__init__.py b/api/funkwhale_api/__init__.py index 7ad37d53d..5c6c7cec7 100644 --- a/api/funkwhale_api/__init__.py +++ b/api/funkwhale_api/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.17" +__version__ = "0.18-dev" __version_info__ = tuple( [ int(num) if num.isdigit() else num From 43e096b1e0f007383941aa0a541add59a53fa289 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 10 Jan 2019 14:55:28 +0100 Subject: [PATCH 2/2] Now include commit hash in develop builds --- .gitlab-ci.yml | 2 ++ scripts/set-api-build-metadata.sh | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100755 scripts/set-api-build-metadata.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c10700f6f..194125609 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -240,6 +240,7 @@ docker_release: - cp -r front/dist api/frontend - cd api script: + - if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata $CI_COMMIT_SHORT_SHA; fi); - docker build -t $IMAGE . - docker push $IMAGE only: @@ -257,6 +258,7 @@ build_api: paths: - api script: + - if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata $CI_COMMIT_SHORT_SHA; fi); - chmod -R 750 api - echo Done! only: diff --git a/scripts/set-api-build-metadata.sh b/scripts/set-api-build-metadata.sh new file mode 100755 index 000000000..62c826caa --- /dev/null +++ b/scripts/set-api-build-metadata.sh @@ -0,0 +1,9 @@ +#!/bin/bash -eu +# given a commit hash, will append this to the version number stored +# in api/funkwhale_api/__init__.py + +commit=$1 +suffix="+git.$commit" +replace="__version__ = \"\1${suffix}\"" +file="api/funkwhale_api/__init__.py" +sed -i -E 's@__version__ = \"(.*)\"@'"$replace"'@' $file