Skip to content

Commit

Permalink
Add build date time
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Sep 23, 2023
1 parent 0f6594c commit 06f2cd0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ RUN cd /build \
&& curl -SL https://github.com/bluenviron/mediamtx/releases/download/v${MTX_TAG}/mediamtx_v${MTX_TAG}_linux_${MTX_ARCH:-amd64}.tar.gz \
| tar xzf - -C app \
&& cp app/${LIB_ARCH:-amd}.lib usr/local/lib/libIOTCAPIs_ALL.so \
&& rm app/*.txt app/*.lib
&& rm app/*.txt app/*.lib \
&& echo BUILD_DATE=$(date) > .build_date


FROM base
ARG BUILD
Expand Down
3 changes: 2 additions & 1 deletion app/Dockerfile.hwaccel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN cd /build \
| tar -xzf - -C app --wildcards 'mediamtx*' \
&& cp app/amd.lib usr/local/lib/libIOTCAPIs_ALL.so \
&& if [ -n "$QSV" ]; then cp -R /usr/lib/x86_64-linux-gnu/ usr/lib/; fi \
&& rm app/*.txt app/*.lib
&& rm app/*.txt app/*.lib \
&& echo BUILD_DATE=$(date) > .build_date

FROM base
ARG BUILD
Expand Down
3 changes: 2 additions & 1 deletion app/Dockerfile.multiarch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ RUN cd /build \
&& curl -SL https://github.com/bluenviron/mediamtx/releases/download/v${MTX_TAG}/mediamtx_v${MTX_TAG}_linux_${MTX_ARCH:-amd64}.tar.gz \
| tar xzf - -C app \
&& cp app/${LIB_ARCH:-amd}.lib usr/local/lib/libIOTCAPIs_ALL.so \
&& rm app/*.txt app/*.lib
&& rm app/*.txt app/*.lib \
&& echo BUILD_DATE=$(date) > .build_date

FROM base_$TARGETARCH
ARG BUILD
Expand Down
3 changes: 2 additions & 1 deletion app/Dockerfile.qsv
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN cd /build \
| tar -xzf - -C app --wildcards 'mediamtx*' \
&& cp app/amd.lib usr/local/lib/libIOTCAPIs_ALL.so \
&& if [ -n "$QSV" ]; then cp -R /usr/lib/x86_64-linux-gnu/ usr/lib/ && cp -R /usr/bin/ usr/bin; fi \
&& rm app/*.txt app/*.lib
&& rm app/*.txt app/*.lib \
&& echo BUILD_DATE=$(date) > .build_date

FROM base
ARG BUILD
Expand Down
4 changes: 3 additions & 1 deletion app/wyzebridge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
from wyzebridge.hass import setup_hass

load_dotenv()
load_dotenv("/.build_date")

VERSION: str = getenv("VERSION", "DEV")
BUILD = env_bool("BUILD", "local")
BUILD_STR = "" if BUILD == VERSION else f"[{BUILD.upper()} BUILD]"
BUILD_DATE = env_bool("BUILD_DATE")
BUILD_STR = "" if BUILD == VERSION else f"[{BUILD.upper()} BUILD] {BUILD_DATE}"
HASS_TOKEN: str = getenv("SUPERVISOR_TOKEN", "")
setup_hass(HASS_TOKEN)
MQTT_DISCOVERY = env_bool("MQTT_DTOPIC")
Expand Down

0 comments on commit 06f2cd0

Please sign in to comment.