-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mediamtx: Publish deployed version if runtime args are present #3285
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,15 @@ name: MediaMTX Docker build | |
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'docker/*mediamtx*' | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'docker/Dockerfile.mediamtx' | ||
- 'docker/mediamtx.yml' | ||
- 'docker/*mediamtx*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
@@ -20,7 +23,7 @@ jobs: | |
permissions: | ||
packages: write | ||
contents: read | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
FROM ubuntu:24.04 | ||
|
||
ENV MEDIAMTX_VERSION="v1.9.3" | ||
FROM ubuntu:24.04 | ||
|
||
# we need curl in the image as it's later used in the runOnReady command | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV MEDIAMTX_VERSION="1.9.3" | ||
|
||
ADD "https://github.com/bluenviron/mediamtx/releases/download/v${MEDIAMTX_VERSION}/mediamtx_v${MEDIAMTX_VERSION}_linux_amd64.tar.gz" /opt/mediamtx.tar.gz | ||
|
||
RUN tar xzf /opt/mediamtx.tar.gz -C /opt/ \ | ||
&& mkdir -p /usr/local/bin /etc/mediamtx/ \ | ||
&& mv /opt/mediamtx /usr/local/bin/mediamtx \ | ||
&& mv /opt/mediamtx.yml /etc/mediamtx/mediamtx.yml \ | ||
&& rm -rf /opt/ | ||
|
||
RUN curl -L https://github.com/bluenviron/mediamtx/releases/download/${MEDIAMTX_VERSION}/mediamtx_${MEDIAMTX_VERSION}_linux_amd64.tar.gz -o /mediamtx.tar.gz \ | ||
&& tar xzvf /mediamtx.tar.gz \ | ||
&& rm /mediamtx.tar.gz | ||
COPY mediamtx-entry.bash / | ||
|
||
ENTRYPOINT ["/mediamtx"] | ||
ENTRYPOINT ["/mediamtx-entry.bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
[ -v DEBUG ] && set -x | ||
|
||
set -euo pipefail | ||
|
||
if [ -v LP_PUBLISH_MEDIAMTX_METRICS ]; then | ||
if [ -z "$LP_PUBLISH_MEDIAMTX_METRICS_ENDPOINT" ]; then | ||
echo >&2 "No endpoint specified for publishing mediamtx metrics." | ||
fi | ||
echo <<EOF | | ||
# HELP version Current software version as a tag, always 1 | ||
# TYPE version gauge | ||
version{app="MediaMTX",version="$MEDIAMTX_VERSION"} 1 | ||
EOF | ||
curl -X POST --data-binary @- "$LP_PUBLISH_MEDIAMTX_METRICS_ENDPOINT" | ||
fi | ||
|
||
exec "${@:-/usr/local/bin/mediamtx}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we exit if the endpoint is not specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was thinking it more as a warning than a fail condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
LP_PUBLISH_MEDIAMTX_METRICS_ENDPOINT
is missing thencurl
would fail few lines below.But yeah warning is fine... I think we'd catch it missing anyway as not having mediamtx version on grafana