Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Jul 21, 2022
2 parents 2acec75 + 8dc8eb7 commit 8c95611
Show file tree
Hide file tree
Showing 507 changed files with 36,882 additions and 15,275 deletions.
116 changes: 58 additions & 58 deletions .github/workflows/build_base_alpine.yaml
@@ -1,62 +1,62 @@
name: 'Build base:alpine-core'
name: "Build base:alpine-core"

on:
workflow_dispatch:
push:
branches-ignore:
- '**'
workflow_dispatch:
push:
branches-ignore:
- "**"

jobs:
docker:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: cardinalby/export-env-action@v1
with:
envFile: '.github_build/Build.alpine.env'
export: 'true'
expandWithJobEnv: 'true'
expand: 'true'

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Multi-Arch
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
build-args: |
BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }}
GOLANG_IMAGE=${{ env.GOLANG_IMAGE }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
push: true
tags: |
datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }}
datarhei/base:${{ env.OS_NAME }}-core-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
docker:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: cardinalby/export-env-action@v1
with:
envFile: ".github_build/Build.alpine.env"
export: "true"
expandWithJobEnv: "true"
expand: "true"

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Multi-Arch
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
build-args: |
BUILD_IMAGE=${{ env.OS_NAME }}:${{ env.OS_VERSION }}
GOLANG_IMAGE=${{ env.GOLANG_IMAGE }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
push: true
tags: |
datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }}
datarhei/base:${{ env.OS_NAME }}-core-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
5 changes: 4 additions & 1 deletion .github/workflows/build_base_alpine_dev.yaml
@@ -1,4 +1,4 @@
name: 'Build datarhei/base:alpine-core-dev'
name: 'Build base:alpine-core:dev'

on:
workflow_dispatch:
Expand Down Expand Up @@ -81,9 +81,12 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
<<<<<<< HEAD
dockerBundle:
uses: ./.github/workflows/build_bundle_dev.yaml
secrets: inherit
dockerBundleRpi:
uses: ./.github/workflows/build_bundle-rpi_dev.yaml
secrets: inherit
=======
>>>>>>> dev
120 changes: 60 additions & 60 deletions .github/workflows/build_bundle-rpi.yaml
@@ -1,71 +1,71 @@
name: 'Build core:rpi'
name: "Build core:rpi"

on:
workflow_dispatch:
schedule:
- cron: '7 5 * * *'
push:
branches-ignore:
- '**'
workflow_dispatch:
schedule:
- cron: "7 5 * * *"
push:
branches-ignore:
- "**"

jobs:
docker:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2
docker:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: cardinalby/export-env-action@v1
with:
envFile: '.github_build/Build.alpine.env'
export: 'true'
expandWithJobEnv: 'true'
expand: 'true'
- uses: cardinalby/export-env-action@v1
with:
envFile: ".github_build/Build.alpine.env"
export: "true"
expandWithJobEnv: "true"
expand: "true"

- uses: cardinalby/export-env-action@v1
with:
envFile: '.github_build/Build.bundle.rpi.env'
export: 'true'
expandWithJobEnv: 'true'
expand: 'true'
- uses: cardinalby/export-env-action@v1
with:
envFile: ".github_build/Build.bundle.rpi.env"
export: "true"
expandWithJobEnv: "true"
expand: "true"

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Multi-Arch
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile.bundle
build-args: |
CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }}
FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-rpi-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }}
platforms: linux/arm/v7,linux/arm/v6,linux/arm64
push: true
tags: |
datarhei/core:rpi-${{ env.CORE_VERSION }}
datarhei/core:rpi-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Build Multi-Arch
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile.bundle
build-args: |
CORE_IMAGE=datarhei/base:${{ env.OS_NAME }}-core-${{ env.OS_VERSION }}-${{ env.CORE_VERSION }}
FFMPEG_IMAGE=datarhei/base:${{ env.OS_NAME }}-ffmpeg-rpi-${{ env.OS_VERSION }}-${{ env.FFMPEG_VERSION }}
platforms: linux/arm/v7,linux/arm/v6,linux/arm64
push: true
tags: |
datarhei/core:rpi-${{ env.CORE_VERSION }}
datarhei/core:rpi-latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
4 changes: 2 additions & 2 deletions .github_build/Build.alpine.env
@@ -1,5 +1,5 @@
# CORE ALPINE BASE IMAGE
OS_NAME=alpine
OS_VERSION=3.15
GOLANG_IMAGE=golang:1.18.2-alpine3.15
CORE_VERSION=16.8.0
GOLANG_IMAGE=golang:1.18.4-alpine3.15
CORE_VERSION=16.9.0
4 changes: 2 additions & 2 deletions .github_build/Build.ubuntu.env
@@ -1,5 +1,5 @@
# CORE UBUNTU BASE IMAGE
OS_NAME=ubuntu
OS_VERSION=20.04
GOLANG_IMAGE=golang:1.18.2-alpine3.15
CORE_VERSION=16.8.0
GOLANG_IMAGE=golang:1.18.4-alpine3.15
CORE_VERSION=16.9.0
15 changes: 15 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,20 @@
# Core

#### Core v16.8.0 > v16.9.0

- Add new placeholders and parameters for placeholder
- Allow RTMP server if RTMPS server is enabled. In case you already had RTMPS enabled it will listen on the same port as before. An RTMP server will be started additionally listening on a lower port number. The RTMP app is required to start with a slash.
- Add optional escape character to process placeholder
- Fix output address validation for tee outputs
- Fix updating process config
- Add experimental SRT connection stats and logs API
- Hide /config/reload endpoint in reade-only mode
- Add experimental SRT server (datarhei/gosrt)
- Create v16 in go.mod
- Fix data races, tests, lint, and update dependencies
- Add trailing slash for routed directories (datarhei/restreamer#340)
- Allow relative URLs in content in static routes

#### Core v16.7.2 > v16.8.0

- Add purge_on_delete function
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
@@ -1,4 +1,4 @@
ARG GOLANG_IMAGE=golang:1.17.6-alpine3.15
ARG GOLANG_IMAGE=golang:1.18.4-alpine3.15

ARG BUILD_IMAGE=alpine:3.15

Expand All @@ -11,8 +11,8 @@ RUN apk add \
make && \
cd /dist/core && \
go version && \
make release && \
make import
make release_linux && \
make import_linux

FROM $BUILD_IMAGE

Expand Down
8 changes: 8 additions & 0 deletions Dockerfile.test
@@ -0,0 +1,8 @@
FROM golang:1.18.3-alpine3.15

RUN apk add alpine-sdk

COPY . /dist/core

RUN cd /dist/core && \
go test -coverprofile=coverage.out -covermode=atomic -v ./...
20 changes: 16 additions & 4 deletions Makefile
Expand Up @@ -2,13 +2,17 @@ COMMIT := $(shell if [ -d .git ]; then git rev-parse HEAD; else echo "unknown";
SHORTCOMMIT := $(shell echo $(COMMIT) | head -c 7)
BRANCH := $(shell if [ -d .git ]; then git rev-parse --abbrev-ref HEAD; else echo "master"; fi)
BUILD := $(shell date -u "+%Y-%m-%dT%H:%M:%SZ")
OSARCH := $(shell if [ "${GOOS}" -a "${GOARCH}" ]; then echo "-${GOOS}-${GOARCH}"; else echo ""; fi)
BINSUFFIX := $(shell if [ "${GOOS}" -a "${GOARCH}" ]; then echo "-${GOOS}-${GOARCH}"; else echo ""; fi)

all: build

## build: Build core (default)
build:
CGO_ENABLED=0 GOOS=linux GOARCH=${OSARCH} go build -o core${OSARCH}
CGO_ENABLED=${CGO_ENABLED} GOOS=${GOOS} GOARCH=${GOARCH} go build -o core${BINSUFFIX}

# github workflow workaround
build_linux:
CGO_ENABLED=0 GOOS=linux GOARCH=${OSARCH} go build -o core

## swagger: Update swagger API documentation (requires github.com/swaggo/swag)
swagger:
Expand All @@ -20,7 +24,7 @@ gqlgen:

## test: Run all tests
test:
go test -coverprofile=/dev/null ./...
go test -race -coverprofile=/dev/null -v ./...

## vet: Analyze code for potential errors
vet:
Expand Down Expand Up @@ -54,11 +58,15 @@ lint:

## import: Build import binary
import:
cd app/import && CGO_ENABLED=${CGO_ENABLED} GOOS=${GOOS} GOARCH=${GOARCH} go build -o ../../import -ldflags="-s -w"

# github workflow workaround
import_linux:
cd app/import && CGO_ENABLED=0 GOOS=linux GOARCH=${OSARCH} go build -o ../../import -ldflags="-s -w"

## coverage: Generate code coverage analysis
coverage:
go test -coverprofile test/cover.out ./...
go test -race -coverprofile test/cover.out ./...
go tool cover -html=test/cover.out -o test/cover.html

## commit: Prepare code for commit (vet, fmt, test)
Expand All @@ -67,6 +75,10 @@ commit: vet fmt lint test build

## release: Build a release binary of core
release:
CGO_ENABLED=${CGO_ENABLED} GOOS=${GOOS} GOARCH=${GOARCH} go build -o core -ldflags="-s -w -X github.com/datarhei/core/app.Commit=$(COMMIT) -X github.com/datarhei/core/app.Branch=$(BRANCH) -X github.com/datarhei/core/app.Build=$(BUILD)"

# github workflow workaround
release_linux:
CGO_ENABLED=0 GOOS=linux GOARCH=${OSARCH} go build -o core -ldflags="-s -w -X github.com/datarhei/core/app.Commit=$(COMMIT) -X github.com/datarhei/core/app.Branch=$(BRANCH) -X github.com/datarhei/core/app.Build=$(BUILD)"

## docker: Build standard Docker image
Expand Down

0 comments on commit 8c95611

Please sign in to comment.