fix: include version variable inside containers

This commit is contained in:
jo 2022-09-21 14:40:53 +02:00 committed by Kyle Robbertze
parent 956d19ec95
commit 09a75570f3
4 changed files with 27 additions and 0 deletions

View File

@ -22,6 +22,8 @@ runs:
context: .
pull: true
push: ${{ github.event_name == 'push' }}
build-args: |
LIBRETIME_VERSION=${{ env.LIBRETIME_VERSION }}
target: ${{ inputs.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -30,6 +30,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Guess LIBRETIME_VERSION
run: |
make VERSION
echo "LIBRETIME_VERSION=$(cat VERSION | tr -d [:blank:])" >> $GITHUB_ENV
- name: Build python-builder
uses: docker/build-push-action@v3
with:

View File

@ -1,3 +1,4 @@
ARG LIBRETIME_VERSION
#======================================================================================#
# Python Builder #
#======================================================================================#
@ -89,6 +90,9 @@ WORKDIR /app
CMD ["/usr/local/bin/libretime-analyzer"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# API #
#======================================================================================#
@ -126,6 +130,9 @@ CMD ["/usr/local/bin/gunicorn", \
"--bind=0.0.0.0:9001", \
"libretime_api.asgi"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Playout #
#======================================================================================#
@ -161,6 +168,9 @@ WORKDIR /app
CMD ["/usr/local/bin/libretime-playout"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Worker #
#======================================================================================#
@ -191,6 +201,9 @@ CMD ["/usr/local/bin/celery", "worker", \
"--concurrency=1", \
"--loglevel=info"]
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
#======================================================================================#
# Legacy #
#======================================================================================#
@ -260,3 +273,6 @@ RUN composer --no-cache dump-autoload --no-interaction --no-dev
# Run
USER ${UID}:${GID}
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION

View File

@ -403,6 +403,10 @@ class Config
}
}
if (getenv('LIBRETIME_VERSION')) {
$version = trim(getenv('LIBRETIME_VERSION'));
}
self::$legacy_values['airtime_version'] = $version;
}