Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Sep 23, 2022
1 parent 93be0a9 commit 12c7cc2
Show file tree
Hide file tree
Showing 7 changed files with 341 additions and 93 deletions.
100 changes: 47 additions & 53 deletions .github/workflows/docker-multi-arch.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,52 @@
name: Publish multi-arch Docker images

on:
push:
branches:
- main
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
base: [ 'ubuntu:focal-20220302' ]

steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set Release Tag
run: |
date=$(date '+%Y-%m-%d')
base="$(cut -d ':' -f2 <<< '${{ matrix.base }}')"
base="$(cut -d '-' -f1 <<< ${base})"
upmpdcli_version="upmpdcli-1.5.12-libupnpp-0.21.0"
image_name="${{secrets.DOCKER_USERNAME}}/upmpdcli"
full="${upmpdcli_version}-${base}-${date}"
version_and_base="${upmpdcli_version}-${base}"
base_only="${base}"
tags="${image_name}:${base_only},${image_name}:${version_and_base},${image_name}:${full},${image_name}:latest,${image_name}:stable"
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
build-args: |
BASE_IMAGE=${{ matrix.base }}
DOWNLOAD_FROM_SOURCEFORGE=${{ matrix.sourceforge }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ env.RELEASE_TAGS }}
release:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
base: ["ubuntu:jammy"]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set Release Tag
run: |
date=$(date '+%Y-%m-%d')
base="$(cut -d ':' -f2 <<< '${{ matrix.base }}')"
base="$(cut -d '-' -f1 <<< ${base})"
upmpdcli_version="upmpdcli-1.5.20-libupnpp-0.22.2"
image_name="${{secrets.DOCKER_USERNAME}}/upmpdcli"
full="${upmpdcli_version}-${base}-${date}"
version_and_base="${upmpdcli_version}-${base}"
base_only="${base}"
tags="${image_name}:${base_only},${image_name}:${version_and_base},${image_name}:${full},${image_name}:latest,${image_name}:stable"
echo "RELEASE_TAGS=${tags}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
build-args: |
BASE_IMAGE=${{ matrix.base }}
DOWNLOAD_FROM_SOURCEFORGE=${{ matrix.sourceforge }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ env.RELEASE_TAGS }}
1 change: 1 addition & 0 deletions 01proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Acquire::http::proxy "http://apt.homelab.com:3142";
28 changes: 19 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE} AS base
FROM ubuntu:jammy AS base

COPY 01proxy /etc/apt/apt.conf.d/01proxy

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get upgrade -y && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jean-francois-dockes/upnpp1 && \
apt-get update && \
apt-get install upmpdcli -y && \
apt-get install upmpdcli-qobuz -y && \
apt-get install upmpdcli-spotify -y && \
apt-get install upmpdcli-tidal -y && \
apt-get install upmpdcli-* -y && \
apt-get remove software-properties-common -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -19,13 +20,22 @@ RUN mkdir -p /app
RUN mkdir -p /app/conf
RUN mkdir -p /app/doc

RUN echo "--- BEGIN upmpdcli.conf ---"
RUN cat /etc/upmpdcli.conf
RUN echo "--- END upmpdcli.conf ---"

RUN cp /etc/upmpdcli.conf /app/conf/original.upmpdcli.conf

ENV UPMPD_FRIENDLY_NAME upmpd
ENV AV_FRIENDLY_NAME upmpd-av
ENV UPMPD_FRIENDLY_NAME ""
ENV AV_FRIENDLY_NAME ""

ENV UPNPAV 1
ENV OPENHOME 1

ENV MPD_HOST ""
ENV MPD_PORT ""

ENV MPD_HOST localhost
ENV MPD_PORT 6600
ENV UPNPIFACE ""

ENV TIDAL_ENABLE no
ENV TIDAL_USERNAME tidal_username
Expand Down
68 changes: 64 additions & 4 deletions app/bin/run-upmpdcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,70 @@ if test -f "$CONFIG_FILE"; then
else
echo "Configuration file [$CONFIG_FILE] not found, creating."
cp $SOURCE_CONFIG_FILE $CONFIG_FILE
sed -i 's/UPMPD_FRIENDLY_NAME/'"$UPMPD_FRIENDLY_NAME"'/g' $CONFIG_FILE
sed -i 's/AV_FRIENDLY_NAME/'"$AV_FRIENDLY_NAME"'/g' $CONFIG_FILE
sed -i 's/MPD_HOST/'"$MPD_HOST"'/g' $CONFIG_FILE
sed -i 's/MPD_PORT/'"$MPD_PORT"'/g' $CONFIG_FILE

echo "UPNPIFACE=["$UPNPIFACE"]"
if [ -z "${UPNPIFACE}" ]; then
echo "UPNPIFACE not set"
else
echo "Setting UPNPIFACE to ["$UPNPIFACE"]"
sed -i 's/\#upnpiface/upnpiface/g' $CONFIG_FILE;
sed -i 's/UPNPIFACE/'"$UPNPIFACE"'/g' $CONFIG_FILE;
fi

echo "UPMPD_FRIENDLY_NAME=["$UPMPD_FRIENDLY_NAME"]"
if [ -z "${UPMPD_FRIENDLY_NAME}" ]; then
echo "UPMPD_FRIENDLY_NAME not set"
else
echo "Setting UPMPD_FRIENDLY_NAME to ["$UPMPD_FRIENDLY_NAME"]"
sed -i 's/\#friendlyname/friendlyname/g' $CONFIG_FILE;
sed -i 's/UPMPD_FRIENDLY_NAME/'"$UPMPD_FRIENDLY_NAME"'/g' $CONFIG_FILE;
fi

echo "UPNPAV=["$UPNPAV"]"
if [ -z "${UPNPAV}" ]; then
echo "UPNPAV not set"
else
echo "Setting UPNPAV to ["$UPNPAV"]"
sed -i 's/\#upnpav/upnpav/g' $CONFIG_FILE;
sed -i 's/UPNPAV/'"$UPNPAV"'/g' $CONFIG_FILE;
fi

echo "OPENHOME=["$OPENHOME"]"
if [ -z "${OPENHOME}" ]; then
echo "OPENHOME not set"
else
echo "Setting OPENHOME to ["$OPENHOME"]"
sed -i 's/\#openhome/openhome/g' $CONFIG_FILE;
sed -i 's/OPENHOME/'"$OPENHOME"'/g' $CONFIG_FILE;
fi

echo "AV_FRIENDLY_NAME=["$AV_FRIENDLY_NAME"]"
if [ -z "${AV_FRIENDLY_NAME}" ]; then
echo "AV_FRIENDLY_NAME not set"
else
echo "Setting AV_FRIENDLY_NAME to ["$AV_FRIENDLY_NAME"]"
sed -i 's/\#avfriendlyname/avfriendlyname/g' $CONFIG_FILE;
sed -i 's/AV_FRIENDLY_NAME/'"$AV_FRIENDLY_NAME"'/g' $CONFIG_FILE;
fi

echo "MPD_HOST=["$MPD_HOST"]"
if [ -z "${MPD_HOST}" ]; then
echo "MPD_HOST not set"
else
echo "Setting MPD_HOST to ["$MPD_HOST"]"
sed -i 's/\#mpdhost/mpdhost/g' $CONFIG_FILE;
sed -i 's/MPD_HOST/'"$MPD_HOST"'/g' $CONFIG_FILE;
fi

echo "MPD_PORT=["$MPD_PORT"]"
if [ -z "${MPD_PORT}" ]; then
echo "MPD_PORT not set"
else
echo "Setting MPD_PORT to ["$MPD_PORT"]"
sed -i 's/\#mpdport/mpdport/g' $CONFIG_FILE;
sed -i 's/MPD_PORT/'"$MPD_PORT"'/g' $CONFIG_FILE;
fi

echo "Tidal Enable: $TIDAL_ENABLE"
if [ "$TIDAL_ENABLE" == "yes" ]; then
echo "Processing Tidal settings";
Expand Down
Loading

0 comments on commit 12c7cc2

Please sign in to comment.