-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
srs-stack: Support SRS Stack HELM. v1.0.1
- Loading branch information
Showing
19 changed files
with
673 additions
and
12 deletions.
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
|
||
# Execute by: bash xxx.sh or bash zzz/yyy/xxx.sh or ./xxx.sh or ./zzz/yyy/xxx.sh source xxx.sh | ||
REALPATH=$(realpath ${BASH_SOURCE[0]}) | ||
SCRIPT_DIR=$(cd $(dirname ${REALPATH}) && pwd) | ||
WORK_DIR=$(cd $(dirname ${REALPATH})/.. && pwd) | ||
echo "BASH_SOURCE=${BASH_SOURCE}, REALPATH=${REALPATH}, SCRIPT_DIR=${SCRIPT_DIR}, WORK_DIR=${WORK_DIR}" | ||
cd ${WORK_DIR} | ||
|
||
help=false | ||
refresh=false | ||
target= | ||
|
||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
-h|--help) help=true; shift ;; | ||
-refresh|--refresh) refresh=true; shift ;; | ||
-target|--target) target="$2"; shift 2;; | ||
*) echo "Unknown parameter passed: $1"; exit 1 ;; | ||
esac | ||
done | ||
|
||
if [ "$help" = true ]; then | ||
echo "Usage: $0 [OPTIONS]" | ||
echo "Options:" | ||
echo " -h, --help Show this help message and exit" | ||
echo " -refresh, --refresh Refresh current tag. Default: false" | ||
echo " -target, --target The target version to release, for example, v5.7.28" | ||
exit 0 | ||
fi | ||
|
||
if [[ ! -z $target ]]; then | ||
RELEASE=$target | ||
refresh=yes | ||
else | ||
RELEASE=$(git describe --tags --abbrev=0 --match srs-stack-v* |sed 's/srs-stack-//g') | ||
fi | ||
if [[ $? -ne 0 ]]; then echo "Release failed"; exit 1; fi | ||
|
||
REVISION=$(echo $RELEASE |awk -F . '{print $3}') | ||
if [[ $? -ne 0 ]]; then echo "Release failed"; exit 1; fi | ||
|
||
let NEXT=$REVISION+1 | ||
if [[ $refresh == yes ]]; then | ||
let NEXT=$REVISION | ||
fi | ||
VERSION=$(echo $RELEASE |sed 's/v//g') | ||
TAG=$RELEASE | ||
echo "RELEASE=$RELEASE, VERSION=$VERSION, TAG=$TAG, REVISION=$REVISION, NEXT=$NEXT" | ||
|
||
if [[ $(grep -q "version: $VERSION" srs-stack/Chart.yaml || echo no) == no ]]; then | ||
VERSION0="sed -i '' 's/^version:.*/version: $VERSION/g' srs-stack/Chart.yaml" | ||
VERSION1="sed -i '' 's|v1.*/srs-stack|$TAG/srs-stack|g' srs-stack/Chart.yaml" | ||
fi | ||
if [[ ! -z $VERSION0 || ! -z $VERSION1 ]]; then | ||
echo "Please update version to $VERSION" | ||
if [[ ! -z $VERSION0 ]]; then echo " $VERSION0 &&"; fi | ||
if [[ ! -z $VERSION1 ]]; then echo " $VERSION1 &&"; fi | ||
echo " echo ok" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f stable/srs-stack-$VERSION.tgz ]]; then | ||
echo "Failed: No package at stable/srs-stack-$VERSION.tgz" | ||
echo "Please run:" | ||
echo " helm package srs-stack -d stable && \\" | ||
echo " helm repo index stable" | ||
exit 1 | ||
fi | ||
|
||
git st |grep -q 'nothing to commit' | ||
if [[ $? -ne 0 ]]; then | ||
echo "Failed: Please commit before release"; | ||
exit 1 | ||
fi | ||
|
||
git fetch origin | ||
if [[ $(git status |grep -q 'Your branch is up to date' || echo 'no') == no ]]; then | ||
git status | ||
echo "Failed: Please sync before release"; | ||
exit 1 | ||
fi | ||
echo "Sync OK" | ||
|
||
git tag -d $TAG 2>/dev/null; git push origin :$TAG 2>/dev/null | ||
echo "Delete tag OK: $TAG" | ||
|
||
git tag $TAG && git push origin $TAG | ||
echo "Publish OK: $TAG" | ||
|
||
echo -e "\n\n" | ||
echo "Chart srs-stack $VERSION ok, please release to official website by:" | ||
echo " ./auto/pub.sh" |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ keywords: | |
- webrtc | ||
- srt | ||
sources: | ||
- https://github.com/ossrs/srs-helm/tree/v1.0.0/srs-server | ||
- https://github.com/ossrs/srs-helm/tree/v1.0.5/srs-server | ||
maintainers: | ||
- name: Winlin | ||
email: [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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,28 @@ | ||
apiVersion: v2 | ||
name: srs-stack | ||
appVersion: "5.11.5" | ||
version: 1.0.1 | ||
description: SRS Stack is a one-click, open-source video solution for creating online services on | ||
cloud or self-hosting. Built with SRS, FFmpeg, and WebRTC, it supports various protocols and offers | ||
features like authentication, multi-platform streaming, recording, transcoding, virtual live events, | ||
automatic HTTPS, and HTTP Open API. | ||
home: https://helm.ossrs.io/stable | ||
icon: https://ossrs.io/lts/en-us/img/srs-220x234.png | ||
keywords: | ||
- srs | ||
- media | ||
- video | ||
- rtmp | ||
- hls | ||
- webrtc | ||
- srt | ||
sources: | ||
- https://github.com/ossrs/srs-helm/tree/v1.0.1/srs-stack | ||
maintainers: | ||
- name: Winlin | ||
email: [email protected] | ||
url: https://github.com/ossrs/srs-helm | ||
type: application | ||
annotations: | ||
category: Infrastructure | ||
licenses: MIT |
Empty file.
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,22 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "srs.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "srs.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "srs.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.http }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "srs.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
{{- end }} |
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "srs.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "srs.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "srs.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "srs.labels" -}} | ||
helm.sh/chart: {{ include "srs.chart" . }} | ||
{{ include "srs.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "srs.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "srs.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "srs.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "srs.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.