updated the way version is reported in the container

This commit is contained in:
Chris 2023-11-24 18:18:36 +00:00
parent 78860f3329
commit b2009490a1
3 changed files with 5 additions and 6 deletions

View File

@ -48,6 +48,9 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Take git tag and put into web/version.txt
run: |
git describe --tags --always > VERSION
- name: Build and push
uses: docker/build-push-action@v5
with:

View File

@ -46,10 +46,6 @@ _buildConfig() {
echo ""
echo "[CLEANUP]"
echo "DELETE_OLDER_THAN_DAYS=${DELETE_OLDER_THAN_DAYS:-false}"
echo ""
GIT_VERSION=$(git describe --tags --always)
echo "[VERSION]"
echo "VERSION=${GIT_VERSION:-dev}"
}
_buildConfig > /var/www/opentrashmail/config.ini

View File

@ -260,8 +260,8 @@ function isIPInRange( $ip, $range ) {
function getVersion()
{
if(file_exists(ROOT.DS.'..'.DS.'version.txt'))
return 'v'.trim(file_get_contents(ROOT.DS.'..'.DS.'version.txt'));
if(file_exists(ROOT.DS.'..'.DS.'VERSION'))
return 'v'.trim(file_get_contents(ROOT.DS.'..'.DS.'VERSION'));
else return '';
}