Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Bump to 0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Oct 9, 2023
1 parent a28592b commit 7754bdf
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 35 deletions.
40 changes: 28 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE:-debian:stable-slim}
FROM ${BASE_IMAGE:-debian:stable-slim} AS BASE

LABEL maintainer="GioF71"
LABEL source="https://github.com/GioF71/spotconnect-upnp-docker"

ENV PUID ""
ENV PGID ""
ENV PREFER_STATIC ""
RUN mkdir /app/bin -p
COPY app/bin/install-pkg.sh /app/bin/
RUN chmod u+x /app/bin/install-pkg.sh
RUN /app/bin/install-pkg.sh
RUN rm /app/bin/install-pkg.sh

VOLUME /config
COPY app/bin/download.sh /app/bin/
RUN chmod u+x /app/bin/download.sh
RUN /app/bin/download.sh
RUN rm /app/bin/download.sh

RUN mkdir /app/bin -p
COPY app/bin/install.sh /app/bin/
RUN chmod u+x /app/bin/install.sh
WORKDIR /app/bin/
RUN /app/bin/install.sh
RUN rm /app/bin/install.sh

COPY app/bin/cleanup.sh /app/bin/
RUN chmod u+x /app/bin/cleanup.sh
RUN /app/bin/cleanup.sh
RUN rm /app/bin/cleanup.sh

COPY app/bin/run.sh /app/bin
RUN chmod 755 /app/bin/run.sh

WORKDIR /app/bin
ENTRYPOINT ["/app/bin/run.sh"]
FROM scratch
COPY --from=BASE / /

LABEL maintainer="GioF71"
LABEL source="https://github.com/GioF71/spotconnect-upnp-docker"

ENV PUID ""
ENV PGID ""
ENV PREFER_STATIC ""

VOLUME /config

ENTRYPOINT ["/app/bin/run.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ services:

DATE|DESCRIPTION
:---|:---
2023-10-09|Bump to release [0.2.7](https://github.com/philippe44/SpotConnect/releases/tag/0.2.7) again
2023-10-09|Reverted to release [0.2.6](https://github.com/philippe44/SpotConnect/releases/tag/0.2.6)
2023-10-09|Bump to release [0.2.7](https://github.com/philippe44/SpotConnect/releases/tag/0.2.7)
2023-10-08|Docker images avaialable
Expand Down
8 changes: 8 additions & 0 deletions app/bin/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

rm -Rf /app/release/

apt-get remove -y wget unzip
apt-get autoremove -y

rm -rf /var/lib/apt/lists/*
10 changes: 10 additions & 0 deletions app/bin/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

SPOT_CONNECT_VERSION="0.2.7"

mkdir -p /app/release
cd /app/release
wget "https://github.com/philippe44/SpotConnect/releases/download/${SPOT_CONNECT_VERSION}/SpotConnect-${SPOT_CONNECT_VERSION}.zip"
unzip SpotConnect*zip
rm SpotConnect*zip

4 changes: 4 additions & 0 deletions app/bin/install-pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

apt-get update
apt-get install -y wget unzip
35 changes: 16 additions & 19 deletions app/bin/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

apt-get update
apt-get install -y wget unzip
# errors
# 1 missing binary file

mkdir /app/release -p
mkdir /app/bin -p

ARCH=`uname -m`
echo "ARCH=[$ARCH]"
Expand All @@ -19,30 +20,26 @@ bin_file_name[$arch_arm_v8]="spotupnp-linux-aarch64"

SELECT_BIN_FILE=${bin_file_name["${ARCH}"]}

echo "SELECT_BIN_FILE=[$SELECT_BIN_FILE]"
if [ ! -f "/app/release/$SELECT_BIN_FILE" ]; then
echo "File /app/release/$SELECT_BIN_FILE not found"
exit 1
fi

SPOT_CONNECT_VERSION="0.2.6"
if [ ! -f "/app/release/$SELECT_BIN_FILE-static" ]; then
echo "File /app/release/$SELECT_BIN_FILE-static not found"
exit 1
fi

cd /app/release
wget "https://github.com/philippe44/SpotConnect/releases/download/${SPOT_CONNECT_VERSION}/SpotConnect-${SPOT_CONNECT_VERSION}.zip"
unzip SpotConnect*zip
rm SpotConnect*zip
echo "SELECT_BIN_FILE=[$SELECT_BIN_FILE]"

mkdir -p /app/bin

mv $SELECT_BIN_FILE /app/bin/
chmod 755 "/app/bin/$SELECT_BIN_FILE"
mv "/app/release/$SELECT_BIN_FILE" /app/bin/spotupnp-linux
chmod 755 /app/bin/spotupnp-linux

mv "$SELECT_BIN_FILE-static" /app/bin/
chmod 755 "/app/bin/$SELECT_BIN_FILE-static"
mv "/app/release/$SELECT_BIN_FILE-static" /app/bin/spotupnp-linux-static
chmod 755 /app/bin/spotupnp-linux-static

mkdir /app/conf -p
echo "$SELECT_BIN_FILE" > /app/bin/executable.txt
echo "$SELECT_BIN_FILE-static" > /app/bin/executable-static.txt
echo "$SPOT_CONNECT_VERSION" > /app/bin/version.txt

apt-get remove -y wget unzip
apt-get autoremove -y

rm -Rf /app/release/
rm -rf /var/lib/apt/lists/*
7 changes: 3 additions & 4 deletions app/bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,24 @@ fi
chown -R $PUID:$PGID $HOME_DIR
chown -R $PUID:$PGID /config

executable_txt_file_name="/app/bin/executable.txt"
binary_file=/app/bin/spotupnp-linux
if [[ -n "$PREFER_STATIC" ]]; then
echo "PREFER_STATIC=[$PREFER_STATIC]"
if [[ "${PREFER_STATIC^^}" == "YES" || "${PREFER_STATIC^^}" == "Y" ]]; then
echo "Selecting static version ..."
executable_txt_file_name="/app/bin/executable-static.txt"
binary_file=$binary_file-static
echo ". done."
elif [[ "${PREFER_STATIC^^}" != "NO" && "${PREFER_STATIC^^}" != "N" ]]; then
echo "Invalid value for PREFER_STATIC [$PREFER_STATIC]!"
exit 1
fi
fi

binary_file=$(cat $executable_txt_file_name)
version=$(cat /app/bin/version.txt)

echo "Using SpotConnect upnp version [${version}]"

CMD_LINE="/app/bin/$binary_file"
CMD_LINE="$binary_file"

mkdir /app/conf -p

Expand Down

0 comments on commit 7754bdf

Please sign in to comment.