version script test

This commit is contained in:
vabene1111
2020-06-10 10:07:33 +02:00
parent 1d6375bf84
commit 01b9022451
4 changed files with 17 additions and 2 deletions

View File

@@ -10,6 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: DamianReeves/write-file-action
with:
path: version.py
contents: |
echo "VERSION_NUMBER = 'develop'"
echo "BUILD_REF = '$(git rev-parse --short "$GITHUB_SHA")'"
write-mode: overwrite
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@2.13
with:

View File

@@ -16,7 +16,10 @@
Django Recipes is an open source free software application. It can be found on <a href="https://github.com/vabene1111/recipes">GitHub</a>.
Changelogs can be found <a href="https://github.com/vabene1111/recipes/releases">here</a>.
{% endblocktrans %}
<br/>
<br/>
Current Version: {{ version }}<br/>
Ref: {{ ref }}
<br/>
<br/>
<br/>

View File

@@ -20,6 +20,8 @@ from cookbook.forms import *
from cookbook.helper.permission_helper import group_required
from cookbook.tables import RecipeTable, RecipeTableSmall, CookLogTable, ViewLogTable
from recipes.version import *
def index(request):
if not request.user.is_authenticated:
@@ -267,7 +269,8 @@ def history(request):
@group_required('admin')
def system(request):
postgres = False if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql_psycopg2' else True
return render(request, 'system.html', {'gunicorn_media': settings.GUNICORN_MEDIA, 'debug': settings.DEBUG, 'postgres': postgres})
return render(request, 'system.html', {'gunicorn_media': settings.GUNICORN_MEDIA, 'debug': settings.DEBUG, 'postgres': postgres, 'version': VERSION_NUMBER, 'ref': BUILD_REF})
def setup(request):

2
recipes/version.py Normal file
View File

@@ -0,0 +1,2 @@
VERSION_NUMBER = "0.0.0"
BUILD_REF = ""