Skip to content

Commit

Permalink
Update version approach (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer authored Aug 20, 2024
1 parent 885f2d8 commit 87c97cc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 37 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
# __author__ = '[email protected]'
# __date__ = '13/06/2023'
# __copyright__ = ('Copyright 2023, Unicef')
exec git rev-parse --verify HEAD > commit.txt

exec git describe --tags > _version.txt
exec git rev-parse --verify HEAD > _commit_hash.txt
6 changes: 3 additions & 3 deletions django_project/core/context_processors/global_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

def project_version(request):
"""Read project version from file."""
folder = ABS_PATH('version')
folder = ABS_PATH('')
version = ''
version_file = os.path.join(folder, 'version.txt')
version_file = os.path.join(folder, '_version.txt')
if os.path.exists(version_file):
version += (open(version_file, 'rb').read()).decode("utf-8")
commit_file = os.path.join(folder, 'commit.txt')
commit_file = os.path.join(folder, '_commit_hash.txt')
if os.path.exists(commit_file):
commit = (open(commit_file, 'rb').read()).decode("utf-8")[:5]
if commit:
Expand Down
18 changes: 0 additions & 18 deletions django_project/version/__init__.py

This file was deleted.

15 changes: 0 additions & 15 deletions django_project/version/version.sh

This file was deleted.

0 comments on commit 87c97cc

Please sign in to comment.