Now include commit hash in develop builds

This commit is contained in:
Eliot Berriot 2019-01-10 14:55:28 +01:00
parent ee4e5c244f
commit 43e096b1e0
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
2 changed files with 11 additions and 0 deletions

View File

@ -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:

View File

@ -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